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

Method getKnownIntValue

addons/cppcheckdata.py:490–500  ·  view source on GitHub ↗

If token has a known int value then return that. Otherwise returns None

(self)

Source from the content-addressed store, hash-verified

488 return None
489
490 def getKnownIntValue(self):
491 """
492 If token has a known int value then return that.
493 Otherwise returns None
494 """
495 if not self.values:
496 return None
497 for value in self.values:
498 if value.valueKind == 'known':
499 return value.intvalue
500 return None
501
502 def isUnaryOp(self, op):
503 return self.astOperand1 and (self.astOperand2 is None) and self.str == op

Callers 15

parseFunctionCallMethod · 0.80
checkBufferSizeFunction · 0.80
checkLongCastMethod · 0.80
checkReallocUsageMethod · 0.80
setTokenValueFunction · 0.80
getEnumTypeFunction · 0.80
isNonZeroFunction · 0.80
valueFlowRightShiftFunction · 0.80

Calls

no outgoing calls

Tested by 2

valueFlow1Method · 0.64
valueFlow2Method · 0.64