From 35b61a7512dc1b8b1d8bc562aad2a72d254b8a69 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 1 Sep 2013 15:01:15 +0000 Subject: Move GCC attributes into a centraized defines Instead of having ifdef __GNUC__ all over the headers to use special compiler's hints use a special file where all things like this are concentrated. Makes code easier to follow and allows to manage special attributes in more efficient way. Thanks Campbell for review! --- source/blender/bmesh/intern/bmesh_iterators.h | 13 +++---------- source/blender/bmesh/intern/bmesh_polygon.h | 9 +++------ 2 files changed, 6 insertions(+), 16 deletions(-) (limited to 'source/blender/bmesh/intern') diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h index b5535b59321..bb25d3fabd1 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.h +++ b/source/blender/bmesh/intern/bmesh_iterators.h @@ -39,6 +39,7 @@ * */ +#include "BLI_compiler_attrs.h" #include "BLI_mempool.h" /* Defines for passing to BM_iter_new. @@ -181,18 +182,10 @@ typedef struct BMIter { char itype; } BMIter; -void *BM_iter_at_index(BMesh *bm, const char itype, void *data, int index) -#ifdef __GNUC__ -__attribute__((warn_unused_result)) -#endif -; +void *BM_iter_at_index(BMesh *bm, const char itype, void *data, int index) ATTR_WARN_UNUSED_RESULT; int BM_iter_as_array(BMesh *bm, const char itype, void *data, void **array, const int len); void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len, - void **stack_array, int stack_array_size) -#ifdef __GNUC__ -__attribute__((warn_unused_result)) -#endif -; + void **stack_array, int stack_array_size) ATTR_WARN_UNUSED_RESULT; int BMO_iter_as_array(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char restrictmask, void **array, const int len); void *BMO_iter_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char restrictmask, diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h index e5dc5c081c3..90f0075da26 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.h +++ b/source/blender/bmesh/intern/bmesh_polygon.h @@ -27,12 +27,9 @@ * \ingroup bmesh */ -int BM_face_calc_tessellation(const BMFace *f, BMLoop **r_loops, int (*r_index)[3]) -#ifdef __GNUC__ - __attribute__((warn_unused_result)) - __attribute__((nonnull)) -#endif -; +#include "BLI_compiler_attrs.h" + +int BM_face_calc_tessellation(const BMFace *f, BMLoop **r_loops, int (*r_index)[3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void BM_face_calc_normal(const BMFace *f, float r_no[3]); void BM_face_calc_normal_vcos(BMesh *bm, BMFace *f, float r_no[3], float const (*vertexCos)[3]); -- cgit v1.2.3