[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40265] branches/soc-2011-tomato: Merging r40242 through r40264 from trunk into soc-2011-tomato

Sergey Sharybin g.ulairi at gmail.com
Fri Sep 16 16:45:32 CEST 2011


Revision: 40265
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40265
Author:   nazgul
Date:     2011-09-16 14:45:32 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
Merging r40242 through r40264 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40242
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40264

Modified Paths:
--------------
    branches/soc-2011-tomato/GNUmakefile
    branches/soc-2011-tomato/doc/python_api/sphinx_doc_gen.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/action.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/anim.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/collision.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/node.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/unit.c
    branches/soc-2011-tomato/source/blender/blenlib/intern/string_utf8.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/editors/animation/anim_filter.c
    branches/soc-2011-tomato/source/blender/editors/animation/keyframes_edit.c
    branches/soc-2011-tomato/source/blender/editors/curve/curve_ops.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface_regions.c
    branches/soc-2011-tomato/source/blender/editors/object/object_modifier.c
    branches/soc-2011-tomato/source/blender/editors/object/object_navmesh.cpp
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2011-tomato/source/blender/editors/sound/sound_intern.h
    branches/soc-2011-tomato/source/blender/editors/sound/sound_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_file/file_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_tools.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_tree.c
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_view.c
    branches/soc-2011-tomato/source/blender/gpu/intern/gpu_buffers.c
    branches/soc-2011-tomato/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/filter.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/indexer.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/iris.c
    branches/soc-2011-tomato/source/blender/imbuf/intern/jp2.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_action_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_texture_api.c
    branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_weightvg_util.c
    branches/soc-2011-tomato/source/blender/nodes/composite/node_composite_tree.c
    branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
    branches/soc-2011-tomato/source/blender/python/intern/bpy_app_handlers.c
    branches/soc-2011-tomato/source/blender/python/intern/gpu.c
    branches/soc-2011-tomato/source/blender/render/intern/raytrace/rayobject_octree.cpp
    branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c
    branches/soc-2011-tomato/source/blender/render/intern/source/envmap.c
    branches/soc-2011-tomato/source/blender/render/intern/source/pipeline.c
    branches/soc-2011-tomato/source/blender/render/intern/source/rendercore.c
    branches/soc-2011-tomato/source/blender/render/intern/source/shadeinput.c
    branches/soc-2011-tomato/source/blender/render/intern/source/zbuf.c
    branches/soc-2011-tomato/source/gameengine/Converter/BL_ArmatureObject.cpp

Added Paths:
-----------
    branches/soc-2011-tomato/build_files/cmake/cmake_static_check_cppcheck.py
    branches/soc-2011-tomato/build_files/cmake/cmake_static_check_sparse.py
    branches/soc-2011-tomato/build_files/cmake/cmake_static_check_splint.py
    branches/soc-2011-tomato/build_files/cmake/project_source_info.py

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-40241
   + /branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-40264

Modified: branches/soc-2011-tomato/GNUmakefile
===================================================================
--- branches/soc-2011-tomato/GNUmakefile	2011-09-16 14:28:23 UTC (rev 40264)
+++ branches/soc-2011-tomato/GNUmakefile	2011-09-16 14:45:32 UTC (rev 40265)
@@ -126,6 +126,11 @@
 	@echo "  * test_pep8       - checks all python script are pep8 which are tagged to use the stricter formatting"
 	@echo "  * test_deprecated - checks for deprecation tags in our code which may need to be removed"
 	@echo ""
+	@echo "Static Source Code Checking (not assosiated with building blender)"
+	@echo "  * check_cppcheck  - run blender source through cppcheck (C & C++)"
+	@echo "  * check_splint    - run blenders source through splint (C only)"
+	@echo "  * check_sparse    - run blenders source through sparse (C only)"
+	@echo ""
 
 # -----------------------------------------------------------------------------
 # Packages
@@ -176,6 +181,20 @@
 	cmake -G"Eclipse CDT4 - Unix Makefiles" -H$(BLENDER_DIR) -B$(BUILD_DIR)
 
 
+# -----------------------------------------------------------------------------
+# Static Checking
+#
+
+check_cppcheck:
+	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
+
+check_splint:
+	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
+
+check_sparse:
+	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
+
+
 clean:
 	$(MAKE) -C $(BUILD_DIR) clean
 

