Addons: Reuse cppcheckdata.simpleMatch

This commit is contained in:
Daniel Marjamäki 2020-11-11 14:24:55 +01:00
parent c95b0d2a51
commit 7e8839a991
3 changed files with 4 additions and 15 deletions

View File

@ -25,11 +25,8 @@ def reportError(token, severity, msg, id):
cppcheckdata.reportError(token, severity, msg, 'cert', id) cppcheckdata.reportError(token, severity, msg, 'cert', id)
def simpleMatch(token, pattern): def simpleMatch(token, pattern):
for p in pattern.split(' '): return cppcheckdata.simpleMatch(token, pattern)
if not token or token.str != p:
return False
token = token.next
return True
def isUnpackedStruct(token): def isUnpackedStruct(token):
if token.valueType is None: if token.valueType is None:

View File

@ -24,11 +24,7 @@ def reportError(token, severity, msg, id):
cppcheckdata.reportError(token, severity, msg, 'misc', id) cppcheckdata.reportError(token, severity, msg, 'misc', id)
def simpleMatch(token, pattern): def simpleMatch(token, pattern):
for p in pattern.split(' '): return cppcheckdata.simpleMatch(token, pattern)
if not token or token.str != p:
return False
token = token.next
return True
# Get function arguments # Get function arguments
def getArgumentsRecursive(tok, arguments): def getArgumentsRecursive(tok, arguments):

View File

@ -59,11 +59,7 @@ def isUnsignedType(ty):
def simpleMatch(token, pattern): def simpleMatch(token, pattern):
for p in pattern.split(' '): return cppcheckdata.simpleMatch(token, pattern)
if not token or token.str != p:
return False
token = token.next
return True
def rawlink(rawtoken): def rawlink(rawtoken):