cppcheckdata.py: code cleanup
This commit is contained in:
parent
10f93e31ef
commit
f907bba4e5
|
@ -143,21 +143,11 @@ class ValueType:
|
||||||
def __init__(self, element):
|
def __init__(self, element):
|
||||||
self.type = element.get('valueType-type')
|
self.type = element.get('valueType-type')
|
||||||
self.sign = element.get('valueType-sign')
|
self.sign = element.get('valueType-sign')
|
||||||
bits = element.get('valueType-bits')
|
self.bits = int(element.get('valueType-bits', 0))
|
||||||
if bits:
|
|
||||||
self.bits = int(bits)
|
|
||||||
self.typeScopeId = element.get('valueType-typeScope')
|
self.typeScopeId = element.get('valueType-typeScope')
|
||||||
self.originalTypeName = element.get('valueType-originalTypeName')
|
self.originalTypeName = element.get('valueType-originalTypeName')
|
||||||
constness = element.get('valueType-constness')
|
self.constness = int(element.get('valueType-constness', 0))
|
||||||
if constness:
|
self.pointer = int(element.get('valueType-pointer', 0))
|
||||||
self.constness = int(constness)
|
|
||||||
else:
|
|
||||||
self.constness = 0
|
|
||||||
pointer = element.get('valueType-pointer')
|
|
||||||
if pointer:
|
|
||||||
self.pointer = int(pointer)
|
|
||||||
else:
|
|
||||||
self.pointer = 0
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
attrs = ["type", "sign", "bits", "typeScopeId", "originalTypeName",
|
attrs = ["type", "sign", "bits", "typeScopeId", "originalTypeName",
|
||||||
|
@ -620,11 +610,7 @@ class Variable:
|
||||||
self.isPointer = element.get('isPointer') == 'true'
|
self.isPointer = element.get('isPointer') == 'true'
|
||||||
self.isReference = element.get('isReference') == 'true'
|
self.isReference = element.get('isReference') == 'true'
|
||||||
self.isStatic = element.get('isStatic') == 'true'
|
self.isStatic = element.get('isStatic') == 'true'
|
||||||
constness = element.get('constness')
|
self.constness = int(element.get('constness',0))
|
||||||
if constness:
|
|
||||||
self.constness = int(constness)
|
|
||||||
else:
|
|
||||||
self.constness = 0
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId",
|
attrs = ["Id", "nameTokenId", "typeStartTokenId", "typeEndTokenId",
|
||||||
|
|
Loading…
Reference in New Issue