MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / simplifyParenthesizedLibraryFunctions

Method simplifyParenthesizedLibraryFunctions

lib/tokenize.cpp:3819–3833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3817}
3818
3819void Tokenizer::simplifyParenthesizedLibraryFunctions()
3820{
3821 for (Token *tok = list.front(); tok; tok = tok->next()) {
3822 if (!Token::simpleMatch(tok, ") ("))
3823 continue;
3824 Token *rpar = tok, *lpar = tok->link();
3825 if (!lpar || (Token::Match(lpar->previous(), "%name%") && !Token::Match(lpar->previous(), "return|delete|throw")))
3826 continue;
3827 const Token *ftok = rpar->previous();
3828 if (mSettings.library.isNotLibraryFunction(ftok))
3829 continue;
3830 lpar->deleteThis();
3831 rpar->deleteThis();
3832 }
3833}
3834
3835void Tokenizer::simplifyArrayAccessSyntax()
3836{

Callers

nothing calls this directly

Calls 5

frontMethod · 0.80
nextMethod · 0.80
isNotLibraryFunctionMethod · 0.80
deleteThisMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected