Skip to content

Commit a94598e

Browse files
committed
Fixed some gcc and cppcheck messages
1 parent ca96aaa commit a94598e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

gui/threadhandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ThreadHandler::Check(const Settings &settings, bool recheck)
5858
mResults.SetFiles(GetReCheckFiles());
5959
}
6060

61-
if (mResults.GetFileCount() == 0 || mRunningThreadCount > 0 || settings._jobs <= 0) {
61+
if (mResults.GetFileCount() == 0 || mRunningThreadCount > 0 || settings._jobs == 0) {
6262
qDebug() << "Can't start checking if there's no files to check or if check is in progress.";
6363
emit Done();
6464
return;

lib/checkclass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,8 +1253,8 @@ void CheckClass::virtualDestructor()
12531253
// pointer variables of type 'Base *'
12541254
std::set<unsigned int> basepointer;
12551255

1256-
for (std::size_t i = 0; i < symbolDatabase->getVariableListSize(); i++) {
1257-
const Variable* var = symbolDatabase->getVariableFromVarId(i);
1256+
for (std::size_t k = 0; k < symbolDatabase->getVariableListSize(); k++) {
1257+
const Variable* var = symbolDatabase->getVariableFromVarId(k);
12581258
if (var && var->isPointer() && var->type() == derivedFrom)
12591259
basepointer.insert(var->varId());
12601260
}

lib/symboldatabase.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,13 +1907,13 @@ bool Function::isImplicitlyVirtual(bool defaultVal) const
19071907
return false;
19081908
}
19091909

1910-
bool Function::isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const
1910+
bool Function::isImplicitlyVirtual_rec(const ::Type* baseType, bool& safe) const
19111911
{
19121912
// check each base class
1913-
for (unsigned int i = 0; i < type->derivedFrom.size(); ++i) {
1913+
for (unsigned int i = 0; i < baseType->derivedFrom.size(); ++i) {
19141914
// check if base class exists in database
1915-
if (type->derivedFrom[i].type && type->derivedFrom[i].type->classScope) {
1916-
const Scope *parent = type->derivedFrom[i].type->classScope;
1915+
if (baseType->derivedFrom[i].type && baseType->derivedFrom[i].type->classScope) {
1916+
const Scope *parent = baseType->derivedFrom[i].type->classScope;
19171917

19181918
std::list<Function>::const_iterator func;
19191919

@@ -1936,14 +1936,14 @@ bool Function::isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const
19361936
}
19371937

19381938
// check for matching function parameters
1939-
if (returnMatch && argsMatch(type->classScope, func->argDef, argDef, "", 0)) {
1939+
if (returnMatch && argsMatch(baseType->classScope, func->argDef, argDef, "", 0)) {
19401940
return true;
19411941
}
19421942
}
19431943
}
19441944

1945-
if (!type->derivedFrom[i].type->derivedFrom.empty())
1946-
if (isImplicitlyVirtual_rec(type->derivedFrom[i].type, safe))
1945+
if (!baseType->derivedFrom[i].type->derivedFrom.empty())
1946+
if (isImplicitlyVirtual_rec(baseType->derivedFrom[i].type, safe))
19471947
return true;
19481948
} else {
19491949
// unable to find base class so assume it has no virtual function

0 commit comments

Comments
 (0)