From 1df0204bbed4f50a8dd8ae60e24cb38bee029690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 21 Jun 2015 09:54:07 +0200 Subject: [PATCH] addons: Use bool instead of string for cppcheckdata properties is... --- addons/cppcheckdata.py | 28 ++++++++++++++-------------- addons/threadsafety.py | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 6fc95d44b..9bf9e3dde 100644 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -162,13 +162,13 @@ class Variable: typeStartToken = None typeEndTokenId = None typeEndToken = None - isArgument = None - isArray = None - isClass = None - isLocal = None - isPointer = None - isReference = None - isStatic = None + isArgument = False + isArray = False + isClass = False + isLocal = False + isPointer = False + isReference = False + isStatic = False def __init__(self, element): self.Id = element.get('id') @@ -178,13 +178,13 @@ class Variable: self.typeStartToken = None self.typeEndTokenId = element.get('typeEndToken') self.typeEndToken = None - self.isArgument = element.get('isArgument') - self.isArray = element.get('isArray') - self.isClass = element.get('isClass') - self.isLocal = element.get('isLocal') - self.isPointer = element.get('isPointer') - self.isReference = element.get('isReference') - self.isStatic = element.get('isStatic') + self.isArgument = element.get('isArgument') == 'true' + self.isArray = element.get('isArray') == 'true' + self.isClass = element.get('isClass') == 'true' + self.isLocal = element.get('isLocal') == 'true' + self.isPointer = element.get('isPointer') == 'true' + self.isReference = element.get('isReference') == 'true' + self.isStatic = element.get('isStatic') == 'true' def setId(self, IdMap): self.nameToken = IdMap[self.nameTokenId] diff --git a/addons/threadsafety.py b/addons/threadsafety.py index e13649996..53df383e7 100644 --- a/addons/threadsafety.py +++ b/addons/threadsafety.py @@ -12,7 +12,7 @@ def reportError(token, severity, msg): def checkstatic(data): 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') for arg in sys.argv[1:]: