Skip to content

Commit b5f70c0

Browse files
committed
Scope: removed unnecessary Settings parameter from getVariableList() overload
1 parent 4ac1474 commit b5f70c0

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,23 +4819,23 @@ void Scope::getVariableList()
48194819
{
48204820
if (!bodyStartList.empty()) {
48214821
for (const Token *bs: bodyStartList)
4822-
getVariableList(symdb->mTokenizer.getSettings(), bs->next(), bs->link());
4822+
getVariableList(bs->next(), bs->link());
48234823
}
48244824

48254825
// global scope
48264826
else if (type == ScopeType::eGlobal)
4827-
getVariableList(symdb->mTokenizer.getSettings(), symdb->mTokenizer.tokens(), nullptr);
4827+
getVariableList(symdb->mTokenizer.tokens(), nullptr);
48284828

48294829
// forward declaration
48304830
else
48314831
return;
48324832
}
48334833

4834-
void Scope::getVariableList(const Settings& settings, const Token* start, const Token* end)
4834+
void Scope::getVariableList(const Token* start, const Token* end)
48354835
{
48364836
// Variable declared in condition: if (auto x = bar())
48374837
if (Token::Match(classDef, "if|while ( %type%") && Token::simpleMatch(classDef->next()->astOperand2(), "=")) {
4838-
checkVariable(classDef->tokAt(2), defaultAccess(), settings);
4838+
checkVariable(classDef->tokAt(2), defaultAccess(), symdb->mTokenizer.getSettings());
48394839
}
48404840

48414841
AccessControl varaccess = defaultAccess();
@@ -4932,7 +4932,7 @@ void Scope::getVariableList(const Settings& settings, const Token* start, const
49324932
if (tok->str() == ";")
49334933
continue;
49344934

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

49374937
if (!tok)
49384938
break;

lib/symboldatabase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ class CPPCHECKLIB Scope {
12091209
void findFunctionInBase(const std::string & name, nonneg int args, std::vector<const Function *> & matches) const;
12101210

12111211
/** @brief initialize varlist */
1212-
void getVariableList(const Settings& settings, const Token *start, const Token *end);
1212+
void getVariableList(const Token *start, const Token *end);
12131213
};
12141214

12151215
/** Value type */

0 commit comments

Comments
 (0)