[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55562] trunk/blender: code cleanup:

Campbell Barton ideasman42 at gmail.com
Mon Mar 25 03:41:32 CET 2013


Revision: 55562
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55562
Author:   campbellbarton
Date:     2013-03-25 02:41:30 +0000 (Mon, 25 Mar 2013)
Log Message:
-----------
code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
    trunk/blender/source/blender/blenkernel/BKE_brush.h
    trunk/blender/source/blender/blenkernel/intern/brush.c
    trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c
    trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
    trunk/blender/source/blender/collada/collada_utils.cpp
    trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp
    trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    trunk/blender/source/blender/editors/space_file/file_ops.c
    trunk/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c
    trunk/blender/source/blender/imbuf/intern/anim_movie.c
    trunk/blender/source/blender/imbuf/intern/colormanagement.c
    trunk/blender/source/blender/python/intern/bpy_app_ffmpeg.c
    trunk/blender/source/blender/python/intern/bpy_library.c
    trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
    trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
    trunk/blender/source/gameengine/Expressions/Value.cpp
    trunk/blender/source/gameengine/GameLogic/SCA_LogicManager.cpp
    trunk/blender/source/gameengine/Ketsji/KX_FontObject.cpp
    trunk/blender/source/gameengine/VideoTexture/Exception.cpp
    trunk/blender/source/gameengine/VideoTexture/FilterBase.cpp
    trunk/blender/source/gameengine/VideoTexture/FilterBlueScreen.cpp
    trunk/blender/source/gameengine/VideoTexture/FilterColor.cpp
    trunk/blender/source/gameengine/VideoTexture/FilterNormal.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageBase.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageBuff.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageMix.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageViewport.cpp
    trunk/blender/source/gameengine/VideoTexture/Texture.cpp
    trunk/blender/source/gameengine/VideoTexture/VideoBase.cpp
    trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-03-25 02:41:30 UTC (rev 55562)
@@ -94,8 +94,6 @@
  */
 
 /* See the python script above to regenerate the 48x48 icon within blender */
-#define BLENDER_ICON_WIDTH 48
-#define BLENDER_ICON_HEIGHT 48
 static long BLENDER_ICON_48x48x32[] = {
 	48,48,
 	4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303, 4671303,

Modified: trunk/blender/source/blender/blenkernel/BKE_brush.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_brush.h	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/blenkernel/BKE_brush.h	2013-03-25 02:41:30 UTC (rev 55562)
@@ -78,8 +78,8 @@
                               float rgba[4], const int thread, struct ImagePool *pool);
 float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2],
                               float rgba[4]);
-float BKE_brush_sample_masktex (const Scene *scene, struct Brush *br,const float point[3],
-                              const int thread, struct ImagePool *pool);
+float BKE_brush_sample_masktex(const Scene *scene, struct Brush *br, const float point[3],
+                               const int thread, struct ImagePool *pool);
 void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
                          struct ImBuf **imbuf, int use_color_correction);
 

Modified: trunk/blender/source/blender/blenkernel/intern/brush.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/brush.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/blenkernel/intern/brush.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -585,10 +585,11 @@
 	return intensity;
 }
 
-float BKE_brush_sample_masktex (const Scene *scene, Brush *br,
-                              const float point[3],
-                              const int thread,
-                              struct ImagePool *pool) {
+float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
+                               const float point[3],
+                               const int thread,
+                               struct ImagePool *pool)
+{
 	UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 	MTex *mtex = &br->mask_mtex;
 

Modified: trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/blenkernel/intern/dynamicpaint.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -520,7 +520,7 @@
 
 	/* if object has parents, update them too */
 	if (parent_recursion) {
-		int recursion = parent_recursion-1;
+		int recursion = parent_recursion - 1;
 		int is_canvas = 0;
 		if (ob->parent) is_canvas += subframe_updateObject(scene, ob->parent, 0, recursion, frame);
 		if (ob->track) is_canvas += subframe_updateObject(scene, ob->track, 0, recursion, frame);

Modified: trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -43,11 +43,12 @@
 #include "bmesh.h"
 #include "./intern/bmesh_private.h"
 
-
-
 #define BEVEL_EPSILON_D  1e-6
 #define BEVEL_EPSILON    1e-6f
 
+/* happens far too often, uncomment for development */
+// #define BEVEL_ASSERT_PROJECT
+
 /* for testing */
 // #pragma GCC diagnostic error "-Wpadded"
 
@@ -369,7 +370,9 @@
 
 		/* intersect the lines; by construction they should be on the same plane and not parallel */
 		if (!isect_line_line_v3(off1a, off1b, off2a, off2b, meetco, isect2)) {
+#ifdef BEVEL_ASSERT_PROJECT
 			BLI_assert(!"offset_meet failure");
+#endif
 			copy_v3_v3(meetco, off1a);  /* just to do something */
 		}
 	}
@@ -485,7 +488,9 @@
 	float otherco[3];
 
 	if (!isect_line_line_v3(e->v1->co, e->v2->co, co_a, co_b, projco, otherco)) {
+#ifdef BEVEL_ASSERT_PROJECT
 		BLI_assert(!"project meet failure");
+#endif
 		copy_v3_v3(projco, e->v1->co);
 	}
 }

