Addons scripts: Remove redundant code/characters, fix indentation. (#1926)

This commit is contained in:
Sebastian 2019-06-27 06:59:47 +02:00 committed by GitHub
parent fef7bc584d
commit 2c71b47d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -201,7 +201,7 @@ def isFunctionCall(expr):
def hasExternalLinkage(var):
return var.isGlobal and not var.isStatic
return var.isGlobal and not var.isStatic
def countSideEffects(expr):
@ -1719,12 +1719,12 @@ class MisraChecker:
while exp[pos1] == ' ':
pos1 -= 1
if exp[pos1] != '(' and exp[pos1] != '[':
self.reportError(directive, 20, 7);
self.reportError(directive, 20, 7)
break
while exp[pos2] == ' ':
pos2 += 1
if exp[pos2] != ')' and exp[pos2] != ']':
self.reportError(directive, 20, 7);
self.reportError(directive, 20, 7)
break
@ -1732,7 +1732,7 @@ class MisraChecker:
for directive in data.directives:
d = Define(directive)
if d.expansionList.find('#') >= 0:
self.reportError(directive, 20, 10);
self.reportError(directive, 20, 10)
def misra_20_13(self, data):
dir_pattern = re.compile(r'#[ ]*([^ (<]*)')

View File

@ -43,7 +43,7 @@ TEST_SOURCE_FILES = ['./addons/test/misra-test.c']
def setup_module(module):
for f in TEST_SOURCE_FILES:
p = subprocess.Popen(["./cppcheck", "--dump", "--quiet", f])
p.communicate()[0]
p.communicate()
if p.returncode != 0:
raise OSError("cppcheck returns error code: %d" % p.returncode)
subprocess.Popen(["sync"])