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

Function isForLoopIncrement

lib/astutils.cpp:1509–1518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1507}
1508
1509static bool isForLoopIncrement(const Token* const tok)
1510{
1511 if (!tok)
1512 return false;
1513 const Token *const parent = tok->astParent();
1514 return Token::simpleMatch(parent, ";") && parent->astOperand2() == tok &&
1515 Token::simpleMatch(parent->astParent(), ";") &&
1516 Token::simpleMatch(parent->astParent()->astParent(), "(") &&
1517 parent->astParent()->astParent()->astOperand1()->str() == "for";
1518}
1519
1520bool isUsedAsBool(const Token* const tok, const Settings& settings)
1521{

Callers 1

isUsedAsBoolFunction · 0.85

Calls 5

astParentMethod · 0.80
astOperand2Method · 0.80
astOperand1Method · 0.80
simpleMatchFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected