Move declaration closer to where it is used

This commit is contained in:
Dmitry-Me 2014-09-11 11:26:35 +04:00
parent 865fc9aa67
commit e050fba414
1 changed files with 2 additions and 2 deletions

View File

@ -1013,9 +1013,8 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
// check all known fixed size arrays first by just looking them up
const SymbolDatabase* symbolDatabase = _tokenizer->getSymbolDatabase();
for (unsigned int i = 1; i <= _tokenizer->varIdCount(); i++) {
const Variable *var = symbolDatabase->getVariableFromVarId(i);
const Variable * const var = symbolDatabase->getVariableFromVarId(i);
if (var && var->isArray() && var->dimension(0) > 0) {
const ArrayInfo arrayInfo(var, _tokenizer, i);
const Token *tok = var->nameToken();
while (tok && tok->str() != ";") {
if (tok->str() == "{") {
@ -1030,6 +1029,7 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
break;
if (tok->str() == "{")
tok = tok->next();
const ArrayInfo arrayInfo(var, _tokenizer, i);
checkScope(tok, arrayInfo);
}
}