diff options
Diffstat (limited to 'source/blender/blenlib/intern/BLI_heap.c')
-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) |