use size_t instead of unsigned int ( static code analysis finding ).

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
pull/522/merge
Kim Kulling 2015-04-05 21:19:07 +02:00
parent 50d5c5c4ef
commit c0e3540ec1
1 changed files with 8 additions and 7 deletions

View File

@ -197,7 +197,7 @@ void ObjFileImporter::CreateDataFromImport(const ObjFile::Model* pModel, aiScene
pScene->mMeshes = new aiMesh*[ MeshArray.size() ]; pScene->mMeshes = new aiMesh*[ MeshArray.size() ];
for (size_t index =0; index < MeshArray.size(); index++) for (size_t index =0; index < MeshArray.size(); index++)
{ {
pScene->mMeshes [ index ] = MeshArray[ index ]; pScene->mMeshes[ index ] = MeshArray[ index ];
} }
} }
@ -227,7 +227,7 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
appendChildToParentNode( pParent, pNode ); appendChildToParentNode( pParent, pNode );
} }
for ( unsigned int i=0; i< pObject->m_Meshes.size(); i++ ) for ( size_t i=0; i< pObject->m_Meshes.size(); i++ )
{ {
unsigned int meshId = pObject->m_Meshes[ i ]; unsigned int meshId = pObject->m_Meshes[ i ];
aiMesh *pMesh = createTopology( pModel, pObject, meshId ); aiMesh *pMesh = createTopology( pModel, pObject, meshId );
@ -267,16 +267,17 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Create topology data // Create topology data
aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData, aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData,
unsigned int uiMeshIndex ) unsigned int meshIndex )
{ {
// Checking preconditions // Checking preconditions
ai_assert( NULL != pModel ); ai_assert( NULL != pModel );
if( NULL == pData ) { if( NULL == pData ) {
return NULL; return NULL;
} }
// Create faces // Create faces
ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ]; ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ meshIndex ];
if( !pObjMesh ) { if( !pObjMesh ) {
return NULL; return NULL;
} }
@ -345,7 +346,7 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj
} }
// Create mesh vertices // Create mesh vertices
createVertexArray(pModel, pData, uiMeshIndex, pMesh, uiIdxCount); createVertexArray(pModel, pData, meshIndex, pMesh, uiIdxCount);
return pMesh; return pMesh;
} }
@ -356,7 +357,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
const ObjFile::Object* pCurrentObject, const ObjFile::Object* pCurrentObject,
unsigned int uiMeshIndex, unsigned int uiMeshIndex,
aiMesh* pMesh, aiMesh* pMesh,
unsigned int uiIdxCount) unsigned int numIndices)
{ {
// Checking preconditions // Checking preconditions
ai_assert( NULL != pCurrentObject ); ai_assert( NULL != pCurrentObject );
@ -371,7 +372,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
return; return;
// Copy vertices of this mesh instance // Copy vertices of this mesh instance
pMesh->mNumVertices = uiIdxCount; pMesh->mNumVertices = numIndices;
pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ]; pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ];
// Allocate buffer for normal vectors // Allocate buffer for normal vectors