code cleanup: ensure macros require ';' endings

This commit is contained in:
Campbell Barton 2012-08-08 21:20:10 +00:00
parent 5e0f254afa
commit 0107385f7f
6 changed files with 17 additions and 16 deletions

View File

@ -221,7 +221,7 @@ void CTX_data_list_add(bContextDataResult *result, void *data);
#define CTX_DATA_END \
} \
BLI_freelistN(&ctx_data_list); \
}
} (void)0
int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *));

View File

@ -83,7 +83,7 @@ void bezt_add_to_cfra_elem(ListBase *lb, struct BezTriple *bezt);
/* tidy up for driver targets loopers */
#define DRIVER_TARGETS_LOOPER_END \
}
}
/* ---------------------- */

View File

@ -3115,7 +3115,7 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
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 */

View File

@ -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

View File

@ -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)

View File

@ -482,11 +482,10 @@ extern UserDef U; /* from blenkernel blender.c */
#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 @@ extern UserDef U; /* from blenkernel blender.c */
#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)