addons: Use bool instead of string for cppcheckdata properties is...
This commit is contained in:
parent
d0e6b77fd1
commit
1df0204bbe
|
@ -162,13 +162,13 @@ class Variable:
|
||||||
typeStartToken = None
|
typeStartToken = None
|
||||||
typeEndTokenId = None
|
typeEndTokenId = None
|
||||||
typeEndToken = None
|
typeEndToken = None
|
||||||
isArgument = None
|
isArgument = False
|
||||||
isArray = None
|
isArray = False
|
||||||
isClass = None
|
isClass = False
|
||||||
isLocal = None
|
isLocal = False
|
||||||
isPointer = None
|
isPointer = False
|
||||||
isReference = None
|
isReference = False
|
||||||
isStatic = None
|
isStatic = False
|
||||||
|
|
||||||
def __init__(self, element):
|
def __init__(self, element):
|
||||||
self.Id = element.get('id')
|
self.Id = element.get('id')
|
||||||
|
@ -178,13 +178,13 @@ class Variable:
|
||||||
self.typeStartToken = None
|
self.typeStartToken = None
|
||||||
self.typeEndTokenId = element.get('typeEndToken')
|
self.typeEndTokenId = element.get('typeEndToken')
|
||||||
self.typeEndToken = None
|
self.typeEndToken = None
|
||||||
self.isArgument = element.get('isArgument')
|
self.isArgument = element.get('isArgument') == 'true'
|
||||||
self.isArray = element.get('isArray')
|
self.isArray = element.get('isArray') == 'true'
|
||||||
self.isClass = element.get('isClass')
|
self.isClass = element.get('isClass') == 'true'
|
||||||
self.isLocal = element.get('isLocal')
|
self.isLocal = element.get('isLocal') == 'true'
|
||||||
self.isPointer = element.get('isPointer')
|
self.isPointer = element.get('isPointer') == 'true'
|
||||||
self.isReference = element.get('isReference')
|
self.isReference = element.get('isReference') == 'true'
|
||||||
self.isStatic = element.get('isStatic')
|
self.isStatic = element.get('isStatic') == 'true'
|
||||||
|
|
||||||
def setId(self, IdMap):
|
def setId(self, IdMap):
|
||||||
self.nameToken = IdMap[self.nameTokenId]
|
self.nameToken = IdMap[self.nameTokenId]
|
||||||
|
|
|
@ -12,7 +12,7 @@ def reportError(token, severity, msg):
|
||||||
|
|
||||||
def checkstatic(data):
|
def checkstatic(data):
|
||||||
for var in data.variables:
|
for var in data.variables:
|
||||||
if var.isStatic=='true' and var.isLocal=='true' and var.isClass=='true':
|
if var.isStatic==True and var.isLocal==True and var.isClass==True:
|
||||||
reportError(var.typeStartToken, 'warning', 'Local static object')
|
reportError(var.typeStartToken, 'warning', 'Local static object')
|
||||||
|
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
|
|
Loading…
Reference in New Issue