[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33442] trunk/blender: - added GCC warning -Wstrict-prototypes

Campbell Barton ideasman42 at gmail.com
Fri Dec 3 13:31:00 CET 2010


Revision: 33442
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33442
Author:   campbellbarton
Date:     2010-12-03 13:30:59 +0100 (Fri, 03 Dec 2010)

Log Message:
-----------
- added GCC warning -Wstrict-prototypes
- fixed bug in paste material, exposed by stricter warnings.
- removed/renamed various shadowed vars.
- removed BGE lamp.colour, only allow lamp.color attribute.

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/build_files/cmake/macros.cmake
    trunk/blender/build_files/scons/config/darwin-config.py
    trunk/blender/build_files/scons/config/freebsd7-config.py
    trunk/blender/build_files/scons/config/freebsd8-config.py
    trunk/blender/build_files/scons/config/freebsd9-config.py
    trunk/blender/build_files/scons/config/linux2-config.py
    trunk/blender/build_files/scons/config/linuxcross-config.py
    trunk/blender/build_files/scons/config/openbsd3-config.py
    trunk/blender/build_files/scons/config/win32-mingw-config.py
    trunk/blender/extern/glew/include/GL/glew.h
    trunk/blender/intern/audaspace/intern/AUD_C-API.h
    trunk/blender/intern/audaspace/intern/AUD_PyInit.h
    trunk/blender/intern/ghost/GHOST_Path-api.h
    trunk/blender/intern/ghost/GHOST_Types.h
    trunk/blender/intern/guardedalloc/intern/mallocn.c
    trunk/blender/intern/memutil/MEM_CacheLimiterC-Api.h
    trunk/blender/intern/opennl/CMakeLists.txt
    trunk/blender/intern/opennl/extern/ONL_opennl.h
    trunk/blender/intern/opennl/superlu/util.h
    trunk/blender/source/blender/blenkernel/BKE_icons.h
    trunk/blender/source/blender/blenkernel/BKE_sequencer.h
    trunk/blender/source/blender/blenkernel/BKE_sketch.h
    trunk/blender/source/blender/blenkernel/BKE_sound.h
    trunk/blender/source/blender/blenkernel/BKE_suggestions.h
    trunk/blender/source/blender/blenkernel/intern/cloth.c
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenkernel/intern/fmodifier.c
    trunk/blender/source/blender/blenkernel/intern/icons.c
    trunk/blender/source/blender/blenkernel/intern/implicit.c
    trunk/blender/source/blender/blenkernel/intern/material.c
    trunk/blender/source/blender/blenkernel/intern/seqeffects.c
    trunk/blender/source/blender/blenkernel/intern/softbody.c
    trunk/blender/source/blender/blenkernel/intern/suggestions.c
    trunk/blender/source/blender/blenkernel/intern/text.c
    trunk/blender/source/blender/blenkernel/intern/writeframeserver.c
    trunk/blender/source/blender/blenlib/BLI_ghash.h
    trunk/blender/source/blender/blenlib/BLI_threads.h
    trunk/blender/source/blender/blenlib/intern/math_color.c
    trunk/blender/source/blender/blenlib/intern/storage.c
    trunk/blender/source/blender/editors/animation/anim_ipo_utils.c
    trunk/blender/source/blender/editors/animation/keyingsets.c
    trunk/blender/source/blender/editors/armature/editarmature.c
    trunk/blender/source/blender/editors/armature/editarmature_retarget.c
    trunk/blender/source/blender/editors/armature/meshlaplacian.c
    trunk/blender/source/blender/editors/armature/poselib.c
    trunk/blender/source/blender/editors/armature/poseobject.c
    trunk/blender/source/blender/editors/armature/reeb.h
    trunk/blender/source/blender/editors/curve/editcurve.c
    trunk/blender/source/blender/editors/include/BIF_glutil.h
    trunk/blender/source/blender/editors/include/UI_interface_icons.h
    trunk/blender/source/blender/editors/interface/interface_draw.c
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_icons.c
    trunk/blender/source/blender/editors/interface/interface_layout.c
    trunk/blender/source/blender/editors/interface/interface_regions.c
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/editors/interface/interface_widgets.c
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/interface/view2d_ops.c
    trunk/blender/source/blender/editors/mesh/editmesh.c
    trunk/blender/source/blender/editors/mesh/editmesh_loop.c
    trunk/blender/source/blender/editors/mesh/editmesh_mods.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/mesh/meshtools.c
    trunk/blender/source/blender/editors/object/object_edit.c
    trunk/blender/source/blender/editors/object/object_lattice.c
    trunk/blender/source/blender/editors/object/object_select.c
    trunk/blender/source/blender/editors/physics/particle_edit.c
    trunk/blender/source/blender/editors/render/render_preview.c
    trunk/blender/source/blender/editors/render/render_shading.c
    trunk/blender/source/blender/editors/screen/glutil.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
    trunk/blender/source/blender/editors/space_action/action_draw.c
    trunk/blender/source/blender/editors/space_console/console_draw.c
    trunk/blender/source/blender/editors/space_console/console_ops.c
    trunk/blender/source/blender/editors/space_file/file_intern.h
    trunk/blender/source/blender/editors/space_file/filelist.h
    trunk/blender/source/blender/editors/space_graph/graph_buttons.c
    trunk/blender/source/blender/editors/space_graph/graph_draw.c
    trunk/blender/source/blender/editors/space_image/image_buttons.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_info/info_ops.c
    trunk/blender/source/blender/editors/space_info/space_info.c
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/editors/space_nla/nla_draw.c
    trunk/blender/source/blender/editors/space_outliner/outliner.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_select.c
    trunk/blender/source/blender/editors/space_text/text_draw.c
    trunk/blender/source/blender/editors/space_text/text_intern.h
    trunk/blender/source/blender/editors/space_text/text_python.c
    trunk/blender/source/blender/editors/space_view3d/drawarmature.c
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
    trunk/blender/source/blender/editors/space_view3d/view3d_header.c
    trunk/blender/source/blender/editors/space_view3d/view3d_select.c
    trunk/blender/source/blender/editors/space_view3d/view3d_snap.c
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c
    trunk/blender/source/blender/editors/transform/transform_generics.c
    trunk/blender/source/blender/editors/transform/transform_manipulator.c
    trunk/blender/source/blender/editors/transform/transform_orientations.c
    trunk/blender/source/blender/editors/transform/transform_snap.c
    trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.h
    trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    trunk/blender/source/blender/gpu/GPU_buffers.h
    trunk/blender/source/blender/gpu/GPU_extensions.h
    trunk/blender/source/blender/gpu/GPU_material.h
    trunk/blender/source/blender/gpu/intern/gpu_draw.c
    trunk/blender/source/blender/gpu/intern/gpu_extensions.c
    trunk/blender/source/blender/gpu/intern/gpu_material.c
    trunk/blender/source/blender/imbuf/IMB_thumbs.h
    trunk/blender/source/blender/imbuf/intern/allocimbuf.c
    trunk/blender/source/blender/makesdna/DNA_action_types.h
    trunk/blender/source/blender/makesdna/DNA_armature_types.h
    trunk/blender/source/blender/makesrna/intern/rna_material.c
    trunk/blender/source/blender/makesrna/intern/rna_pose.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/nodes/intern/TEX_util.c
    trunk/blender/source/blender/python/generic/noise.c
    trunk/blender/source/blender/python/intern/stubs.c
    trunk/blender/source/blender/render/extern/include/RE_raytrace.h
    trunk/blender/source/blender/render/intern/source/volumetric.c
    trunk/blender/source/blender/windowmanager/WM_api.h
    trunk/blender/source/blender/windowmanager/intern/wm_draw.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c
    trunk/blender/source/gameengine/Ketsji/KX_Light.cpp
    trunk/blender/source/gameengine/VideoTexture/FilterBlueScreen.h
    trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageRender.h

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/CMakeLists.txt	2010-12-03 12:30:59 UTC (rev 33442)
@@ -979,7 +979,7 @@
 ENDIF((NOT WIN32) AND (NOT MSVC))
 
 IF(CMAKE_COMPILER_IS_GNUCC)
