symbol database: get function argument count using argument list size rather than counting commas

This commit is contained in:
Robert Reif 2011-03-30 21:14:24 -04:00
parent b8cda19ca6
commit d17a204096
2 changed files with 4 additions and 19 deletions

View File

@ -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;

View File

@ -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);