diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index a34b4fa04..fc25e6de6 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -57,7 +57,6 @@ static const struct CWE CWE825(825U); void CheckUninitVar::check() { const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); - std::list::const_iterator scope; std::set arrayTypeDefs; for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { @@ -66,7 +65,7 @@ void CheckUninitVar::check() } // check every executable scope - for (scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { + for (std::list::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { if (scope->isExecutable()) { checkScope(&*scope, arrayTypeDefs); } @@ -1226,10 +1225,9 @@ void CheckUninitVar::uninitStructMemberError(const Token *tok, const std::string void CheckUninitVar::valueFlowUninit() { const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); - std::list::const_iterator scope; // check every executable scope - for (scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { + for (std::list::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { if (!scope->isExecutable()) continue; for (const Token* tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) { @@ -1252,10 +1250,9 @@ void CheckUninitVar::valueFlowUninit() void CheckUninitVar::deadPointer() { const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); - std::list::const_iterator scope; // check every executable scope - for (scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { + for (std::list::const_iterator scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) { if (!scope->isExecutable()) continue; // Dead pointers..