Modified: trunk/blender/source/blender/collada/collada_utils.cpp
===================================================================
--- trunk/blender/source/blender/collada/collada_utils.cpp	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/collada/collada_utils.cpp	2013-03-25 02:41:30 UTC (rev 55562)
@@ -327,8 +327,8 @@
  */
 void bc_match_scale(std::vector<Object *> *objects_done, 
                     Scene &sce,
-                    UnitConverter &bc_unit) {
-
+                    UnitConverter &bc_unit)
+{
 	Object *ob = NULL;
 
 	PointerRNA scene_ptr, unit_settings;

Modified: trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/compositor/operations/COM_CompositorOperation.cpp	2013-03-25 02:41:30 UTC (rev 55562)
@@ -175,8 +175,8 @@
 		                        Full frame
 		 */
 
-		int full_width = rd->xsch * rd->size / 100;
-		int full_height =rd->ysch * rd->size / 100;
+		int full_width  = rd->xsch * rd->size / 100;
+		int full_height = rd->ysch * rd->size / 100;
 
 		dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f;
 		dy = rd->border.ymin * full_height - (full_height - this->getHeight()) / 2.0f;

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -793,7 +793,7 @@
 	return s;
 }
 
-void paint_2d_redraw (const bContext *C, void *ps, int final)
+void paint_2d_redraw(const bContext *C, void *ps, int final)
 {
 	ImagePaintState *s = ps;
 

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -179,7 +179,7 @@
 	            SCULPT_TOOL_THUMB, SCULPT_TOOL_ROTATE)))
 	{
 		if (((brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) ||
-			(brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) &&
+		    (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) &&
 		    !(brush->flag & BRUSH_RAKE))
 		{
 			if (brush->flag & BRUSH_RANDOM_ROTATION)
@@ -191,7 +191,8 @@
 		if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) {
 			ups->tex_mouse[0] = BLI_frand() * stroke->vc.ar->sizex;
 			ups->tex_mouse[1] = BLI_frand() * stroke->vc.ar->sizey;;
-		} else {
+		}
+		else {
 			copy_v2_v2(ups->tex_mouse, mouse);
 		}
 	}

Modified: trunk/blender/source/blender/editors/space_file/file_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_ops.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/editors/space_file/file_ops.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -1460,23 +1460,22 @@
 {
 	int poll = ED_operator_file_active(C);
 	SpaceFile *sfile = CTX_wm_space_file(C);
-	struct direntry *file;
 
-	if (sfile && sfile->params) {		
+	if (sfile && sfile->params) {
 		char dir[FILE_MAX], group[FILE_MAX];
 		int numfiles = filelist_numfiles(sfile->files);
 		int i;
 		int num_selected = 0;
 
 		if (filelist_islibrary(sfile->files, dir, group)) poll = 0;
-		for (i = 0; i < numfiles; i++) {				
+		for (i = 0; i < numfiles; i++) {
 			if (filelist_is_selected(sfile->files, i, CHECK_FILES)) {
 				num_selected++;
 			}
 		}
 		if (num_selected <= 0) {
 			poll = 0;
-		}		
+		}
 	}
 	else
 		poll = 0;

Modified: trunk/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c	2013-03-25 01:42:58 UTC (rev 55561)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c	2013-03-25 02:41:30 UTC (rev 55562)
@@ -754,7 +754,8 @@
 
 /* setup face preview for all coincident uvs and their faces */
 static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
-                                                   PreviewPosition *preview_position) {
+                                                   PreviewPosition *preview_position)
+{
 	StitchPreviewer *preview = state->stitch_preview;
 
 	/* static island does not change so returning immediately */
@@ -774,7 +775,8 @@
 
 /* checks if uvs are indeed stitchable and registers so that they can be shown in preview */
 static void stitch_validate_uv_stichability(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data,
-                                         PreviewPosition *preview_position) {
+                                            PreviewPosition *preview_position)
+{
 	UvElement *element_iter;
 	StitchPreviewer *preview = state->stitch_preview;
 	int vert_index;
@@ -809,7 +811,8 @@
 
 
 static void stitch_validate_edge_stichability(UvEdge *edge, StitchState *state, IslandStitchData *island_stitch_data,
-                                              PreviewPosition *preview_position) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list