-	SET(C_WARNINGS "${C_WARNINGS} -Wunused-parameter -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type")
+	SET(C_WARNINGS "${C_WARNINGS} -Wunused-parameter -Werror=strict-prototypes -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type")
 ENDIF(CMAKE_COMPILER_IS_GNUCC)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")

Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/cmake/macros.cmake	2010-12-03 12:30:59 UTC (rev 33442)
@@ -261,7 +261,9 @@
 MACRO(REMOVE_STRICT_FLAGS)
 
 	IF(CMAKE_COMPILER_IS_GNUCC)
+		_REMOVE_STRICT_FLAGS("-Wstrict-prototypes")
 		_REMOVE_STRICT_FLAGS("-Wunused-parameter")
+		_REMOVE_STRICT_FLAGS("-Wshadow")
 		_REMOVE_STRICT_FLAGS("-Werror=[^ ]+")
 		_REMOVE_STRICT_FLAGS("-Werror")
 	ENDIF(CMAKE_COMPILER_IS_GNUCC)

Modified: trunk/blender/build_files/scons/config/darwin-config.py
===================================================================
--- trunk/blender/build_files/scons/config/darwin-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/darwin-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -327,7 +327,7 @@
 	REL_CCFLAGS = REL_CCFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
 
 CC_WARN = ['-Wall']
