fix some cppcheck detected issues

This commit is contained in:
DarthArgus
2015-07-28 14:52:33 -05:00
parent 0eeacb3709
commit 33139d7b5c
5 changed files with 29 additions and 26 deletions
@@ -323,26 +323,6 @@ void DataLint::report()
writeError(assetErrorFileAllWarning, *warningListIter, totalErrorCountAllWarning);
}
}
if (assetErrorFileAll) { fclose(assetErrorFileAll); }
if (assetErrorFileAllFatal) { fclose(assetErrorFileAllFatal); }
if (assetErrorFileAllWarning) { fclose(assetErrorFileAllWarning); }
if (assetErrorFileObjectTemplate) { fclose(assetErrorFileObjectTemplate); }
if (m_mode == M_client)
{
if (assetErrorFileAppearance) { fclose(assetErrorFileAppearance); }
if (assetErrorFileArrangementDescriptor) { fclose(assetErrorFileArrangementDescriptor); }
if (assetErrorFileLocalizedStringTable) { fclose(assetErrorFileLocalizedStringTable); }
if (assetErrorFilePortalProperty) { fclose(assetErrorFilePortalProperty); }
if (assetErrorFileShaderTemplate) { fclose(assetErrorFileShaderTemplate); }
if (assetErrorFileSkyBox) { fclose(assetErrorFileSkyBox); }
if (assetErrorFileSlotDescriptor) { fclose(assetErrorFileSlotDescriptor); }
if (assetErrorFileSoundTemplate) { fclose(assetErrorFileSoundTemplate); }
if (assetErrorFileTerrain) { fclose(assetErrorFileTerrain); }
if (assetErrorFileTexture) { fclose(assetErrorFileTexture); }
if (assetErrorFileTextureRenderer) { fclose(assetErrorFileTextureRenderer); }
}
}
// UnSupported Assets
@@ -411,6 +391,26 @@ void DataLint::report()
fclose(fp);
}
if (assetErrorFileAll) { fclose(assetErrorFileAll); }
if (assetErrorFileAllFatal) { fclose(assetErrorFileAllFatal); }
if (assetErrorFileAllWarning) { fclose(assetErrorFileAllWarning); }
if (assetErrorFileObjectTemplate) { fclose(assetErrorFileObjectTemplate); }
if (m_mode == M_client)
{
if (assetErrorFileAppearance) { fclose(assetErrorFileAppearance); }
if (assetErrorFileArrangementDescriptor) { fclose(assetErrorFileArrangementDescriptor); }
if (assetErrorFileLocalizedStringTable) { fclose(assetErrorFileLocalizedStringTable); }
if (assetErrorFilePortalProperty) { fclose(assetErrorFilePortalProperty); }
if (assetErrorFileShaderTemplate) { fclose(assetErrorFileShaderTemplate); }
if (assetErrorFileSkyBox) { fclose(assetErrorFileSkyBox); }
if (assetErrorFileSlotDescriptor) { fclose(assetErrorFileSlotDescriptor); }
if (assetErrorFileSoundTemplate) { fclose(assetErrorFileSoundTemplate); }
if (assetErrorFileTerrain) { fclose(assetErrorFileTerrain); }
if (assetErrorFileTexture) { fclose(assetErrorFileTexture); }
if (assetErrorFileTextureRenderer) { fclose(assetErrorFileTextureRenderer); }
}
}
}
@@ -215,14 +215,16 @@ VisibleExpandableEntry * VisibleExpandableEntry::findOrAddExpandableChild(char c
bool VisibleExpandableEntry::pruneInvisibleChildren()
{
for (Children::iterator i = m_children.begin(); i != m_children.end(); )
{
if ((*i)->m_visible == false)
{
delete *i;
m_children.erase(i);
i = m_children.erase(i);
}
else
{
++i;
}
}
bool const result = ms_destroyedSelected;
ms_destroyedSelected = false;
return result;
@@ -154,7 +154,7 @@ double evaluateQuarticDerivative ( double x, const double c[5] )
return ((4.0*x*c[4] + 3.0*c[3]) * x + 2.0*c[2]) * x + c[1];
}
double cleanQuarticRoot( double x, const double c[4] )
double cleanQuarticRoot( double x, const double c[5] )
{
double e;
@@ -96,7 +96,7 @@ addrList()
if (errno != EINVAL || lastReqSize != 0)
{
WARNING(true, ("Error getting interface list: %s", strerror(errno)));
delete buf;
delete[] buf;
return;
}
}
@@ -180,7 +180,8 @@ void TemplateDefinitionFile::writeTemplateId(File &fp) const
void TemplateDefinitionFile::writeClassHeaderBegin(File &fp) const
{
const char * name = getTemplateName().c_str();
const char * baseName = getBaseName().c_str();
const char * baseName = getBaseName();
baseName = baseName.c_str();
const char * baseNamePath = "";
if (baseName[0] == '\0' && m_templateLocation != LOC_NONE)
{