From 0cf5d26c680adff5a50fc4883af7c8c0570ed6d3 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 1 Mar 2016 18:36:52 +0100 Subject: [PATCH] utils_avltree.c: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit make[3]: Entering directory '/home/ruben/src/collectd/src/daemon' CC utils_avltree.lo utils_avltree.c: In function ‘rebalance’: utils_avltree.c:248:20: warning: logical ‘or’ of collectively exhaustive tests is always true [-Wlogical-op] assert ((b_bottom >= -1) || (b_bottom <= 1)); ^~ utils_avltree.c:258:20: warning: logical ‘or’ of collectively exhaustive tests is always true [-Wlogical-op] assert ((b_bottom >= -1) || (b_bottom <= 1)); ^~ --- src/utils_avltree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils_avltree.c b/src/utils_avltree.c index 139d23ac..a9b3862c 100644 --- a/src/utils_avltree.c +++ b/src/utils_avltree.c @@ -241,7 +241,7 @@ static void rebalance (c_avl_tree_t *t, c_avl_node_t *n) { assert (n->right != NULL); b_bottom = BALANCE (n->right); - assert ((b_bottom >= -1) || (b_bottom <= 1)); + assert ((b_bottom >= -1) && (b_bottom <= 1)); if (b_bottom == 1) n = rotate_right_left (t, n); else @@ -251,7 +251,7 @@ static void rebalance (c_avl_tree_t *t, c_avl_node_t *n) { assert (n->left != NULL); b_bottom = BALANCE (n->left); - assert ((b_bottom >= -1) || (b_bottom <= 1)); + assert ((b_bottom >= -1) && (b_bottom <= 1)); if (b_bottom == -1) n = rotate_left_right (t, n); else -- 2.11.0