Skip to content

Commit dd1bbe6

Browse files
committed
Scope: removed unnecessary Settings parameter from addVariable()
1 parent 694a030 commit dd1bbe6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
449449
scope->definedTypesMap[new_type->name()] = new_type;
450450
}
451451

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

454454
const Token *tok2 = tok->next();
455455

@@ -4806,12 +4806,12 @@ AccessControl Scope::defaultAccess() const
48064806
}
48074807

48084808
void Scope::addVariable(const Token *token_, const Token *start_, const Token *end_,
4809-
AccessControl access_, const Type *type_, const Scope *scope_, const Settings& settings)
4809+
AccessControl access_, const Type *type_, const Scope *scope_)
48104810
{
48114811
// keep possible size_t -> int truncation outside emplace_back() to have a single line
48124812
// C4267 VC++ warning instead of several dozens lines
48134813
const int varIndex = varlist.size();
4814-
varlist.emplace_back(token_, start_, end_, varIndex, access_, type_, scope_, settings);
4814+
varlist.emplace_back(token_, start_, end_, varIndex, access_, type_, scope_, scope_->symdb->mTokenizer.getSettings());
48154815
}
48164816

48174817
// Get variable list..
@@ -4973,7 +4973,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
49734973
const Token *typeend = Token::findsimplematch(typestart, "[")->previous();
49744974
for (tok = typeend->tokAt(2); Token::Match(tok, "%name%|,"); tok = tok->next()) {
49754975
if (tok->varId())
4976-
addVariable(tok, typestart, typeend, varaccess, nullptr, this, settings);
4976+
addVariable(tok, typestart, typeend, varaccess, nullptr, this);
49774977
}
49784978
return typeend->linkAt(1);
49794979
}
@@ -5011,7 +5011,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
50115011
if (Token::Match(typestart, "enum|struct"))
50125012
typestart = typestart->next();
50135013

5014-
addVariable(vartok, typestart, vartok->previous(), varaccess, vType, this, settings);
5014+
addVariable(vartok, typestart, vartok->previous(), varaccess, vType, this);
50155015

50165016
if (type == ScopeType::eFor && orig->strAt(-2) == "for") {
50175017
for (const Token* tok2 = tok; tok2 && !Token::Match(tok2, "[;:]"); tok2 = tok2->next()) {
@@ -5024,7 +5024,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con
50245024
symdb->debugMessage(tok2->next(), "varid0", "Scope::checkVariable found variable \'" + tok2->strAt(1) + "\' with varid 0.");
50255025
return tok;
50265026
}
5027-
addVariable(tok2->next(), typestart, vartok->previous(), varaccess, vType, this, settings);
5027+
addVariable(tok2->next(), typestart, vartok->previous(), varaccess, vType, this);
50285028
}
50295029
}
50305030
}

lib/symboldatabase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ class CPPCHECKLIB Scope {
11571157

11581158
void addVariable(const Token *token_, const Token *start_,
11591159
const Token *end_, AccessControl access_, const Type *type_,
1160-
const Scope *scope_, const Settings& settings);
1160+
const Scope *scope_);
11611161

11621162
/** @brief initialize varlist */
11631163
void getVariableList(const Settings& settings);

0 commit comments

Comments
 (0)