From 5c1804f3ad2b67762a9bef0d38537d8c4b0bda39 Mon Sep 17 00:00:00 2001 From: kimmi Date: Sat, 10 Oct 2009 11:59:00 +0000 Subject: [PATCH] - BUGFIX : Fixed compiler warning ( constant condition ). - BUGFIX : Fixed compiler warning ( not referenced parameter ). git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@490 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/XFileParser.cpp | 36 +++++++++++++++++++++++------------- code/fast_atof.h | 12 ++++++++---- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 8a23f1bb9..e133186ed 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -61,13 +61,13 @@ using namespace Assimp::XFile; // ------------------------------------------------------------------------------------------------ // Dummy memory wrappers for use with zlib -void* dummy_alloc (void* opaque, unsigned int items, unsigned int size) { +void* dummy_alloc (void* /*opaque*/, unsigned int items, unsigned int size) { // we're using calloc to make it easier to debug the whole stuff return ::calloc(items,size); } -void dummy_free (void* opaque, void* address) { +void dummy_free (void* /*opaque*/, void* address) { return ::free(address); } @@ -265,7 +265,8 @@ XFileParser::~XFileParser() // ------------------------------------------------------------------------------------------------ void XFileParser::ParseFile() { - while( 1) + bool running = true; + while( running ) { // read name of next object std::string objectName = GetNextToken(); @@ -323,7 +324,8 @@ void XFileParser::ParseDataObjectTemplate() std::string guid = GetNextToken(); // read and ignore data members - while(true) + bool running = true; + while ( running ) { std::string s = GetNextToken(); @@ -378,7 +380,8 @@ void XFileParser::ParseDataObjectFrame( Node* pParent) // Now inside a frame. // read tokens until closing brace is reached. - while(true) + bool running = true; + while ( running ) { std::string objectName = GetNextToken(); if (objectName.size() == 0) @@ -458,7 +461,8 @@ void XFileParser::ParseDataObjectMesh( Mesh* pMesh) } // here, other data objects may follow - while(true) + bool running = true; + while ( running ) { std::string objectName = GetNextToken(); @@ -538,7 +542,7 @@ void XFileParser::ParseDataObjectSkinWeights( Mesh *pMesh) } // ------------------------------------------------------------------------------------------------ -void XFileParser::ParseDataObjectSkinMeshHeader( Mesh* pMesh) +void XFileParser::ParseDataObjectSkinMeshHeader( Mesh* /*pMesh*/ ) { readHeadOfDataObject(); @@ -662,7 +666,8 @@ void XFileParser::ParseDataObjectMeshMaterialList( Mesh* pMesh) pMesh->mFaceMaterials.push_back( pMesh->mFaceMaterials.front()); // read following data objects - while(true) + bool running = true; + while ( running ) { std::string objectName = GetNextToken(); if( objectName.size() == 0) @@ -713,7 +718,8 @@ void XFileParser::ParseDataObjectMaterial( Material* pMaterial) pMaterial->mEmissive = ReadRGB(); // read other data objects - while(true) + bool running = true; + while ( running ) { std::string objectName = GetNextToken(); if( objectName.size() == 0) @@ -761,7 +767,8 @@ void XFileParser::ParseDataObjectAnimationSet() mScene->mAnims.push_back( anim); anim->mName = animName; - while(true) + bool running = true; + while ( running ) { std::string objectName = GetNextToken(); if( objectName.length() == 0) @@ -787,7 +794,8 @@ void XFileParser::ParseDataObjectAnimation( Animation* pAnim) AnimBone* banim = new AnimBone; pAnim->mAnims.push_back( banim); - while(true) + bool running = true; + while( running ) { std::string objectName = GetNextToken(); @@ -930,7 +938,8 @@ void XFileParser::ParseDataObjectTextureFilename( std::string& pName) void XFileParser::ParseUnknownDataObject() { // find opening delimiter - while( true) + bool running = true; + while( running ) { std::string t = GetNextToken(); if( t.length() == 0) @@ -1128,7 +1137,8 @@ void XFileParser::FindNextNoneWhiteSpace() if( mIsBinaryFormat) return; - while( true) + bool running = true; + while( running ) { while( P < End && isspace( (unsigned char) *P)) { diff --git a/code/fast_atof.h b/code/fast_atof.h index c3104e246..cc5c8f6eb 100644 --- a/code/fast_atof.h +++ b/code/fast_atof.h @@ -47,7 +47,8 @@ inline unsigned int strtol10( const char* in, const char** out=0) { unsigned int value = 0; - while ( 1 ) + bool running = true; + while ( running ) { if ( *in < '0' || *in > '9' ) break; @@ -66,7 +67,8 @@ inline unsigned int strtol8( const char* in, const char** out=0) { unsigned int value = 0; - while ( 1 ) + bool running = true; + while ( running ) { if ( *in < '0' || *in > '7' ) break; @@ -85,7 +87,8 @@ inline unsigned int strtol16( const char* in, const char** out=0) { unsigned int value = 0; - while ( 1 ) + bool running = true; + while ( running ) { if ( *in >= '0' && *in <= '9' ) { @@ -176,7 +179,8 @@ inline uint64_t strtol10_64( const char* in, const char** out=0, unsigned int* m unsigned int cur = 0; uint64_t value = 0; - while ( 1 ) + bool running = true; + while ( running ) { if ( *in < '0' || *in > '9' ) break;