Symbol database: code cleanups

This commit is contained in:
Robert Reif 2010-11-10 16:52:52 +01:00 committed by Daniel Marjamäki
parent 2102b9598e
commit 4ddf6f3b44
2 changed files with 19 additions and 8 deletions

View File

@ -1408,14 +1408,7 @@ void CheckClass::privateFunctions()
std::list<const Token *> FuncList; std::list<const Token *> FuncList;
/** @todo embedded class have access to private functions */ /** @todo embedded class have access to private functions */
int nested = 0; if (!info->getNestedNonFunctions())
std::list<SpaceInfo *>::const_iterator ni;
for (ni = info->nestedList.begin(); ni != info->nestedList.end(); ++ni)
{
if ((*ni)->type != SpaceInfo::Function)
nested++;
}
if (!nested)
{ {
for (func = info->functionList.begin(); func != info->functionList.end(); ++func) for (func = info->functionList.begin(); func != info->functionList.end(); ++func)
{ {

View File

@ -312,6 +312,24 @@ private:
return 0; return 0;
} }
/**
* @brief get the number of nested spaces that are not functions
*
* This returns the number of user defined types (class, struct, union)
* that are defined in this user defined type or namespace.
*/
unsigned int getNestedNonFunctions() const
{
unsigned int nested = 0;
std::list<SpaceInfo *>::const_iterator ni;
for (ni = nestedList.begin(); ni != nestedList.end(); ++ni)
{
if ((*ni)->type != SpaceInfo::Function)
nested++;
}
return nested;
}
bool isBaseClassFunc(const Token *tok); bool isBaseClassFunc(const Token *tok);
}; };