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

Function getnumchildren

lib/checkcondition.cpp:270–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270static void getnumchildren(const Token *tok, std::list<MathLib::bigint> &numchildren)
271{
272 if (tok->astOperand1() && tok->astOperand1()->isNumber())
273 numchildren.push_back(MathLib::toBigNumber(tok->astOperand1()));
274 else if (tok->astOperand1() && tok->str() == tok->astOperand1()->str())
275 getnumchildren(tok->astOperand1(), numchildren);
276 if (tok->astOperand2() && tok->astOperand2()->isNumber())
277 numchildren.push_back(MathLib::toBigNumber(tok->astOperand2()));
278 else if (tok->astOperand2() && tok->str() == tok->astOperand2()->str())
279 getnumchildren(tok->astOperand2(), numchildren);
280}
281
282/* Return whether tok is in the body for a function returning a boolean. */
283static bool inBooleanFunction(const Token *tok)

Callers 1

comparisonMethod · 0.85

Calls 4

astOperand1Method · 0.80
astOperand2Method · 0.80
push_backMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected