]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ebtree: make eb_is_empty() and eb_is_dup() take a const
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Oct 2019 13:21:58 +0000 (15:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Oct 2019 13:24:19 +0000 (15:24 +0200)
For whatever absurd reason these ones do not take a const, resulting in
some haproxy functions being forced to confusingly use variables instead
of const arguments. Let's fix this and backport it to older versions.

ebtree/ebtree.h

index 39226e3fb58a8bbe22ee4a4be1865ea379d15eab..2e6ba03c08da58c6d851ab90045a0e29fd7cfdad 100644 (file)
@@ -520,13 +520,13 @@ __eb_insert_dup(struct eb_node *sub, struct eb_node *new)
 \**************************************/
 
 /* Return non-zero if the tree is empty, otherwise zero */
-static inline int eb_is_empty(struct eb_root *root)
+static inline int eb_is_empty(const struct eb_root *root)
 {
        return !root->b[EB_LEFT];
 }
 
 /* Return non-zero if the node is a duplicate, otherwise zero */
-static inline int eb_is_dup(struct eb_node *node)
+static inline int eb_is_dup(const struct eb_node *node)
 {
        return node->bit < 0;
 }