From: Ruben Kerkhof Date: Tue, 1 Mar 2016 17:36:52 +0000 (+0100) Subject: utils_avltree.c: fix compiler warning X-Git-Tag: collectd-5.5.2~6^2~29^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0cf5d26c680adff5a50fc4883af7c8c0570ed6d3;p=collectd.git utils_avltree.c: fix compiler warning 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)); ^~ --- 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