Fixed variable shadow warning

This commit is contained in:
PKEuS 2012-09-02 17:00:16 +02:00
parent 7bd732efe4
commit 81ff721113
1 changed files with 5 additions and 5 deletions

View File

@ -621,8 +621,8 @@ void CheckOther::checkRedundantAssignment()
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();
for (std::list<Scope>::const_iterator i = symbolDatabase->scopeList.begin(); i != symbolDatabase->scopeList.end(); ++i) {
if (!i->isExecutable())
for (std::list<Scope>::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) {
if (!scope->isExecutable())
continue;
///std::cout << std::endl << "scope: " << i->className << std::endl;
@ -631,7 +631,7 @@ void CheckOther::checkRedundantAssignment()
std::map<unsigned int, const Token*> memAssignments;
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)
writtenArgumentsEnd = 0;
@ -657,7 +657,7 @@ void CheckOther::checkRedundantAssignment()
error = false;
}
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());
else
redundantAssignmentError(it->second, tok, tok->str());
@ -686,7 +686,7 @@ void CheckOther::checkRedundantAssignment()
if (it == memAssignments.end())
memAssignments[param1->varId()] = tok;
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());
else
redundantCopyError(it->second, tok, param1->str());