-C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas']
+C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 
 ##FIX_STUBS_WARNINGS = -Wno-unused

Modified: trunk/blender/build_files/scons/config/freebsd7-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd7-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/freebsd7-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -188,7 +188,7 @@
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 

Modified: trunk/blender/build_files/scons/config/freebsd8-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd8-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/freebsd8-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -188,7 +188,7 @@
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 

Modified: trunk/blender/build_files/scons/config/freebsd9-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd9-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/freebsd9-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -188,7 +188,7 @@
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 

Modified: trunk/blender/build_files/scons/config/linux2-config.py
===================================================================
--- trunk/blender/build_files/scons/config/linux2-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/linux2-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -204,7 +204,7 @@
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 

Modified: trunk/blender/build_files/scons/config/linuxcross-config.py
===================================================================
--- trunk/blender/build_files/scons/config/linuxcross-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/linuxcross-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -178,7 +178,7 @@
 CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 REL_CFLAGS = [ '-O2' ]
 REL_CCFLAGS = [ '-O2' ]
-C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
+C_WARN = ['-Wall', '-Wstrict-prototypes', '-Wno-char-subscripts', '-Wdeclaration-after-statement']
 
 CC_WARN = [ '-Wall' ]
 

Modified: trunk/blender/build_files/scons/config/openbsd3-config.py
===================================================================
--- trunk/blender/build_files/scons/config/openbsd3-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/openbsd3-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -132,7 +132,7 @@
 ##
 CC = 'gcc'
 CXX = 'g++'
-C_WARN = ['-Wdeclaration-after-statement']
+C_WARN = ['-Wdeclaration-after-statement', '-Wstrict-prototypes']
 
 CC_WARN = ['-Wall']
 

Modified: trunk/blender/build_files/scons/config/win32-mingw-config.py
===================================================================
--- trunk/blender/build_files/scons/config/win32-mingw-config.py	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/build_files/scons/config/win32-mingw-config.py	2010-12-03 12:30:59 UTC (rev 33442)
@@ -169,7 +169,7 @@
 REL_CFLAGS = [ '-O2' ]
 REL_CCFLAGS = [ '-O2' ]
 