Copied: branches/soc-2011-tomato/build_files/cmake/cmake_static_check_cppcheck.py (from rev 40264, trunk/blender/build_files/cmake/cmake_static_check_cppcheck.py)
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/cmake_static_check_cppcheck.py	                        (rev 0)
+++ branches/soc-2011-tomato/build_files/cmake/cmake_static_check_cppcheck.py	2011-09-16 14:45:32 UTC (rev 40265)
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+
+# $Id:
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+import project_source_info
+import subprocess
+import sys
+import os
+
+CHECKER_IGNORE_PREFIX = [
+    "extern",
+    "intern/moto",
+    ]
+
+CHECKER_BIN = "cppcheck"
+
+CHECKER_ARGS = [
+    # not sure why this is needed, but it is.
+    "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern/glew/include"),
+
+    #  "--check-config", # when includes are missing
+    #  "--enable=all",  # if you want sixty hundred pedantic suggestions
+    ]
+
+def main():
+    source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
+
+    check_commands = []
+    for c, inc_dirs, defs in source_info:
+        cmd = ([CHECKER_BIN] +
+                CHECKER_ARGS +
+               [c] +
+               [("-I%s" % i) for i in inc_dirs] +
+               [("-D%s" % d) for d in defs]
+              )
+
+        check_commands.append((c, cmd))
+
+    for i, (c, cmd) in enumerate(check_commands):
+        percent = 100.0 * (i / (len(check_commands)-1))
+        percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
+        
+        # if percent < 27.9:
+        #    continue
+        
+        # let cppcheck finish the line off...
+        sys.stdout.write("%s " % percent_str)
+
+        sys.stdout.flush()
+        process = subprocess.Popen(cmd)
+        process.wait()
+
+
+if __name__ == "__main__":
+    main()

Copied: branches/soc-2011-tomato/build_files/cmake/cmake_static_check_sparse.py (from rev 40264, trunk/blender/build_files/cmake/cmake_static_check_sparse.py)
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/cmake_static_check_sparse.py	                        (rev 0)
+++ branches/soc-2011-tomato/build_files/cmake/cmake_static_check_sparse.py	2011-09-16 14:45:32 UTC (rev 40265)
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+# $Id:
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+CHECKER_IGNORE_PREFIX = [
+    "extern",
+    "intern/moto",
+    ]
+
+CHECKER_BIN = "sparse"
+CHECKER_ARGS = [
+    ]
+
+import project_source_info
+import subprocess
+import sys
+
+
+def main():
+    source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX)
+
+    check_commands = []
+    for c, inc_dirs, defs in source_info:
+
+        cmd = ([CHECKER_BIN] +
+                CHECKER_ARGS +
+               [c] +
+               [("-I%s" % i) for i in inc_dirs] +
+               [("-D%s" % d) for d in defs]
+              )
+
+        check_commands.append((c, cmd))
+
+    for i, (c, cmd) in enumerate(check_commands):
+        percent = 100.0 * (i / (len(check_commands) - 1))
+        percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
+
+        sys.stdout.write("%s %s\n" % (percent_str, c))
+        sys.stdout.flush()
+
+        process = subprocess.Popen(cmd)
+        process.wait()
+
+if __name__ == "__main__":
+    main()

Copied: branches/soc-2011-tomato/build_files/cmake/cmake_static_check_splint.py (from rev 40264, trunk/blender/build_files/cmake/cmake_static_check_splint.py)
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/cmake_static_check_splint.py	                        (rev 0)
+++ branches/soc-2011-tomato/build_files/cmake/cmake_static_check_splint.py	2011-09-16 14:45:32 UTC (rev 40265)
@@ -0,0 +1,94 @@
+#!/usr/bin/env python
+
+# $Id:
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+CHECKER_IGNORE_PREFIX = [
+    "extern",
+    "intern/moto",
+    ]
+
+CHECKER_BIN = "splint"
+
+CHECKER_ARGS = [
+    "-weak",
+    "-posix-lib",
+    "-linelen", "10000",
+    "+ignorequals",
+    "+relaxtypes",
+    "-retvalother",
+    "+matchanyintegral",
+    "+longintegral",
+    "+ignoresigns",
+    "-nestcomment",
+    "-predboolothers",
+    "-ifempty",
+    "-unrecogcomments",
+
+    # we may want to remove these later
+    "-type",
+    "-fixedformalarray",
+    "-fullinitblock",
+    "-fcnuse",
+    "-initallelements",
+    "-castfcnptr",
+    # -forcehints,
+    "-bufferoverflowhigh",  # warns a lot about sprintf()
+
+    # re-definitions, rna causes most of these
+    "-redef",
+    "-syntax",
+    ]
+
+
+import project_source_info
+import subprocess
+import sys
+
+
+def main():
+    source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX)
+
+    check_commands = []
+    for c, inc_dirs, defs in source_info:
+        cmd = ([CHECKER_BIN] +
+                CHECKER_ARGS +
+               [c] +
+               [("-I%s" % i) for i in inc_dirs] +
+               [("-D%s" % d) for d in defs]
+              )
+
+        check_commands.append((c, cmd))
+
+    for i, (c, cmd) in enumerate(check_commands):
+        percent = 100.0 * (i / (len(check_commands) - 1))
+        percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
+
+        sys.stdout.write("%s %s\n" % (percent_str, c))
+        sys.stdout.flush()
+
+        process = subprocess.Popen(cmd)
+        process.wait()
+
+if __name__ == "__main__":
+    main()

Copied: branches/soc-2011-tomato/build_files/cmake/project_source_info.py (from rev 40264, trunk/blender/build_files/cmake/project_source_info.py)
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/project_source_info.py	                        (rev 0)
+++ branches/soc-2011-tomato/build_files/cmake/project_source_info.py	2011-09-16 14:45:32 UTC (rev 40265)
@@ -0,0 +1,165 @@
+# $Id:
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list