Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-14 16:01:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-14 16:01:12 +0400
commit456f3b318aa6ce4af2f12844bd89532eabea3374 (patch)
tree3664395269f9f9c6f223bb943d21888b0dc74bf0 /build_files/cmake/clang_array_check.py
parenteb66c453017521894d788d06ec2b966949549aa2 (diff)
code cleanup: minor changes, clang checker option for exact size matches and use vector functions.
Diffstat (limited to 'build_files/cmake/clang_array_check.py')
-rw-r--r--build_files/cmake/clang_array_check.py27
1 files changed, 19 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.