From d17a204096ce7ebbdb3cce8619e3a1b87add0899 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Wed, 30 Mar 2011 21:14:24 -0400 Subject: [PATCH] symbol database: get function argument count using argument list size rather than counting commas --- lib/symboldatabase.cpp | 18 ------------------ lib/symboldatabase.h | 5 ++++- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 3e96306fb..bdeaf45b4 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1192,24 +1192,6 @@ void SymbolDatabase::debugMessage(const Token *tok, const std::string &msg) cons //--------------------------------------------------------------------------- -unsigned int Function::argCount() const -{ - unsigned int count = 0; - - if (argDef->link() != argDef->next()) - { - count++; - - for (const Token *tok = argDef->next(); tok && tok->next() && tok->next() != argDef->link(); tok = tok->next()) - { - if (tok->str() == ",") - count++; - } - } - - return count; -} - unsigned int Function::initializedArgCount() const { unsigned int count = 0; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index f3c70c5be..53a800563 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -337,7 +337,10 @@ public: { } - unsigned int argCount() const; + unsigned int argCount() const + { + return argumentList.size(); + } unsigned int initializedArgCount() const; void addArguments(const SymbolDatabase *symbolDatabase, const Scope *scope);