- code cleanup based on verbose output from the latest git version of cppcheck

This commit is contained in:
Mark Vejvoda
2012-10-06 07:27:32 +00:00
parent 5e42c6dc03
commit 2f1ddf7776
6 changed files with 14 additions and 15 deletions

View File

@@ -328,7 +328,7 @@ GLint toCompressionFormatGl(GLint format) {
}
static std::vector<int> supportedCompressionFormats = getSupportCompressedTextureFormats();
if(supportedCompressionFormats.size() <= 0) {
if(supportedCompressionFormats.empty() == true) {
return format;
}

View File

@@ -884,7 +884,7 @@ void clearFolderTreeContentsCheckSum(const string &path, const string filterFile
}
string crcCacheFile = getFormattedCRCCacheFileName(cacheKeys);
if(fileExists(crcCacheFile) == true) {
bool result = removeFile(crcCacheFile.c_str());
bool result = removeFile(crcCacheFile);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileitem [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,crcCacheFile.c_str(),result);
}
}
@@ -1058,7 +1058,7 @@ void clearFolderTreeContentsCheckSumList(vector<string> paths, string pathSearch
}
string crcCacheFile = getFormattedCRCCacheFileName(cacheKeys);
if(fileExists(crcCacheFile) == true) {
bool result = removeFile(crcCacheFile.c_str());
bool result = removeFile(crcCacheFile);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileitem [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,crcCacheFile.c_str(),result);
}
}
@@ -1231,7 +1231,7 @@ void clearFolderTreeContentsCheckSumList(const string &path, const string filter
}
string crcCacheFile = getFormattedCRCCacheFileName(cacheKeys);
if(fileExists(crcCacheFile) == true) {
bool result = removeFile(crcCacheFile.c_str());
bool result = removeFile(crcCacheFile);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileitem [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,crcCacheFile.c_str(),result);
}
}

View File

@@ -253,8 +253,7 @@ void FileCRCPreCacheThread::execute() {
if(results.empty() == true) {
for(unsigned int factionIdx = 0; factionIdx < results.size(); ++factionIdx) {
string factionName = results[factionIdx];
int32 factionCRC = 0;
factionCRC = getFolderTreeContentsCheckSumRecursively(techDataPaths, "/" + techName + "/factions/" + factionName + "/*", ".xml", NULL, true);
int32 factionCRC = getFolderTreeContentsCheckSumRecursively(techDataPaths, "/" + techName + "/factions/" + factionName + "/*", ".xml", NULL, true);
}
}

View File

@@ -51,7 +51,7 @@ P5 = 4.1381369442e-08f; /* 0x3331bb4c */
#endif
{
float y,hi,lo,c,t;
int32_t k,xsb;
int32_t k=0,xsb;
u_int32_t hx;
GET_FLOAT_WORD(hx,x);

View File

@@ -289,9 +289,9 @@ static Simple pS2[5] = {
#endif
{
#ifdef __STDC__
const Simple *p,*q;
const Simple *p=0,*q=0;
#else
Simple *p,*q;
Simple *p=0,*q=0;
#endif
Simple z,r,s;
int32_t ix;
@@ -425,9 +425,9 @@ static Simple qS2[6] = {
#endif
{
#ifdef __STDC__
const Simple *p,*q;
const Simple *p=0,*q=0;
#else
Simple *p,*q;
Simple *p=0,*q=0;
#endif
Simple s,r,z;
int32_t ix;

View File

@@ -288,9 +288,9 @@ static Simple ps2[5] = {
#endif
{
#ifdef __STDC__
const Simple *p,*q;
const Simple *p=0,*q=0;
#else
Simple *p,*q;
Simple *p=0,*q=0;
#endif
Simple z,r,s;
int32_t ix;
@@ -425,9 +425,9 @@ static Simple qs2[6] = {
#endif
{
#ifdef __STDC__
const Simple *p,*q;
const Simple *p=0,*q=0;
#else
Simple *p,*q;
Simple *p=0,*q=0;
#endif
Simple s,r,z;
int32_t ix;