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

Function getPointerDepth

lib/checkautovariables.cpp:476–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476static int getPointerDepth(const Token *tok)
477{
478 if (!tok)
479 return 0;
480 if (tok->valueType())
481 return tok->valueType()->pointer;
482 int n = 0;
483 std::pair<const Token*, const Token*> decl = Token::typeDecl(tok);
484 for (const Token* tok2 = decl.first; tok2 != decl.second; tok2 = tok2->next())
485 if (Token::simpleMatch(tok2, "*"))
486 n++;
487 return n;
488}
489
490static bool isDeadTemporary(const Token* tok, const Token* expr, const Library& library)
491{

Callers 1

checkVarLifetimeScopeMethod · 0.85

Calls 2

nextMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected