[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49720] trunk/blender/source/blender: code cleanup: ensure macros require '; ' endings

Campbell Barton ideasman42 at gmail.com
Wed Aug 8 23:20:10 CEST 2012


Revision: 49720
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49720
Author:   campbellbarton
Date:     2012-08-08 21:20:10 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
code cleanup: ensure macros require ';' endings

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_context.h
    trunk/blender/source/blender/blenkernel/BKE_fcurve.h
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/blenlib/BLI_array.h
    trunk/blender/source/blender/blenlib/BLI_utildefines.h
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h

Modified: trunk/blender/source/blender/blenkernel/BKE_context.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_context.h	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/blenkernel/BKE_context.h	2012-08-08 21:20:10 UTC (rev 49720)
@@ -221,7 +221,7 @@
 #define CTX_DATA_END                                                          \
 		}                                                                     \
 		BLI_freelistN(&ctx_data_list);                                        \
-	}
+} (void)0
 
 int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *));
 

Modified: trunk/blender/source/blender/blenkernel/BKE_fcurve.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_fcurve.h	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/blenkernel/BKE_fcurve.h	2012-08-08 21:20:10 UTC (rev 49720)
@@ -83,7 +83,7 @@
 		
 /* tidy up for driver targets loopers */
 #define DRIVER_TARGETS_LOOPER_END \
-	}
+}
 
 /* ---------------------- */
 

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-08-08 21:20:10 UTC (rev 49720)
@@ -3115,7 +3115,7 @@
 		copy_m4_m4(obmat, cob->matrix);
 		copy_v3_v3(ownLoc, obmat[3]);
 		
-		INIT_MINMAX(curveMin, curveMax)
+		INIT_MINMAX(curveMin, curveMax);
 		BKE_object_minmax(ct->tar, curveMin, curveMax);
 		
 		/* get targetmatrix */

Modified: trunk/blender/source/blender/blenlib/BLI_array.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_array.h	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/blenlib/BLI_array.h	2012-08-08 21:20:10 UTC (rev 49720)
@@ -151,7 +151,7 @@
 	if (arr && (char *)arr != _##arr##_static) {                              \
 	    BLI_array_fake_user(arr);                                             \
 	    MEM_freeN(arr);                                                       \
-	}
+	} (void)0
 
 #define BLI_array_pop(arr)  (                                                 \
 	(arr && _##arr##_count) ?                                                 \
@@ -162,12 +162,12 @@
 /* resets the logical size of an array to zero, but doesn't
  * free the memory. */
 #define BLI_array_empty(arr)                                                  \
-	_##arr##_count = 0
+	_##arr##_count = 0; (void)0
 
 /* set the count of the array, doesn't actually increase the allocated array
  * size.  don't use this unless you know what you're doing. */
 #define BLI_array_length_set(arr, count)                                      \
-	_##arr##_count = (count)
+	_##arr##_count = (count); (void)0
 
 /* only to prevent unused warnings */
 #define BLI_array_fake_user(arr)                                              \
@@ -187,5 +187,7 @@
 	        MEM_mallocN(sizeof(*(arr)) * (realsize), allocstr)                \
 	    )                                                                     \
 
-#define BLI_array_fixedstack_free(arr)  \
-	if (_##arr##_is_static) MEM_freeN(arr)
+#define BLI_array_fixedstack_free(arr)                                        \
+	if (_##arr##_is_static) {                                                 \
+		MEM_freeN(arr);                                                       \
+	} (void)0

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-08-08 21:20:10 UTC (rev 49720)
@@ -81,7 +81,7 @@
 #define INIT_MINMAX(min, max) {                                               \
 		(min)[0] = (min)[1] = (min)[2] =  1.0e30f;                            \
 		(max)[0] = (max)[1] = (max)[2] = -1.0e30f;                            \
-	}
+	} (void)0
 #define INIT_MINMAX2(min, max) {                                              \
 		(min)[0] = (min)[1] = 1.0e30f;                                        \
 		(max)[0] = (max)[1] = -1.0e30f;                                       \
@@ -185,7 +185,7 @@
 	}                                                                         \
 	else {                                                                    \
 		CLAMP(a, c, b);                                                       \
-	} (void)
+	} (void)0
 
 #define IS_EQ(a, b) ((fabs((double)(a) - (b)) >= (double) FLT_EPSILON) ? 0 : 1)
 #define IS_EQF(a, b) ((fabsf((float)(a) - (b)) >= (float) FLT_EPSILON) ? 0 : 1)

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-08-08 20:38:55 UTC (rev 49719)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-08-08 21:20:10 UTC (rev 49720)
@@ -482,11 +482,10 @@
 #define USER_TOOLTIPS_PYTHON    (1 << 26)
 
 /* helper macro for checking frame clamping */
-#define FRAMENUMBER_MIN_CLAMP(cfra)                                           \
-	{                                                                         \
-		if ((U.flag & USER_NONEGFRAMES) && (cfra < 0))                        \
-			cfra = 0;                                                         \
-	}
+#define FRAMENUMBER_MIN_CLAMP(cfra)  {                                        \
+	if ((U.flag & USER_NONEGFRAMES) && (cfra < 0))                            \
+		cfra = 0;                                                             \
+	} (void)0
 
 /* viewzom */
 #define USER_ZOOM_CONT			0
@@ -521,7 +520,7 @@
 #define USER_MENUFIXEDORDER		(1 << 23)
 #define USER_CONTINUOUS_MOUSE	(1 << 24)
 #define USER_ZOOM_INVERT		(1 << 25)
-#define USER_ZOOM_HORIZ		(1 << 26) /* for CONTINUE and DOLLY zoom */
+#define USER_ZOOM_HORIZ			(1 << 26) /* for CONTINUE and DOLLY zoom */
 #define USER_SPLASH_DISABLE		(1 << 27)
 #define USER_HIDE_RECENT		(1 << 28)
 #define USER_SHOW_THUMBNAILS	(1 << 29)




More information about the Bf-blender-cvs mailing list