Cleanup: multistatement-macros warning
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 Jul 2017 22:18:20 +0000 (08:18 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 Jul 2017 22:21:01 +0000 (08:21 +1000)
source/blender/blenlib/BLI_array.h
source/blender/bmesh/intern/bmesh_private.h

index 74f24c808ffaf7f0f8a0fd3fccad1a3a3d94ea49..3ffca818c0d52bf783cf62a2e1a3e591b2215d08 100644 (file)
@@ -135,11 +135,12 @@ void _bli_array_grow_func(void **arr_p, const void *arr_static,
 #define BLI_array_append_ret(arr) \
        (BLI_array_reserve(arr, 1), &arr[(_##arr##_count++)])
 
-#define BLI_array_free(arr)                                                   \
+#define BLI_array_free(arr) {                                                 \
        if (arr && (char *)arr != _##arr##_static) {                              \
                BLI_array_fake_user(arr);                                             \
                MEM_freeN(arr);                                                       \
-       } (void)0
+       } \
+} ((void)0)
 
 #define BLI_array_pop(arr)  (                                                 \
        (arr && _##arr##_count) ?                                                 \
index 4161fbe90fbad756a5a533f632987f00d4b6a763..4dcf97e3f356c58e0dbd2297f6591072290380bb 100644 (file)
 #  define BM_CHECK_ELEMENT(el)  (void)(el)
 #else
 int bmesh_elem_check(void *element, const char htype);
-#  define BM_CHECK_ELEMENT(el)                                                \
+#  define BM_CHECK_ELEMENT(el) {                                              \
        if (bmesh_elem_check(el, ((BMHeader *)el)->htype)) {                      \
            printf("check_element failure, with code %i on line %i in file\n"     \
            "    \"%s\"\n\n",                                                     \
            bmesh_elem_check(el, ((BMHeader *)el)->htype),                        \
            __LINE__, __FILE__);                                                  \
-       } (void)0
+       } \
+} ((void)0)
 #endif
 
 int bmesh_radial_length(const BMLoop *l);