diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-09 01:20:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-09 01:20:10 +0400 |
commit | 0107385f7f846bb3f8ad97fed1fb13b8b9a4405e (patch) | |
tree | 8dd50830246be296ac16e8cab1d1c19268b8747e /source/blender/blenlib | |
parent | 5e0f254afa8caed1febbe02130cc313a53149efe (diff) |
code cleanup: ensure macros require ';' endings
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_array.h | 12 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 18258014529..32c2d5b9dc7 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -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 diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 536236c07ac..78d54defafd 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -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) |