Merge pull request #429 from abma/master

fix some errors/warnings found by static code analyzer
pull/432/head
Alexander Gessler 2014-12-17 01:02:35 +01:00
commit 7a850a4131
7 changed files with 10 additions and 11 deletions

View File

@ -468,7 +468,7 @@ struct aiFloatKey
{return mTime < o.mTime;} {return mTime < o.mTime;}
bool operator > (const aiFloatKey& o) const bool operator > (const aiFloatKey& o) const
{return mTime < o.mTime;} {return mTime > o.mTime;}
#endif #endif
}; };

View File

@ -1525,7 +1525,7 @@ void Parser::ParseLV3MeshWeightsBlock(ASE::Mesh& mesh)
continue; continue;
} }
// Number of bones // Number of bones
if (TokenMatch(filePtr,"MESH_NUMBONE" ,11)) if (TokenMatch(filePtr,"MESH_NUMBONE" ,12))
{ {
ParseLV4MeshLong(iNumBones); ParseLV4MeshLong(iNumBones);
continue; continue;
@ -1559,7 +1559,7 @@ void Parser::ParseLV4MeshBones(unsigned int iNumBones,ASE::Mesh& mesh)
++filePtr; ++filePtr;
// Mesh bone with name ... // Mesh bone with name ...
if (TokenMatch(filePtr,"MESH_BONE_NAME" ,16)) if (TokenMatch(filePtr,"MESH_BONE_NAME" ,14))
{ {
// parse an index ... // parse an index ...
if(SkipSpaces(&filePtr)) if(SkipSpaces(&filePtr))

View File

@ -548,7 +548,7 @@ aiNode *B3DImporter::ReadNODE( aiNode *parent ){
void B3DImporter::ReadBB3D( aiScene *scene ){ void B3DImporter::ReadBB3D( aiScene *scene ){
_textures.clear(); _textures.clear();
_materials.size(); _materials.clear();
_vertices.clear(); _vertices.clear();
_meshes.clear(); _meshes.clear();

View File

@ -85,8 +85,7 @@ bool CompareBones(const aiMesh* orig, const aiMesh* inst)
aiBone* oha = inst->mBones[i]; aiBone* oha = inst->mBones[i];
if (aha->mNumWeights != oha->mNumWeights || if (aha->mNumWeights != oha->mNumWeights ||
aha->mOffsetMatrix != oha->mOffsetMatrix || aha->mOffsetMatrix != oha->mOffsetMatrix) {
aha->mNumWeights != oha->mNumWeights) {
return false; return false;
} }

View File

@ -464,7 +464,7 @@ std::string LWSImporter::FindLWOFile(const std::string& in)
std::string tmp; std::string tmp;
if (in.length() > 3 && in[1] == ':'&& in[2] != '\\' && in[2] != '/') if (in.length() > 3 && in[1] == ':'&& in[2] != '\\' && in[2] != '/')
{ {
tmp = in[0] + (":\\" + in.substr(2)); tmp = in[0] + (std::string(":\\") + in.substr(2));
} }
else tmp = in; else tmp = in;
@ -480,12 +480,12 @@ std::string LWSImporter::FindLWOFile(const std::string& in)
// <folder>\Scenes\<hh>\<*>.lws // <folder>\Scenes\<hh>\<*>.lws
// where <hh> is optional. // where <hh> is optional.
std::string test = ".." + (io->getOsSeparator() + tmp); std::string test = std::string("..") + (io->getOsSeparator() + tmp);
if (io->Exists(test)) { if (io->Exists(test)) {
return test; return test;
} }
test = ".." + (io->getOsSeparator() + test); test = std::string("..") + (io->getOsSeparator() + test);
if (io->Exists(test)) { if (io->Exists(test)) {
return test; return test;
} }

View File

@ -182,7 +182,7 @@ PLY::ESemantic PLY::Property::ParseSemantic(const char* pCur,const char** pCurOu
{ {
eOut = PLY::EST_Opacity; eOut = PLY::EST_Opacity;
} }
else if (TokenMatch(pCur,"specular_power",6)) else if (TokenMatch(pCur,"specular_power",14))
{ {
eOut = PLY::EST_PhongPower; eOut = PLY::EST_PhongPower;
} }

View File

@ -630,7 +630,7 @@ aiFace *Q3BSPFileImporter::getNextFace( aiMesh *pMesh, unsigned int &rFaceIdx )
bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel, bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel,
Q3BSP::Q3BSPZipArchive *pArchive, aiScene*, Q3BSP::Q3BSPZipArchive *pArchive, aiScene*,
aiMaterial *pMatHelper, int textureId ) { aiMaterial *pMatHelper, int textureId ) {
if ( NULL == pArchive || NULL == pArchive || NULL == pMatHelper ) { if ( NULL == pArchive || NULL == pMatHelper ) {
return false; return false;
} }