Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-08-02 06:54:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-02 06:54:06 +0300
commit559e1434d847681a4e72144489b68fee650ab9a8 (patch)
treed91e78881de0e24c837c1a399d50aac3d5d397ff /source/blender/blenlib/intern/BLI_heap.c
parenta4f55617d1ae803efa7266ae0a3746b79dfb1f3a (diff)
parenthisize macro args to avoid errors
Diffstat (limited to 'source/blender/blenlib/intern/BLI_heap.c')
-rw-r--r--source/blender/blenlib/intern/BLI_heap.c10
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)