diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-02 06:54:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-02 06:54:06 +0300 |
commit | 559e1434d847681a4e72144489b68fee650ab9a8 (patch) | |
tree | d91e78881de0e24c837c1a399d50aac3d5d397ff /source/blender/blenlib/intern | |
parent | a4f55617d1ae803efa7266ae0a3746b79dfb1f3a (diff) |
parenthisize macro args to avoid errors
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/BLI_heap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index c0f338a1918..4bd404e5d73 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -54,13 +54,13 @@ struct Heap { /* internal functions */ -#define HEAP_PARENT(i) ((i - 1) >> 1) -#define HEAP_LEFT(i) ((i << 1) + 1) -#define HEAP_RIGHT(i) ((i << 1) + 2) -#define HEAP_COMPARE(a, b) (a->value < b->value) +#define HEAP_PARENT(i) (((i) - 1) >> 1) +#define HEAP_LEFT(i) (((i) << 1) + 1) +#define HEAP_RIGHT(i) (((i) << 1) + 2) +#define HEAP_COMPARE(a, b) ((a)->value < (b)->value) #if 0 /* UNUSED */ -#define HEAP_EQUALS(a, b) (a->value == b->value) +#define HEAP_EQUALS(a, b) ((a)->value == (b)->value) #endif BLI_INLINE void heap_swap(Heap *heap, const unsigned int i, const unsigned int j) |