فهرست منبع

remove "register" keyword:

clang warns: 'register' storage class specifier is deprecated
http://stackoverflow.com/questions/10675072/is-the-register-keyword-still-used
abma 10 سال پیش
والد
کامیت
c4997f16db

+ 1 - 1
code/3DSConverter.cpp

@@ -396,7 +396,7 @@ void Discreet3DSImporter::ConvertMeshes(aiScene* pcOut)
 			}
 			for (unsigned int q = 0, base = 0; q < aiSplit[p].size();++q)
 			{
-				register unsigned int index = aiSplit[p][q];
+				unsigned int index = aiSplit[p][q];
 				aiFace& face = meshOut->mFaces[q];
 
 				face.mIndices = new unsigned int[3];

+ 2 - 2
code/ACLoader.cpp

@@ -489,7 +489,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
 
 			for (it = object.surfaces.begin(); it != end; ++it)
 			{
-				register unsigned int idx = (*it).mat;
+				unsigned int idx = (*it).mat;
 				if (idx >= needMat.size())
 				{
 					DefaultLogger::get()->error("AC3D: material index is out of range");
@@ -617,7 +617,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
 							it2  = (*it).entries.begin();
 
 							// either a closed or an unclosed line
-							register unsigned int tmp = (unsigned int)(*it).entries.size();
+							unsigned int tmp = (unsigned int)(*it).entries.size();
 							if (0x2 == type)--tmp;
 							for (unsigned int m = 0; m < tmp;++m)
 							{

+ 1 - 1
code/CalcTangentsProcess.cpp

@@ -167,7 +167,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
 			// their tangent vectors are set to qnan.
 			for (unsigned int i = 0; i < face.mNumIndices;++i)
 			{
-				register unsigned int idx = face.mIndices[i];
+				unsigned int idx = face.mIndices[i];
 				vertexDone  [idx] = true;
 				meshTang    [idx] = aiVector3D(qnan);
 				meshBitang  [idx] = aiVector3D(qnan);

+ 2 - 2
code/FindDegenerates.cpp

@@ -107,7 +107,7 @@ void FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh)
 		bool first = true;
 
 		// check whether the face contains degenerated entries
-		for (register unsigned int i = 0; i < face.mNumIndices; ++i)
+		for (unsigned int i = 0; i < face.mNumIndices; ++i)
 		{
 			// Polygons with more than 4 points are allowed to have double points, that is
 			// simulating polygons with holes just with concave polygons. However,
@@ -116,7 +116,7 @@ void FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh)
 			if (face.mNumIndices > 4)
 				limit = std::min(limit,i+2);
 
-			for (register unsigned int t = i+1; t < limit; ++t)
+			for (unsigned int t = i+1; t < limit; ++t)
 			{
 				if (mesh->mVertices[face.mIndices[i]] == mesh->mVertices[face.mIndices[t]])
 				{

+ 1 - 1
code/FindInvalidDataProcess.cpp

@@ -89,7 +89,7 @@ void UpdateMeshReferences(aiNode* node, const std::vector<unsigned int>& meshMap
 		unsigned int out = 0;
 		for (unsigned int a = 0; a < node->mNumMeshes;++a)	{
 
-			register unsigned int ref = node->mMeshes[a];
+			unsigned int ref = node->mMeshes[a];
 			if (UINT_MAX != (ref = meshMapping[ref]))	{
 				node->mMeshes[out++] = ref;
 			}

+ 1 - 1
code/GenVertexNormalsProcess.cpp

@@ -195,7 +195,7 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int
 			// Write the smoothed normal back to all affected normals
 			for (unsigned int a = 0; a < verticesFound.size(); ++a)
 			{
-				register unsigned int vidx = verticesFound[a];
+				unsigned int vidx = verticesFound[a];
 				pcNew[vidx] = pcNor;
 				abHad[vidx] = true;
 			}

+ 1 - 1
code/ImproveCacheLocality.cpp

@@ -303,7 +303,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh
 		ivdx = -1; 
 		int max_priority = -1;
 		for (unsigned int* piCur = piCandidates;piCur != piCurCandidate;++piCur)	{
-			register const unsigned int dp = *piCur;
+			const unsigned int dp = *piCur;
 
 			// must have live triangles
 			if (piNumTriPtr[dp] > 0)	{

+ 1 - 1
code/LWOFileData.h

@@ -346,7 +346,7 @@ struct VColorChannel : public VMapEntry
 		if (!rawData.empty())
 			return; // return if already allocated
 
-		register unsigned int m = num*dims;
+		unsigned int m = num*dims;
 		rawData.reserve(m + (m>>2u)); // 25% as  extra storage for VMADs
 		rawData.resize(m);
 

+ 5 - 5
code/LWOLoader.cpp

@@ -344,7 +344,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
 
 					// copy all vertices
 					for (unsigned int q = 0; q  < face.mNumIndices;++q,++vert)	{
-						register unsigned int idx = face.mIndices[q];
+						unsigned int idx = face.mIndices[q];
 						*pv++ = layer.mTempPoints[idx] /*- layer.mPivot*/;
 
 						// process UV coordinates
@@ -491,7 +491,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
 		aiFace& face = *begin;
 		for (unsigned int i = 0; i < face.mNumIndices;++i)
 		{
-			register unsigned int tt = face.mIndices[i];
+			unsigned int tt = face.mIndices[i];
 			sSort.Add(mesh->mVertices[tt],tt,*it);
 		}
 	}
@@ -510,7 +510,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
 			unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
 			for (; beginIdx != endIdx; ++beginIdx)
 			{
-				register unsigned int idx = *beginIdx;
+				unsigned int idx = *beginIdx;
 				sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
 				std::vector<unsigned int>::const_iterator a, end = poResult.end();
 
@@ -533,7 +533,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
 			unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
 			for (; beginIdx != endIdx; ++beginIdx)
 			{
-				register unsigned int idx = *beginIdx;
+				unsigned int idx = *beginIdx;
 				if (vertexDone[idx])
 					continue;
 				sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
@@ -735,7 +735,7 @@ void LWOImporter::LoadLWOPoints(unsigned int length)
 	{
 		throw DeadlyImportError( "LWO2: Points chunk length is not multiple of vertexLen (12)");
 	}
-	register unsigned int regularSize = (unsigned int)mCurLayer->mTempPoints.size() + length / 12;
+	unsigned int regularSize = (unsigned int)mCurLayer->mTempPoints.size() + length / 12;
 	if (mIsLWO2)
 	{
 		mCurLayer->mTempPoints.reserve	( regularSize + (regularSize>>2u) );

+ 1 - 1
code/MD2Loader.cpp

@@ -377,7 +377,7 @@ void MD2Importer::InternReadFile( const std::string& pFile,
 		for (unsigned int c = 0; c < 3;++c,++iCurrent)	{
 
 			// validate vertex indices
-			register unsigned int iIndex = (unsigned int)pcTriangles[i].vertexIndices[c];
+			unsigned int iIndex = (unsigned int)pcTriangles[i].vertexIndices[c];
 			if (iIndex >= m_pcHeader->numVertices)	{
 				DefaultLogger::get()->error("MD2: Vertex index is outside the allowed range");
 				iIndex = m_pcHeader->numVertices-1;

+ 1 - 1
code/NFFLoader.cpp

@@ -400,7 +400,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
 						if (TokenMatch(sz,"0x",2))
 						{
 							hasColor = true;
-							register unsigned int numIdx = ::strtoul16(sz,&sz);
+							unsigned int numIdx = ::strtoul16(sz,&sz);
 							aiColor4D clr;
 							clr.a = 1.f;
 

+ 1 - 1
code/OptimizeMeshes.cpp

@@ -170,7 +170,7 @@ void OptimizeMeshesProcess::ProcessNode( aiNode* pNode)
 
 			// Find meshes to merge with us
 			for (unsigned int a = i+1; a < pNode->mNumMeshes;++a) {
-				register unsigned int am = pNode->mMeshes[a];
+				unsigned int am = pNode->mMeshes[a];
 				if (meshes[am].instance_cnt == 1 && CanJoin(im,am,verts,faces)) {
 
 					merge_list.push_back(mScene->mMeshes[am]);

+ 2 - 2
code/PlyParser.cpp

@@ -794,7 +794,7 @@ bool PLY::PropertyInstance::ParseValue(
 {
 	ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
 
-	register bool ret = true;
+	bool ret = true;
 	*pCurOut = pCur;
 	switch (eType)
 	{
@@ -841,7 +841,7 @@ bool PLY::PropertyInstance::ParseValueBinary(
 {
 	ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
 
-	register bool ret = true;
+	bool ret = true;
 	switch (eType)
 	{
 	case EDT_UInt:

+ 1 - 1
code/Q3DLoader.cpp

@@ -314,7 +314,7 @@ void Q3DImporter::InternReadFile( const std::string& pFile,
 				if (!tex->mWidth || !tex->mHeight)
 					throw DeadlyImportError("Quick3D: Invalid texture. Width or height is zero");
 
-				register unsigned int mul = tex->mWidth * tex->mHeight;
+				unsigned int mul = tex->mWidth * tex->mHeight;
 				aiTexel* begin = tex->pcData = new aiTexel[mul];
 				aiTexel* const end = & begin [mul];
 

+ 2 - 2
code/RemoveVCProcess.cpp

@@ -84,7 +84,7 @@ inline void ArrayDelete(T**& in, unsigned int& num)
 // "don't remove" flag not set. Nodes with meshes are never deleted.
 bool UpdateNodeGraph(aiNode* node,std::list<aiNode*>& childsOfParent,bool root)
 {
-	register bool b = false;
+	bool b = false;
 
 	std::list<aiNode*> mine;
 	for (unsigned int i = 0; i < node->mNumChildren;++i)
@@ -271,7 +271,7 @@ bool RemoveVCProcess::ProcessMesh(aiMesh* pMesh)
 	}
 
 	// handle texture coordinates
-	register bool b = (0 != (configDeleteFlags & aiComponent_TEXCOORDS));
+	bool b = (0 != (configDeleteFlags & aiComponent_TEXCOORDS));
 	for (unsigned int i = 0, real = 0; real < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++real)
 	{
 		if (!pMesh->mTextureCoords[i])break;

+ 1 - 1
code/SortByPTypeProcess.cpp

@@ -289,7 +289,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene)
 
 				for (unsigned int q = 0; q < in.mNumIndices; ++q)
 				{
-					register unsigned int idx = in.mIndices[q];
+					unsigned int idx = in.mIndices[q];
 
 					// process all bones of this index
 					if (avw)

+ 3 - 3
code/StringComparison.h

@@ -137,7 +137,7 @@ inline int ASSIMP_stricmp(const char *s1, const char *s2)
 	return ::strcasecmp(s1,s2);
 #else
 	
-	register char c1, c2;
+	char c1, c2;
 	do	{
 		c1 = tolower(*s1++);
 		c2 = tolower(*s2++);
@@ -156,7 +156,7 @@ inline int ASSIMP_stricmp(const char *s1, const char *s2)
  */
 inline int ASSIMP_stricmp(const std::string& a, const std::string& b)
 {
-	register int i = (int)b.length()-(int)a.length();
+	int i = (int)b.length()-(int)a.length();
 	return (i ? i : ASSIMP_stricmp(a.c_str(),b.c_str()));
 }
 
@@ -186,7 +186,7 @@ inline int ASSIMP_strincmp(const char *s1, const char *s2, unsigned int n)
 	return ::strncasecmp(s1,s2, n);
 
 #else
-	register char c1, c2;
+	char c1, c2;
 	unsigned int p = 0;
 	do 
 	{

+ 1 - 1
code/TerragenLoader.cpp

@@ -225,7 +225,7 @@ void TerragenImporter::InternReadFile( const std::string& pFile,
 
 					// make verts
 					const float fy = (float)yy, fx = (float)xx;
-					register unsigned tmp,tmp2;
+					unsigned tmp,tmp2;
 					*pv++ = aiVector3D(fx,fy,    (float)data[(tmp2=x*yy)    + xx] * hscale + bheight);
 					*pv++ = aiVector3D(fx,fy+1,  (float)data[(tmp=x*(yy+1)) + xx] * hscale + bheight);
 					*pv++ = aiVector3D(fx+1,fy+1,(float)data[tmp  + xx+1]         * hscale + bheight);