-C_WARN = [ '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
 
 CC_WARN = [ '-Wall' ]
 

Modified: trunk/blender/extern/glew/include/GL/glew.h
===================================================================
--- trunk/blender/extern/glew/include/GL/glew.h	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/extern/glew/include/GL/glew.h	2010-12-03 12:30:59 UTC (rev 33442)
@@ -12220,7 +12220,7 @@
 
 #else /* GLEW_MX */
 
-GLEWAPI GLenum glewInit ();
+GLEWAPI GLenum glewInit (void);
 GLEWAPI GLboolean glewIsSupported (const char* name);
 #define glewIsExtensionSupported(x) glewIsSupported(x)
 

Modified: trunk/blender/intern/audaspace/intern/AUD_C-API.h
===================================================================
--- trunk/blender/intern/audaspace/intern/AUD_C-API.h	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/intern/audaspace/intern/AUD_C-API.h	2010-12-03 12:30:59 UTC (rev 33442)
@@ -58,7 +58,7 @@
 /**
  * Initializes FFMPEG if it is enabled.
  */
-extern void AUD_initOnce();
+extern void AUD_initOnce(void);
 
 /**
  * Initializes an audio device.
@@ -72,17 +72,17 @@
 /**
  * Unitinitializes an audio device.
  */
-extern void AUD_exit();
+extern void AUD_exit(void);
 
 /**
  * Locks the playback device.
  */
-extern void AUD_lock();
+extern void AUD_lock(void);
 
 /**
  * Unlocks the device.
  */
-extern void AUD_unlock();
+extern void AUD_unlock(void);
 
 /**
  * Returns information about a sound.
@@ -471,9 +471,9 @@
 
 extern int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length);
 
-extern void AUD_startPlayback();
+extern void AUD_startPlayback(void);
 
-extern void AUD_stopPlayback();
+extern void AUD_stopPlayback(void);
 
 extern void AUD_seekSequencer(AUD_Channel* handle, float time);
 
@@ -483,7 +483,7 @@
 extern void AUD_setSyncCallback(AUD_syncFunction function, void* data);
 #endif
 
-extern int AUD_doesPlayback();
+extern int AUD_doesPlayback(void);
 
 #ifdef __cplusplus
 }

Modified: trunk/blender/intern/audaspace/intern/AUD_PyInit.h
===================================================================
--- trunk/blender/intern/audaspace/intern/AUD_PyInit.h	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/intern/audaspace/intern/AUD_PyInit.h	2010-12-03 12:30:59 UTC (rev 33442)
@@ -36,7 +36,7 @@
 /**
  * Initalizes the Python module.
  */
-extern PyObject* AUD_initPython();
+extern PyObject* AUD_initPython(void);
 
 #ifdef __cplusplus
 }

Modified: trunk/blender/intern/ghost/GHOST_Path-api.h
===================================================================
--- trunk/blender/intern/ghost/GHOST_Path-api.h	2010-12-03 12:08:59 UTC (rev 33441)
+++ trunk/blender/intern/ghost/GHOST_Path-api.h	2010-12-03 12:30:59 UTC (rev 33442)
@@ -41,20 +41,20 @@
  * "unpack and run" path, then look for properly installed path, not including versioning.
  * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
  */
-extern const GHOST_TUns8* GHOST_getSystemDir();
+extern const GHOST_TUns8* GHOST_getSystemDir(void);
 
 /**
  * Determine the base dir in which user configuration is stored, not including versioning.
  * @return Unsigned char string pointing to user dir (eg ~).
  */
-extern const GHOST_TUns8* GHOST_getUserDir();
+extern const GHOST_TUns8* GHOST_getUserDir(void);
 
 
 /**
  * Determine the dir in which the binary file is found.
  * @return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/).
  */
-extern const GHOST_TUns8* GHOST_getBinaryDir();
+extern const GHOST_TUns8* GHOST_getBinaryDir(void);
 
 #ifdef __cplusplus
 } 

Modified: trunk/blender/intern/ghost/GHOST_Types.h
===================================================================
--- trunk/blender/intern/ghost/GHOST_Types.h	2010-12-03 12:08:59 UTC (rev 33441)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list