diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 16:01:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 16:01:12 +0400 |
commit | 456f3b318aa6ce4af2f12844bd89532eabea3374 (patch) | |
tree | 3664395269f9f9c6f223bb943d21888b0dc74bf0 /build_files/cmake | |
parent | eb66c453017521894d788d06ec2b966949549aa2 (diff) |
code cleanup: minor changes, clang checker option for exact size matches and use vector functions.
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/clang_array_check.py | 27 | ||||
-rw-r--r-- | build_files/cmake/cmake_static_check_clang_array.py | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/build_files/cmake/clang_array_check.py b/build_files/cmake/clang_array_check.py index fc85b5c454d..f29d3c75608 100644 --- a/build_files/cmake/clang_array_check.py +++ b/build_files/cmake/clang_array_check.py @@ -21,6 +21,7 @@ Invocation: # delay parsing functions until we need them USE_LAZY_INIT = True +USE_EXACT_COMPARE = False # ----------------------------------------------------------------------------- # predefined function/arg sizes, handy sometimes, but not complete... @@ -307,14 +308,24 @@ def file_check_arg_sizes(tu): # testing # size_def = 100 - if size < size_def and size != 1: - location = node.location - print("%s:%d:%d: argument %d is size %d, should be %d" % - (location.file, - location.line, - location.column, - i + 1, size, size_def - )) + if size != 1: + if USE_EXACT_COMPARE: + # is_err = (size != size_def) and (size != 4 and size_def != 3) + is_err = (size != size_def) + else: + is_err = (size < size_def) + + if is_err: + location = node.location + # if "math_color_inline.c" not in str(location.file): + if 1: + print("%s:%d:%d: argument %d is size %d, should be %d (from %s)" % + (location.file, + location.line, + location.column, + i + 1, size, size_def, + args[0] # always the same but useful when running threaded + )) # we dont really care what we are looking at, just scan entire file for # function calls. diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py index 22b5d07c40c..17298599bdd 100644 --- a/build_files/cmake/cmake_static_check_clang_array.py +++ b/build_files/cmake/cmake_static_check_clang_array.py @@ -49,6 +49,10 @@ def main(): check_commands = [] for c, inc_dirs, defs in source_info: + + #~if "source/blender" not in c: + #~ continue + cmd = ([CHECKER_BIN] + CHECKER_ARGS + [c] + |