Fixed variable shadow warning
This commit is contained in:
parent
7bd732efe4
commit
81ff721113
|
@ -621,8 +621,8 @@ void CheckOther::checkRedundantAssignment()
|
||||||
|
|
||||||
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();
|
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();
|
||||||
|
|
||||||
for (std::list<Scope>::const_iterator i = symbolDatabase->scopeList.begin(); i != symbolDatabase->scopeList.end(); ++i) {
|
for (std::list<Scope>::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) {
|
||||||
if (!i->isExecutable())
|
if (!scope->isExecutable())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
///std::cout << std::endl << "scope: " << i->className << std::endl;
|
///std::cout << std::endl << "scope: " << i->className << std::endl;
|
||||||
|
@ -631,7 +631,7 @@ void CheckOther::checkRedundantAssignment()
|
||||||
std::map<unsigned int, const Token*> memAssignments;
|
std::map<unsigned int, const Token*> memAssignments;
|
||||||
const Token* writtenArgumentsEnd = 0;
|
const Token* writtenArgumentsEnd = 0;
|
||||||
|
|
||||||
for (const Token* tok = i->classStart->next(); tok != i->classEnd; tok = tok->next()) {
|
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (tok == writtenArgumentsEnd)
|
if (tok == writtenArgumentsEnd)
|
||||||
writtenArgumentsEnd = 0;
|
writtenArgumentsEnd = 0;
|
||||||
|
|
||||||
|
@ -657,7 +657,7 @@ void CheckOther::checkRedundantAssignment()
|
||||||
error = false;
|
error = false;
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
if (i->type == Scope::eSwitch && Token::findmatch(it->second, "default|case", tok))
|
if (scope->type == Scope::eSwitch && Token::findmatch(it->second, "default|case", tok))
|
||||||
redundantAssignmentInSwitchError(it->second, tok, tok->str());
|
redundantAssignmentInSwitchError(it->second, tok, tok->str());
|
||||||
else
|
else
|
||||||
redundantAssignmentError(it->second, tok, tok->str());
|
redundantAssignmentError(it->second, tok, tok->str());
|
||||||
|
@ -686,7 +686,7 @@ void CheckOther::checkRedundantAssignment()
|
||||||
if (it == memAssignments.end())
|
if (it == memAssignments.end())
|
||||||
memAssignments[param1->varId()] = tok;
|
memAssignments[param1->varId()] = tok;
|
||||||
else {
|
else {
|
||||||
if (i->type == Scope::eSwitch && Token::findmatch(it->second, "default|case", tok))
|
if (scope->type == Scope::eSwitch && Token::findmatch(it->second, "default|case", tok))
|
||||||
redundantCopyInSwitchError(it->second, tok, param1->str());
|
redundantCopyInSwitchError(it->second, tok, param1->str());
|
||||||
else
|
else
|
||||||
redundantCopyError(it->second, tok, param1->str());
|
redundantCopyError(it->second, tok, param1->str());
|
||||||
|
|
Loading…
Reference in New Issue