From 6750c7b492bdfb2650e78e94019fc9bb63c22cce Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Fri, 22 Apr 2011 21:41:55 -0400 Subject: [PATCH] don't debug warn about class function definitions without body having missing varid on function parameters --- lib/symboldatabase.cpp | 7 ++++--- lib/symboldatabase.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index cb6cb6435..3d6972aa5 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -650,7 +650,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti for (func = scope->functionList.begin(); func != scope->functionList.end(); ++func) { // add arguments - func->addArguments(this, scope); + func->addArguments(this, &*func, scope); } } @@ -1234,7 +1234,7 @@ unsigned int Function::initializedArgCount() const return count; } -void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *scope) +void Function::addArguments(const SymbolDatabase *symbolDatabase, const Function *func, const Scope *scope) { // check for non-empty argument list "( ... )" if (arg->link() != arg->next() && !Token::simpleMatch(arg, "( void )")) @@ -1279,7 +1279,8 @@ void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *s nameTok = tok->previous(); endTok = nameTok->previous(); - symbolDatabase->debugMessage(nameTok, "Function::addArguments found argument \'" + nameTok->str() + "\' with varid 0."); + if (func->hasBody) + symbolDatabase->debugMessage(nameTok, "Function::addArguments found argument \'" + nameTok->str() + "\' with varid 0."); } else endTok = startTok; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 63717a5f2..ef4cc19ae 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -353,7 +353,7 @@ public: return argumentList.size(); } unsigned int initializedArgCount() const; - void addArguments(const SymbolDatabase *symbolDatabase, const Scope *scope); + void addArguments(const SymbolDatabase *symbolDatabase, const Function *func, const Scope *scope); const Token *tokenDef; // function name token in class definition const Token *argDef; // function argument start '(' in class definition