NFF: Reduce scope of a variable

pull/1498/head
Turo Lamminen 2017-11-07 19:12:44 +02:00
parent 940449d837
commit 2b93a210c9
1 changed files with 5 additions and 6 deletions

View File

@ -243,8 +243,6 @@ void NFFImporter::InternReadFile( const std::string& pFile,
if( !file.get())
throw DeadlyImportError( "Failed to open NFF file " + pFile + ".");
unsigned int m = (unsigned int)file->FileSize();
// allocate storage and copy the contents of the file to a memory buffer
// (terminate it with zero)
std::vector<char> mBuffer2;
@ -469,7 +467,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
for (unsigned int a = 0; a < numIdx;++a)
{
SkipSpaces(sz,&sz);
m = ::strtoul10(sz,&sz);
unsigned int m = ::strtoul10(sz,&sz);
if (m >= (unsigned int)tempPositions.size())
{
DefaultLogger::get()->error("NFF2: Vertex index overflow");
@ -635,7 +633,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
for (std::vector<unsigned int>::const_iterator it = tempIdx.begin(), end = tempIdx.end();
it != end;++it)
{
m = *it;
unsigned int m = *it;
// copy colors -vertex color specifications override polygon color specifications
if (hasColor)
@ -735,7 +733,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
sz = &line[1];out = currentMesh;
}
SkipSpaces(sz,&sz);
m = strtoul10(sz);
unsigned int m = strtoul10(sz);
// ---- flip the face order
out->vertices.resize(out->vertices.size()+m);
@ -1128,7 +1126,8 @@ void NFFImporter::InternReadFile( const std::string& pFile,
if (!pScene->mNumMeshes)throw DeadlyImportError("NFF: No meshes loaded");
pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = pScene->mNumMeshes];
for (it = meshes.begin(), m = 0; it != end;++it)
unsigned int m = 0;
for (it = meshes.begin(); it != end;++it)
{
if ((*it).faces.empty())continue;