Checker percentage calc was wrong, also cleanup
This commit is contained in:
@@ -137,12 +137,12 @@ def function_parm_wash_tokens(parm):
|
||||
if not tokens:
|
||||
return tokens
|
||||
|
||||
#if tokens[-1].kind == To
|
||||
# if tokens[-1].kind == To
|
||||
# remove trailing char
|
||||
if tokens[-1].kind == TokenKind.PUNCTUATION:
|
||||
if tokens[-1].spelling in (",", ")", ";"):
|
||||
tokens.pop()
|
||||
#else:
|
||||
# else:
|
||||
# print(tokens[-1].spelling)
|
||||
|
||||
t_new = []
|
||||
@@ -201,7 +201,7 @@ def function_get_arg_sizes(node):
|
||||
for i, node_child in enumerate(node_parms):
|
||||
|
||||
# print(node_child.kind, node_child.spelling)
|
||||
#print(node_child.type.kind, node_child.spelling)
|
||||
# print(node_child.type.kind, node_child.spelling)
|
||||
if node_child.type.kind == TypeKind.CONSTANTARRAY:
|
||||
pointee = node_child.type.get_pointee()
|
||||
size = parm_size(node_child)
|
||||
@@ -283,7 +283,7 @@ def file_check_arg_sizes(tu):
|
||||
if size_def == -1:
|
||||
continue
|
||||
|
||||
#print([c.kind for c in children])
|
||||
# print([c.kind for c in children])
|
||||
# print(" ".join([t.spelling for t in node_child.get_tokens()]))
|
||||
|
||||
if len(children) == 1:
|
||||
@@ -349,7 +349,7 @@ def recursive_arg_sizes(node, ):
|
||||
args_sizes = node
|
||||
else:
|
||||
args_sizes = function_get_arg_sizes(node)
|
||||
#if args_sizes:
|
||||
# if args_sizes:
|
||||
# print(node.spelling, args_sizes)
|
||||
_defs[node.spelling] = args_sizes
|
||||
# print("adding", node.spelling)
|
||||
|
@@ -70,7 +70,7 @@ def main():
|
||||
|
||||
def my_process(i, c, cmd):
|
||||
if not USE_QUIET:
|
||||
percent = 100.0 * (i / (len(check_commands) - 1))
|
||||
percent = 100.0 * (i / len(check_commands))
|
||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||
|
||||
sys.stdout.flush()
|
||||
|
@@ -61,7 +61,7 @@ def main():
|
||||
|
||||
def my_process(i, c, cmd):
|
||||
if not USE_QUIET:
|
||||
percent = 100.0 * (i / (len(check_commands) - 1))
|
||||
percent = 100.0 * (i / len(check_commands))
|
||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||
|
||||
sys.stdout.flush()
|
||||
|
@@ -59,7 +59,7 @@ def main():
|
||||
|
||||
def my_process(i, c, cmd):
|
||||
if not USE_QUIET:
|
||||
percent = 100.0 * (i / (len(check_commands) - 1))
|
||||
percent = 100.0 * (i / len(check_commands))
|
||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||
|
||||
sys.stdout.flush()
|
||||
|
@@ -89,7 +89,7 @@ def main():
|
||||
|
||||
def my_process(i, c, cmd):
|
||||
if not USE_QUIET:
|
||||
percent = 100.0 * (i / (len(check_commands) - 1))
|
||||
percent = 100.0 * (i / len(check_commands))
|
||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||
|
||||
sys.stdout.write("%s %s\n" % (percent_str, c))
|
||||
|
Reference in New Issue
Block a user