remove "register" keyword:

clang warns: 'register' storage class specifier is deprecated
http://stackoverflow.com/questions/10675072/is-the-register-keyword-still-used
pull/476/head
abma 2015-03-02 23:44:02 +01:00
parent b1e8c192db
commit c4997f16db
18 changed files with 28 additions and 28 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -346,7 +346,7 @@ struct VColorChannel : public VMapEntry
if (!rawData.empty()) if (!rawData.empty())
return; // return if already allocated 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.reserve(m + (m>>2u)); // 25% as extra storage for VMADs
rawData.resize(m); rawData.resize(m);

View File

@ -344,7 +344,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
// copy all vertices // copy all vertices
for (unsigned int q = 0; q < face.mNumIndices;++q,++vert) { 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*/; *pv++ = layer.mTempPoints[idx] /*- layer.mPivot*/;
// process UV coordinates // process UV coordinates
@ -491,7 +491,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
aiFace& face = *begin; aiFace& face = *begin;
for (unsigned int i = 0; i < face.mNumIndices;++i) 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); 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; unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
for (; beginIdx != endIdx; ++beginIdx) for (; beginIdx != endIdx; ++beginIdx)
{ {
register unsigned int idx = *beginIdx; unsigned int idx = *beginIdx;
sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true); sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
std::vector<unsigned int>::const_iterator a, end = poResult.end(); 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; unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
for (; beginIdx != endIdx; ++beginIdx) for (; beginIdx != endIdx; ++beginIdx)
{ {
register unsigned int idx = *beginIdx; unsigned int idx = *beginIdx;
if (vertexDone[idx]) if (vertexDone[idx])
continue; continue;
sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true); 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)"); 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) if (mIsLWO2)
{ {
mCurLayer->mTempPoints.reserve ( regularSize + (regularSize>>2u) ); mCurLayer->mTempPoints.reserve ( regularSize + (regularSize>>2u) );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -289,7 +289,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene)
for (unsigned int q = 0; q < in.mNumIndices; ++q) 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 // process all bones of this index
if (avw) if (avw)

View File

@ -137,7 +137,7 @@ inline int ASSIMP_stricmp(const char *s1, const char *s2)
return ::strcasecmp(s1,s2); return ::strcasecmp(s1,s2);
#else #else
register char c1, c2; char c1, c2;
do { do {
c1 = tolower(*s1++); c1 = tolower(*s1++);
c2 = tolower(*s2++); 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) 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())); 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); return ::strncasecmp(s1,s2, n);
#else #else
register char c1, c2; char c1, c2;
unsigned int p = 0; unsigned int p = 0;
do do
{ {

View File

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