From: Willy Tarreau Date: Mon, 25 Jul 2011 10:22:44 +0000 (+0200) Subject: CLEANUP: ebtree: remove a few annoying signedness warnings X-Git-Tag: v1.5-dev8~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22c0a93c63ffd387cb846eedbc93508e29fcb5b6;p=thirdparty%2Fhaproxy.git CLEANUP: ebtree: remove a few annoying signedness warnings (from ebtree 6.0.6) Care has been taken not to make the code bigger (it even got smaller due to a possible simplification). (cherry picked from commit 7a2c1df646049c7daac52677ec11ed63048cd150) --- diff --git a/ebtree/ebmbtree.h b/ebtree/ebmbtree.h index 1df3fcf4a9..336b6c1721 100644 --- a/ebtree/ebmbtree.h +++ b/ebtree/ebmbtree.h @@ -527,7 +527,7 @@ static forceinline struct ebmb_node *__ebmb_lookup_prefix(struct eb_root *root, * bits, let's compare prefixes and descend the cover * subtree if they match. */ - if (node->node.bit >> 1 == pfx) + if ((unsigned short)node->node.bit >> 1 == pfx) troot = node->node.branches.b[EB_LEFT]; else troot = node->node.branches.b[EB_RGHT]; diff --git a/ebtree/ebtree.h b/ebtree/ebtree.h index e0f9a18127..96138f1d3a 100644 --- a/ebtree/ebtree.h +++ b/ebtree/ebtree.h @@ -376,7 +376,7 @@ struct eb_node { eb_troot_t *node_p; /* link node's parent */ eb_troot_t *leaf_p; /* leaf node's parent */ short int bit; /* link's bit position. */ - short int pfx; /* data prefix length, always related to leaf */ + short unsigned int pfx; /* data prefix length, always related to leaf */ }; /* Return the structure of type whose member points to */