]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: ebtree: remove a few annoying signedness warnings
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Jul 2011 10:22:44 +0000 (12:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Dec 2011 16:09:49 +0000 (17:09 +0100)
(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)

ebtree/ebmbtree.h
ebtree/ebtree.h

index 1df3fcf4a98c4ea7ea3ea8b678e0bec650970df9..336b6c172143da8a499709dd5bcbb89069bea743 100644 (file)
@@ -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];
index e0f9a18127b5d16e9fcc08bf89265192318f5bfb..96138f1d3aaabc82d94e51cd2297b990151f3aad 100644 (file)
@@ -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 <type> whose member <member> points to <ptr> */