unused functions: fixed false positives
This commit is contained in:
parent
dddfc50dff
commit
c991aded12
|
@ -53,6 +53,9 @@ void CheckFunctionUsage::parseTokens(const Tokenizer &tokenizer)
|
||||||
if (tok->fileIndex() != 0)
|
if (tok->fileIndex() != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (tok->str().find(":") != std::string::npos)
|
||||||
|
continue;
|
||||||
|
|
||||||
const Token *funcname = 0;
|
const Token *funcname = 0;
|
||||||
|
|
||||||
if (Token::Match(tok, "%type% %var% ("))
|
if (Token::Match(tok, "%type% %var% ("))
|
||||||
|
@ -95,14 +98,14 @@ void CheckFunctionUsage::parseTokens(const Tokenizer &tokenizer)
|
||||||
{
|
{
|
||||||
const Token *funcname = 0;
|
const Token *funcname = 0;
|
||||||
|
|
||||||
if (Token::Match(tok, "[;{}.,()[=+-/&|!?:] %var% [(),;:}]") ||
|
if (Token::Match(tok->next(), "%var% ("))
|
||||||
Token::Match(tok, ":: %var% (") ||
|
{
|
||||||
Token::Match(tok, "|= %var% (") ||
|
if (tok->str() == "*" || (tok->isName() && !Token::Match(tok, "else|return")))
|
||||||
Token::Match(tok, "&= %var% (") ||
|
continue;
|
||||||
Token::Match(tok, "&& %var% (") ||
|
funcname = tok->next();
|
||||||
Token::Match(tok, "|| %var% (") ||
|
}
|
||||||
Token::Match(tok, "else %var% (") ||
|
|
||||||
Token::Match(tok, "return %var% ("))
|
if (Token::Match(tok, "[;{}.,()[=+-/&|!?:] %var% [(),;:}]"))
|
||||||
funcname = tok->next();
|
funcname = tok->next();
|
||||||
|
|
||||||
// funcname ( => Assert that the end paranthesis isn't followed by {
|
// funcname ( => Assert that the end paranthesis isn't followed by {
|
||||||
|
|
Loading…
Reference in New Issue