Skip to content

Commit 1812c8a

Browse files
committed
Scope: removed unnecessary Settings parameter from addVariable()
1 parent 35e40b4 commit 1812c8a

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
@@ -445,7 +445,7 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
445445
scope->definedTypesMap[new_type->name()] = new_type;
446446
}
447447

448-
scope->addVariable(varNameTok, tok, tok, access[scope], new_scope->definedType, scope, mTokenizer.getSettings());
448+
scope->addVariable(varNameTok, tok, tok, access[scope], new_scope->definedType, scope);
449449

450450
const Token *tok2 = tok->next();
451451

@@ -4785,12 +4785,12 @@ AccessControl Scope::defaultAccess() const
47854785
}
47864786

47874787
void Scope::addVariable(const Token *token_, const Token *start_, const Token *end_,
4788-
AccessControl access_, const Type *type_, const Scope *scope_, const Settings& settings)
4788+
AccessControl access_, const Type *type_, const Scope *scope_)
47894789
{
47904790
// keep possible size_t -> int truncation outside emplace_back() to have a single line
47914791
// C4267 VC++ warning instead of several dozens lines
47924792
const int varIndex = varlist.size();
4793-
varlist.emplace_back(token_, start_, end_, varIndex, access_, type_, scope_, settings);
4793+
varlist.emplace_back(token_, start_, end_, varIndex, access_, type_, scope_, scope_->symdb->mTokenizer.getSettings());
47944794
}
47954795

47964796
// Get variable list..
@@ -4952,7 +4952,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
49524952
const Token *typeend = Token::findsimplematch(typestart, "[")->previous();
49534953
for (tok = typeend->tokAt(2); Token::Match(tok, "%name%|,"); tok = tok->next()) {
49544954
if (tok->varId())
4955-
addVariable(tok, typestart, typeend, varaccess, nullptr, this, settings);
4955+
addVariable(tok, typestart, typeend, varaccess, nullptr, this);
49564956
}
49574957
return typeend->linkAt(1);
49584958
}
@@ -4989,7 +4989,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
49894989
if (Token::Match(typestart, "enum|struct"))
49904990
typestart = typestart->next();
49914991

4992-
addVariable(vartok, typestart, vartok->previous(), varaccess, vType, this, settings);
4992+
addVariable(vartok, typestart, vartok->previous(), varaccess, vType, this);
49934993
}
49944994

49954995
return tok;

lib/symboldatabase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ class CPPCHECKLIB Scope {
11491149

11501150
void addVariable(const Token *token_, const Token *start_,
11511151
const Token *end_, AccessControl access_, const Type *type_,
1152-
const Scope *scope_, const Settings& settings);
1152+
const Scope *scope_);
11531153

11541154
/** @brief initialize varlist */
11551155
void getVariableList(const Settings& settings);

0 commit comments

Comments
 (0)