Fixed some gcc and cppcheck messages

This commit is contained in:
PKEuS 2013-03-05 07:07:59 -08:00
parent ca96aaa53b
commit a94598e447
3 changed files with 10 additions and 10 deletions

View File

@ -58,7 +58,7 @@ void ThreadHandler::Check(const Settings &settings, bool recheck)
mResults.SetFiles(GetReCheckFiles());
}
if (mResults.GetFileCount() == 0 || mRunningThreadCount > 0 || settings._jobs <= 0) {
if (mResults.GetFileCount() == 0 || mRunningThreadCount > 0 || settings._jobs == 0) {
qDebug() << "Can't start checking if there's no files to check or if check is in progress.";
emit Done();
return;

View File

@ -1253,8 +1253,8 @@ void CheckClass::virtualDestructor()
// pointer variables of type 'Base *'
std::set<unsigned int> basepointer;
for (std::size_t i = 0; i < symbolDatabase->getVariableListSize(); i++) {
const Variable* var = symbolDatabase->getVariableFromVarId(i);
for (std::size_t k = 0; k < symbolDatabase->getVariableListSize(); k++) {
const Variable* var = symbolDatabase->getVariableFromVarId(k);
if (var && var->isPointer() && var->type() == derivedFrom)
basepointer.insert(var->varId());
}

View File

@ -1907,13 +1907,13 @@ bool Function::isImplicitlyVirtual(bool defaultVal) const
return false;
}
bool Function::isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const
bool Function::isImplicitlyVirtual_rec(const ::Type* baseType, bool& safe) const
{
// check each base class
for (unsigned int i = 0; i < type->derivedFrom.size(); ++i) {
for (unsigned int i = 0; i < baseType->derivedFrom.size(); ++i) {
// check if base class exists in database
if (type->derivedFrom[i].type && type->derivedFrom[i].type->classScope) {
const Scope *parent = type->derivedFrom[i].type->classScope;
if (baseType->derivedFrom[i].type && baseType->derivedFrom[i].type->classScope) {
const Scope *parent = baseType->derivedFrom[i].type->classScope;
std::list<Function>::const_iterator func;
@ -1936,14 +1936,14 @@ bool Function::isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const
}
// check for matching function parameters
if (returnMatch && argsMatch(type->classScope, func->argDef, argDef, "", 0)) {
if (returnMatch && argsMatch(baseType->classScope, func->argDef, argDef, "", 0)) {
return true;
}
}
}
if (!type->derivedFrom[i].type->derivedFrom.empty())
if (isImplicitlyVirtual_rec(type->derivedFrom[i].type, safe))
if (!baseType->derivedFrom[i].type->derivedFrom.empty())
if (isImplicitlyVirtual_rec(baseType->derivedFrom[i].type, safe))
return true;
} else {
// unable to find base class so assume it has no virtual function