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

Campbell Barton ideasman42 at gmail.com
Mon Apr 2 04:41:41 CEST 2012


Revision: 45323
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45323
Author:   campbellbarton
Date:     2012-04-02 02:41:28 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
code cleanup:
  always use if (...) even if the macros dont require it (confuses parsers)
  define macros without the ';'s included.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_filter.c
    trunk/blender/source/blender/editors/space_graph/graph_draw.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c
    trunk/blender/source/blender/editors/transform/transform_manipulator.c
    trunk/blender/source/blender/editors/transform/transform_orientations.c
    trunk/blender/source/blender/imbuf/intern/anim_movie.c
    trunk/blender/source/blender/makesrna/intern/makesrna.c
    trunk/blender/source/blender/makesrna/intern/rna_test.c
    trunk/blender/source/blender/modifiers/intern/MOD_explode.c
    trunk/blender/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
    trunk/blender/source/blender/render/intern/source/convertblender.c
    trunk/blender/source/blender/render/intern/source/volumetric.c

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -362,7 +362,10 @@
 		else {\
 			filter_mode |= ANIMFILTER_TMP_PEEK; \
 		} \
-		(void) _doSubChannels;
+		  \
+		{ \
+			(void) _doSubChannels; \
+		}
 		/* ... standard sub-channel filtering can go on here now ... */
 #define END_ANIMFILTER_SUBCHANNELS \
 		filter_mode = _filter; \
