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

Method isCast

lib/tokenize.cpp:993–999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991
992 private:
993 static bool isCast(const Token* tok) {
994 if (Token::Match(tok, "( %name% ) (|%name%|%num%"))
995 return !tok->tokAt(3)->isKeyword();
996 if (Token::Match(tok, "< %name% > (") && tok->previous() && endsWith(tok->strAt(-1), "_cast", 5))
997 return true;
998 return false;
999 }
1000
1001 static Token* insertTokens(Token* to, std::pair<Token*,Token*> range) {
1002 for (const Token* from = range.first; from != range.second; from = from->next()) {

Callers 15

checkRecursiveMethod · 0.80
bufferOverflowMethod · 0.80
objectIndexMethod · 0.80
ArgumentInfoMethod · 0.80
getReallocationTypeMethod · 0.80
checkReallocUsageMethod · 0.80
isMallocMethod · 0.80
compilePrecedence3Function · 0.80
validateAstMethod · 0.80
setTokenValueFunction · 0.80

Calls 3

endsWithFunction · 0.70
isKeywordMethod · 0.45
tokAtMethod · 0.45

Tested by 4

cppcastMethod · 0.64
ccastMethod · 0.64