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

Method pointerArithBool

lib/checkbool.cpp:407–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406
407void CheckBoolImpl::pointerArithBool()
408{
409 logChecker("CheckBool::pointerArithBool");
410
411 const SymbolDatabase* symbolDatabase = mTokenizer->getSymbolDatabase();
412
413 for (const Scope &scope : symbolDatabase->scopeList) {
414 if (scope.type != ScopeType::eIf && !scope.isLoopScope())
415 continue;
416 const Token* tok = scope.classDef->next()->astOperand2();
417 if (scope.type == ScopeType::eFor) {
418 tok = Token::findsimplematch(scope.classDef->tokAt(2), ";");
419 if (tok)
420 tok = tok->astOperand2();
421 if (tok)
422 tok = tok->astOperand1();
423 } else if (scope.type == ScopeType::eDo)
424 tok = (scope.bodyEnd->tokAt(2)) ? scope.bodyEnd->tokAt(2)->astOperand2() : nullptr;
425
426 pointerArithBoolCond(tok);
427 }
428}
429
430void CheckBoolImpl::pointerArithBoolCond(const Token *tok)
431{

Callers 1

runChecksMethod · 0.80

Calls 5

findsimplematchFunction · 0.85
astOperand2Method · 0.80
nextMethod · 0.80
astOperand1Method · 0.80
tokAtMethod · 0.45

Tested by

no test coverage detected