fix some errors/warnings found by static code analyzer

pull/429/head
abma 2014-12-16 23:41:10 +01:00
parent 7694561121
commit b1221ade64
7 changed files with 10 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -464,7 +464,7 @@ std::string LWSImporter::FindLWOFile(const std::string& in)
std::string tmp;
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;
@ -480,12 +480,12 @@ std::string LWSImporter::FindLWOFile(const std::string& in)
// <folder>\Scenes\<hh>\<*>.lws
// where <hh> is optional.
std::string test = ".." + (io->getOsSeparator() + tmp);
std::string test = std::string("..") + (io->getOsSeparator() + tmp);
if (io->Exists(test)) {
return test;
}
test = ".." + (io->getOsSeparator() + test);
test = std::string("..") + (io->getOsSeparator() + test);
if (io->Exists(test)) {
return test;
}

View File

@ -182,7 +182,7 @@ PLY::ESemantic PLY::Property::ParseSemantic(const char* pCur,const char** pCurOu
{
eOut = PLY::EST_Opacity;
}
else if (TokenMatch(pCur,"specular_power",6))
else if (TokenMatch(pCur,"specular_power",14))
{
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,
Q3BSP::Q3BSPZipArchive *pArchive, aiScene*,
aiMaterial *pMatHelper, int textureId ) {
if ( NULL == pArchive || NULL == pArchive || NULL == pMatHelper ) {
if ( NULL == pArchive || NULL == pMatHelper ) {
return false;
}