diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_linklist_stack.h | 4 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 947386dc934..a59023d4f9b 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -130,7 +130,7 @@ unsigned int BLI_ghashutil_strhash_p(const void *key); int BLI_ghashutil_strcmp(const void *a, const void *b); #define BLI_ghashutil_inthash(key) ( \ - CHECK_TYPE_INLINE(key, int), \ + CHECK_TYPE_INLINE(&(key), int *), \ BLI_ghashutil_uinthash((unsigned int)key)) unsigned int BLI_ghashutil_uinthash(unsigned int key); #define BLI_ghashutil_inthash_v4(key) ( \ diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index 5f4f98c5a4f..d3d1924628c 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -69,14 +69,14 @@ BLI_linklist_prepend_pool(&(var), ptr, _##var##_pool)) #define BLI_LINKSTACK_POP(var) \ (var ? (typeof(_##var##_type))BLI_linklist_pop_pool(&(var), _##var##_pool) : NULL) -#define BLI_LINKSTACK_POP_ELSE(var, r) \ +#define BLI_LINKSTACK_POP_DEFAULT(var, r) \ (var ? (typeof(_##var##_type))BLI_linklist_pop_pool(&(var), _##var##_pool) : r) #else /* non gcc */ #define BLI_LINKSTACK_PUSH(var, ptr) ( \ BLI_linklist_prepend_pool(&(var), ptr, _##var##_pool)) #define BLI_LINKSTACK_POP(var) \ (var ? BLI_linklist_pop_pool(&(var), _##var##_pool) : NULL) -#define BLI_LINKSTACK_POP_ELSE(var, r) \ +#define BLI_LINKSTACK_POP_DEFAULT(var, r) \ (var ? BLI_linklist_pop_pool(&(var), _##var##_pool) : r) #endif /* gcc check */ diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index c8cdfdb60fa..600476b9038 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -313,11 +313,11 @@ #define IS_EQ(a, b) ( \ CHECK_TYPE_INLINE(a, double), CHECK_TYPE_INLINE(b, double), \ - ((fabs((double)(a) - (b)) >= (double) FLT_EPSILON) ? false : true)) + ((fabs((double)((a) - (b))) >= (double) FLT_EPSILON) ? false : true)) #define IS_EQF(a, b) ( \ CHECK_TYPE_INLINE(a, float), CHECK_TYPE_INLINE(b, float), \ - ((fabsf((float)(a) - (b)) >= (float) FLT_EPSILON) ? false : true)) + ((fabsf((float)((a) - (b))) >= (float) FLT_EPSILON) ? false : true)) #define IS_EQT(a, b, c) ((a > b) ? (((a - b) <= c) ? 1 : 0) : ((((b - a) <= c) ? 1 : 0))) #define IN_RANGE(a, b, c) ((b < c) ? ((b < a && a < c) ? 1 : 0) : ((c < a && a < b) ? 1 : 0)) @@ -339,9 +339,9 @@ #define STACK_PUSH(stack, val) (void)((stack)[(_##stack##_index)++] = val) #define STACK_PUSH_RET(stack) ((void)stack, ((stack)[(_##stack##_index)++])) #define STACK_PUSH_RET_PTR(stack) ((void)stack, &((stack)[(_##stack##_index)++])) -#define STACK_POP(stack) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : NULL) -#define STACK_POP_PTR(stack) ((_##stack##_index) ? &((stack)[--(_##stack##_index)]) : NULL) -#define STACK_POP_ELSE(stack, r) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : r) +#define STACK_POP(stack) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : NULL) +#define STACK_POP_PTR(stack) ((_##stack##_index) ? &((stack)[--(_##stack##_index)]) : NULL) +#define STACK_POP_DEFAULT(stack, r) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : r) #define STACK_FREE(stack) ((void)stack) #ifdef __GNUC__ #define STACK_SWAP(stack_a, stack_b) { \ @@ -382,10 +382,10 @@ /* Warning-free macros for storing ints in pointers. Use these _only_ * for storing an int in a pointer, not a pointer in an int (64bit)! */ #define SET_INT_IN_POINTER(i) ((void *)(intptr_t)(i)) -#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) +#define GET_INT_FROM_POINTER(i) ((void)0, ((int)(intptr_t)(i))) #define SET_UINT_IN_POINTER(i) ((void *)(uintptr_t)(i)) -#define GET_UINT_FROM_POINTER(i) ((unsigned int)(uintptr_t)(i)) +#define GET_UINT_FROM_POINTER(i) ((void)0, ((unsigned int)(uintptr_t)(i))) /* Macro to convert a value to string in the preprocessor |