Commit 9a5fb2c3 authored by Paul's avatar Paul
Browse files

Format

parent f583f039
...@@ -37,6 +37,7 @@ def getVariableDecl(var): ...@@ -37,6 +37,7 @@ def getVariableDecl(var):
end = end.next end = end.next
return var.typeStartToken.forward(end) return var.typeStartToken.forward(end)
def isFunctionCall(token): def isFunctionCall(token):
if not token: if not token:
return False return False
...@@ -48,6 +49,7 @@ def isFunctionCall(token): ...@@ -48,6 +49,7 @@ def isFunctionCall(token):
return False return False
return True return True
# def isplit(source, sep=' '): # def isplit(source, sep=' '):
# sepsize = len(sep) # sepsize = len(sep)
# start = 0 # start = 0
...@@ -127,6 +129,7 @@ def isFunctionCall(token): ...@@ -127,6 +129,7 @@ def isFunctionCall(token):
# bindings['end'] = end # bindings['end'] = end
# return MatchResult(True, bindings=bindings) # return MatchResult(True, bindings=bindings)
@cppcheck.checker @cppcheck.checker
def AvoidBranchingStatementAsLastInLoop(cfg, data): def AvoidBranchingStatementAsLastInLoop(cfg, data):
for token in cfg.tokenlist: for token in cfg.tokenlist:
...@@ -439,7 +442,12 @@ def UseDeviceLaunch(cfg, data): ...@@ -439,7 +442,12 @@ def UseDeviceLaunch(cfg, data):
@cppcheck.checker @cppcheck.checker
def UseManagePointer(cfg, data): def UseManagePointer(cfg, data):
functions = {"fclose", "free", "hipFree", "hipHostFree", "hipFreeArray", "hipMemFree", "hipStreamDestroy", "hipEventDestroy", "hipArrayDestroy", "hipCtxDestroy", "hipDestroyTextureObject", "hipDestroySurfaceObject", "miirDestroyHandle"} functions = {
"fclose", "free", "hipFree", "hipHostFree", "hipFreeArray",
"hipMemFree", "hipStreamDestroy", "hipEventDestroy", "hipArrayDestroy",
"hipCtxDestroy", "hipDestroyTextureObject", "hipDestroySurfaceObject",
"miirDestroyHandle"
}
for token in cfg.tokenlist: for token in cfg.tokenlist:
if not isFunctionCall(token): if not isFunctionCall(token):
continue continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment