threadsafety.py: reformat output
This commit is contained in:
parent
256adfbcb5
commit
2ca46ceae9
|
@ -8,15 +8,15 @@ import cppcheckdata
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def reportError(token, severity, msg):
|
def reportError(token, severity, msg, id):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
'[' + token.file + ':' + str(token.linenr) + '] (' + severity + ') threadsafety.py: ' + msg + '\n')
|
'[' + token.file + ':' + str(token.linenr) + '] (' + severity + '): ' + msg + ' [' + id + ']\n')
|
||||||
|
|
||||||
|
|
||||||
def checkstatic(data):
|
def checkstatic(data):
|
||||||
for var in data.variables:
|
for var in data.variables:
|
||||||
if var.isStatic and var.isLocal and var.isClass:
|
if var.isStatic and var.isLocal and var.isClass:
|
||||||
reportError(var.typeStartToken, 'warning', ('Local static object: ' + var.nameToken.str))
|
reportError(var.typeStartToken, 'warning', ('Local static object: ' + var.nameToken.str), 'threadsafety')
|
||||||
|
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
print('Checking ' + arg + '...')
|
print('Checking ' + arg + '...')
|
||||||
|
|
Loading…
Reference in New Issue