CheckHeaders: Checking if included headers are needed
This commit is contained in:
parent
9af3e36c4d
commit
b0d9994210
|
@ -90,14 +90,21 @@ void WarningIncludeHeader()
|
|||
indentlevel++;
|
||||
|
||||
else if (tok1->str[0] == '}')
|
||||
indentlevel--;
|
||||
|
||||
{
|
||||
if (indentlevel > 0)
|
||||
indentlevel--;
|
||||
}
|
||||
|
||||
if (indentlevel != 0)
|
||||
continue;
|
||||
|
||||
// namespace..
|
||||
if (match(tok1,"namespace var {"))
|
||||
tok1 = gettok(tok1,2);
|
||||
|
||||
// Class or namespace declaration..
|
||||
// --------------------------------------
|
||||
if (match(tok1,"class var {") || match(tok1,"class var :") || match(tok1,"namespace var {"))
|
||||
else if (match(tok1,"class var {") || match(tok1,"class var :"))
|
||||
classlist.push_back(getstr(tok1, 1));
|
||||
|
||||
// Variable declaration..
|
||||
|
@ -126,8 +133,8 @@ void WarningIncludeHeader()
|
|||
tok1 = tok1->next;
|
||||
}
|
||||
}
|
||||
|
||||
// function..
|
||||
|
||||
// function..
|
||||
// --------------------------------------
|
||||
else if (match(tok1,"type var ("))
|
||||
namelist.push_back(getstr(tok1, 1));
|
||||
|
@ -199,7 +206,21 @@ void WarningIncludeHeader()
|
|||
}
|
||||
|
||||
if ( ! NeedDeclaration )
|
||||
NeedDeclaration = (std::find(classlist.begin(),classlist.end(),tok1->str ) != classlist.end());
|
||||
{
|
||||
if (std::find(classlist.begin(),classlist.end(),tok1->str ) != classlist.end())
|
||||
{
|
||||
if ( strcmp(getstr(tok1, 1), "*") == 0 )
|
||||
{
|
||||
NeedDeclaration = true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Needed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue