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

Function addByOne

lib/checkstl.cpp:2761–2774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2759}
2760
2761static bool addByOne(const Token *tok, nonneg int varid)
2762{
2763 if (Token::Match(tok, "+= %any% ;") &&
2764 tok->tokAt(1)->hasKnownIntValue() &&
2765 tok->tokAt(1)->getValue(1)) {
2766 return true;
2767 }
2768 if (Token::Match(tok, "= %varid% + %any% ;", varid) &&
2769 tok->tokAt(3)->hasKnownIntValue() &&
2770 tok->tokAt(3)->getValue(1)) {
2771 return true;
2772 }
2773 return false;
2774}
2775
2776static bool accumulateBoolLiteral(const Token *tok, nonneg int varid)
2777{

Callers 1

useStlAlgorithmMethod · 0.85

Calls 3

hasKnownIntValueMethod · 0.45
tokAtMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected