CheckClass: Applied patch 2220196

This commit is contained in:
Daniel Marjamäki 2008-11-06 00:00:38 +00:00
parent dfb7b4ed72
commit f8a60ae5c2
1 changed files with 23 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* /*
* c++check - c/c++ syntax checking * c++check - c/c++ syntax checking
* Copyright (C) 2007 Daniel Marjamäki * Copyright (C) 2007 Daniel Marjamäki
* *
@ -466,8 +466,10 @@ void CheckUnusedPrivateFunctions()
const char *pattern_function[] = {"","::",NULL}; const char *pattern_function[] = {"","::",NULL};
pattern_function[0] = classname; pattern_function[0] = classname;
bool HasFuncImpl = false; bool HasFuncImpl = false;
for (const TOKEN *ftok = findtoken(tokens, pattern_function); ftok; ftok = findtoken(ftok->next,pattern_function)) const TOKEN *ftok = tokens;
while (ftok)
{ {
ftok = findtoken(ftok,pattern_function);
int numpar = 0; int numpar = 0;
while (ftok && ftok->str[0]!=';' && ftok->str[0]!='{') while (ftok && ftok->str[0]!=';' && ftok->str[0]!='{')
{ {
@ -481,12 +483,8 @@ void CheckUnusedPrivateFunctions()
if (!ftok) if (!ftok)
break; break;
if (ftok->str[0] == ';') if (ftok->str[0] != ';' && numpar == 0)
continue; {
if (numpar != 0)
continue;
HasFuncImpl = true; HasFuncImpl = true;
indent_level = 0; indent_level = 0;
@ -506,6 +504,10 @@ void CheckUnusedPrivateFunctions()
} }
} }
if (ftok)
ftok = ftok->next;
}
while (HasFuncImpl && !FuncList.empty()) while (HasFuncImpl && !FuncList.empty())
{ {
bool fp = false; bool fp = false;