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

Format

parent f583f039
......@@ -37,6 +37,7 @@ def getVariableDecl(var):
end = end.next
return var.typeStartToken.forward(end)
def isFunctionCall(token):
if not token:
return False
......@@ -48,6 +49,7 @@ def isFunctionCall(token):
return False
return True
# def isplit(source, sep=' '):
# sepsize = len(sep)
# start = 0
......@@ -127,6 +129,7 @@ def isFunctionCall(token):
# bindings['end'] = end
# return MatchResult(True, bindings=bindings)
@cppcheck.checker
def AvoidBranchingStatementAsLastInLoop(cfg, data):
for token in cfg.tokenlist:
......@@ -439,7 +442,12 @@ def UseDeviceLaunch(cfg, data):
@cppcheck.checker
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:
if not isFunctionCall(token):
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