@@ -954,7 +957,7 @@
 			/* only work with this channel and its subchannels if it is editable */
 			if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_FCU(fcu)) {
 				/* only include this curve if selected in a way consistent with the filtering requirements */
-				if ( ANIMCHANNEL_SELOK(SEL_FCU(fcu)) && ANIMCHANNEL_SELEDITOK(SEL_FCU(fcu)) ) {
+				if (ANIMCHANNEL_SELOK(SEL_FCU(fcu)) && ANIMCHANNEL_SELEDITOK(SEL_FCU(fcu))) {
 					/* only include if this curve is active */
 					if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) {
 						/* name based filtering... */
@@ -1168,7 +1171,7 @@
 		/* only work with this channel and its subchannels if it is editable */
 		if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) {
 			/* only include this track if selected in a way consistent with the filtering requirements */
-			if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) {
+			if (ANIMCHANNEL_SELOK(SEL_NLT(nlt))) {
 				/* only include if this track is active */
 				if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) {
 					ANIMCHANNEL_NEW_CHANNEL(nlt, ANIMTYPE_NLATRACK, owner_id);
@@ -1348,7 +1351,7 @@
 		/* include data-expand widget first */
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 			/* check if filtering by active status */
-			if ANIMCHANNEL_ACTIVEOK(ntree) {
+			if (ANIMCHANNEL_ACTIVEOK(ntree)) {
 				ANIMCHANNEL_NEW_CHANNEL(ntree, ANIMTYPE_DSNTREE, owner_id);
 			}
 		}
@@ -1433,7 +1436,7 @@
 			/* include texture-expand widget? */
 			if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 				/* check if filtering by active status */
-				if ANIMCHANNEL_ACTIVEOK(tex) {
+				if (ANIMCHANNEL_ACTIVEOK(tex)) {
 					ANIMCHANNEL_NEW_CHANNEL(tex, ANIMTYPE_DSTEX, owner_id);
 				}
 			}
@@ -1485,7 +1488,7 @@
 			// hmm... do we need to store the index of this material in the array anywhere?
 			if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 				/* check if filtering by active status */
-				if ANIMCHANNEL_ACTIVEOK(ma) {
+				if (ANIMCHANNEL_ACTIVEOK(ma)) {
 					ANIMCHANNEL_NEW_CHANNEL(ma, ANIMTYPE_DSMAT, ma);
 				}
 			}
@@ -1527,7 +1530,7 @@
 			/* include particle-expand widget first */
 			if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 				/* check if filtering by active status */
-				if ANIMCHANNEL_ACTIVEOK(psys->part) {
+				if (ANIMCHANNEL_ACTIVEOK(psys->part)) {
 					ANIMCHANNEL_NEW_CHANNEL(psys->part, ANIMTYPE_DSPART, psys->part);
 				}
 			}
@@ -1667,7 +1670,7 @@
 		/* include data-expand widget first */
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 			/* check if filtering by active status */
-			if ANIMCHANNEL_ACTIVEOK(iat) {
+			if (ANIMCHANNEL_ACTIVEOK(iat)) {
 				ANIMCHANNEL_NEW_CHANNEL(iat, type, iat);
 			}
 		}
@@ -1701,7 +1704,7 @@
 	if (tmp_items) {
 		/* include key-expand widget first */
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
-			if ANIMCHANNEL_ACTIVEOK(key) {
+			if (ANIMCHANNEL_ACTIVEOK(key)) {
 				ANIMCHANNEL_NEW_CHANNEL(key, ANIMTYPE_DSSKEY, ob);
 			}
 		}
@@ -1818,7 +1821,7 @@
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 			/* check if filtering by selection */
 			// XXX: double-check on this - most of the time, a lot of tools need to filter out these channels!
-			if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
+			if (ANIMCHANNEL_SELOK((base->flag & SELECT))) {
 				/* check if filtering by active status */
 				if (ANIMCHANNEL_ACTIVEOK(ob)) {
 					ANIMCHANNEL_NEW_CHANNEL(base, ANIMTYPE_OBJECT, ob);
@@ -1863,7 +1866,7 @@
 		/* include data-expand widget first */
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 			/* check if filtering by active status */
-			if ANIMCHANNEL_ACTIVEOK(wo) {
+			if (ANIMCHANNEL_ACTIVEOK(wo)) {
 				ANIMCHANNEL_NEW_CHANNEL(wo, ANIMTYPE_DSWOR, sce);
 			}
 		}
@@ -1968,7 +1971,7 @@
 		/* firstly add object expander if required */
 		if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
 			/* check if filtering by selection */
-			if ANIMCHANNEL_SELOK((sce->flag & SCE_DS_SELECTED)) {
+			if (ANIMCHANNEL_SELOK((sce->flag & SCE_DS_SELECTED))) {
 				/* NOTE: active-status doesn't matter for this! */
 				ANIMCHANNEL_NEW_CHANNEL(sce, ANIMTYPE_SCENE, sce);
 			}

Modified: trunk/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_draw.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/editors/space_graph/graph_draw.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -118,7 +118,7 @@
 		/* only draw if visible
 		 *	- min/max here are fixed, not relative
 		 */
-		if IN_RANGE(fed->time, (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) {
+		if (IN_RANGE(fed->time, (v2d->cur.xmin - fac), (v2d->cur.xmax + fac))) {
 			glVertex2f(fed->time, fed->min);
 			glVertex2f(fed->time, fed->max);
 		}
@@ -149,7 +149,7 @@
 		/* as an optimization step, only draw those in view 
 		 *	- we apply a correction factor to ensure that points don't pop in/out due to slight twitches of view size
 		 */
-		if IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac)) {
+		if (IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac))) {
 			if (edit) {
 				/* 'Keyframe' vertex only, as handle lines and handles have already been drawn
 				 *	- only draw those with correct selection state for the current drawing color

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -4491,7 +4491,7 @@
 				if (parsel->flag & SELECT) {
 					Base *parbase = object_in_scene(parsel, scene);
 					if (parbase) { /* in rare cases this can fail */
-						if TESTBASELIB_BGMODE(v3d, scene, parbase) {
+						if (TESTBASELIB_BGMODE(v3d, scene, parbase)) {
 							break;
 						}
 					}

Modified: trunk/blender/source/blender/editors/transform/transform_manipulator.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_manipulator.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/editors/transform/transform_manipulator.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -531,7 +531,7 @@
 		if (ob && !(ob->flag & SELECT)) ob= NULL;
 
 		for (base= scene->base.first; base; base= base->next) {
-			if TESTBASELIB(v3d, base) {
+			if (TESTBASELIB(v3d, base)) {
 				if (ob==NULL)
 					ob= base->object;
 				calc_tw_center(scene, base->object->obmat[3]);

Modified: trunk/blender/source/blender/editors/transform/transform_orientations.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_orientations.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/editors/transform/transform_orientations.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -859,7 +859,7 @@
 		if (ob && !(ob->flag & SELECT)) ob = NULL;
 		
 		for (base= scene->base.first; base; base= base->next) {
-			if TESTBASELIB(v3d, base) {
+			if (TESTBASELIB(v3d, base)) {
 				if (ob == NULL) {
 					ob= base->object;
 					break;

Modified: trunk/blender/source/blender/imbuf/intern/anim_movie.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/anim_movie.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/imbuf/intern/anim_movie.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -45,8 +45,12 @@
 #undef AVIIF_KEYFRAME // redefined in AVI_avi.h
 #undef AVIIF_LIST // redefined in AVI_avi.h
 
-#define FIXCC(fcc)  if (fcc == 0)	fcc = mmioFOURCC('N', 'o', 'n', 'e'); \
-		if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8');
+#define FIXCC(fcc) \
+	{ \
+		if (fcc == 0)       { fcc = mmioFOURCC('N', 'o', 'n', 'e'); } \
+		if (fcc == BI_RLE8) { fcc = mmioFOURCC('R', 'l', 'e', '8'); } \
+	}
+
 #endif
 
 #include <sys/types.h>

Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -93,7 +93,7 @@
 		return -1;                                                            \
 	}                                                                         \
 	remove(tmpfile);                                                          \
-	return 1;                                                                 \
+	return 1                                                                  \
 
 /* end REN_IF_DIFF */
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_test.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_test.c	2012-04-02 01:57:56 UTC (rev 45322)
+++ trunk/blender/source/blender/makesrna/intern/rna_test.c	2012-04-02 02:41:28 UTC (rev 45323)
@@ -47,66 +47,69 @@
 
 #ifdef UNIT_TEST
 
-#define DEF_VARS(type, prefix)								\
-	static type prefix ## arr[ARRAY_SIZE];					\
-	static type prefix ## darr[DYNAMIC_ARRAY_SIZE];			\
-	static int prefix ## darr_len = ARRAY_SIZE;				\
-	static type prefix ## marr MARRAY_DIM;					\
-	static type prefix ## dmarr DYNAMIC_MARRAY_DIM;			\
-	static int prefix ## dmarr_len = sizeof(prefix ## dmarr);
+#define DEF_VARS(type, prefix)                                \
+    static type prefix ## arr[ARRAY_SIZE];                    \
+    static type prefix ## darr[DYNAMIC_ARRAY_SIZE];           \

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list