Skip to content

Commit 6c9d21c

Browse files
committed
Scope: removed unnecessary Settings parameter from getVariableList() overload
1 parent 4b1a7da commit 6c9d21c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/symboldatabase.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -4798,23 +4798,23 @@ void Scope::getVariableList()
47984798
{
47994799
if (!bodyStartList.empty()) {
48004800
for (const Token *bs: bodyStartList)
4801-
getVariableList(symdb->mTokenizer.getSettings(), bs->next(), bs->link());
4801+
getVariableList(bs->next(), bs->link());
48024802
}
48034803

48044804
// global scope
48054805
else if (type == Scope::eGlobal)
4806-
getVariableList(symdb->mTokenizer.getSettings(), symdb->mTokenizer.tokens(), nullptr);
4806+
getVariableList(symdb->mTokenizer.tokens(), nullptr);
48074807

48084808
// forward declaration
48094809
else
48104810
return;
48114811
}
48124812

4813-
void Scope::getVariableList(const Settings& settings, const Token* start, const Token* end)
4813+
void Scope::getVariableList(const Token* start, const Token* end)
48144814
{
48154815
// Variable declared in condition: if (auto x = bar())
48164816
if (Token::Match(classDef, "if|while ( %type%") && Token::simpleMatch(classDef->next()->astOperand2(), "=")) {
4817-
checkVariable(classDef->tokAt(2), defaultAccess(), settings);
4817+
checkVariable(classDef->tokAt(2), defaultAccess(), symdb->mTokenizer.getSettings());
48184818
}
48194819

48204820
AccessControl varaccess = defaultAccess();
@@ -4911,7 +4911,7 @@ void Scope::getVariableList(const Settings& settings, const Token* start, const
49114911
if (tok->str() == ";")
49124912
continue;
49134913

4914-
tok = checkVariable(tok, varaccess, settings);
4914+
tok = checkVariable(tok, varaccess, symdb->mTokenizer.getSettings());
49154915

49164916
if (!tok)
49174917
break;

lib/symboldatabase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ class CPPCHECKLIB Scope {
12011201
void findFunctionInBase(const std::string & name, nonneg int args, std::vector<const Function *> & matches) const;
12021202

12031203
/** @brief initialize varlist */
1204-
void getVariableList(const Settings& settings, const Token *start, const Token *end);
1204+
void getVariableList(const Token *start, const Token *end);
12051205
};
12061206

12071207
/** Value type */

0 commit comments

Comments
 (0)