Revert "fix some things cppcheck found...some are TODO because i don't feel like investigating them"

This reverts commit 173575e835.
This commit is contained in:
DarthArgus
2015-03-26 00:00:15 -05:00
parent 38e4dfee11
commit db15932436
15 changed files with 18 additions and 68 deletions
@@ -217,8 +217,8 @@ 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);
delete *i;
}
else
++i;
@@ -278,9 +278,9 @@ void FileManifest::addNewManifestEntry(const char *fileName, int fileSize)
if (fileSize)
((insertReturn.first)->second)->size = fileSize;
// delete the new entry we created
delete entry;
}
delete entry;
#else
return;
#endif
@@ -299,7 +299,9 @@ void FileManifest::addStoredManifestEntry(const char *fileName, const char * sce
std::pair<ManifestMap::iterator, bool> insertReturn = s_manifest.insert(std::pair<const uint32, FileManifestEntry*>(crc, entry));
delete entry;
// if the insert failed, delete the entry we created
if (!insertReturn.second)
delete entry;
}
// -----------------------------------------------------------------------
@@ -1167,7 +1167,7 @@ bool TargaFormat::saveImage(const Image &image, const char *filename)
//---------------------------------------------------
f = fopen(filename, "wb");
if (f==NULL)
if (!f)
{
DEBUG_WARNING(true, ("Unable to open Targa destination file %s.\n", filename));
return false;
@@ -253,7 +253,7 @@ bool PaletteArgb::write(const char *pathName) const
// open file
FILE *const file = fopen(pathName, "wb");
if (file==NULL)
if (!file)
{
WARNING(true, ("failed to open file [%s] for writing.", pathName));
return false;
@@ -96,7 +96,7 @@ addrList()
if (errno != EINVAL || lastReqSize != 0)
{
WARNING(true, ("Error getting interface list: %s", strerror(errno)));
delete [] buf;
delete buf;
return;
}
}
@@ -185,6 +185,4 @@ int File::print(const char *format, ...)
va_start(argptr, format);
return vfprintf(m_fp, format, argptr);
va_end(argptr); //make cppcheck happy
} // File::print