mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
[BUILD] ebtree: update to v6.0.1 to remove references to dprintf()
Cyril Bont reported a build breakage with glibc >= 2.10 due to a name clash in dprintf(). Let's remove it, it's unused anyway.
This commit is contained in:
parent
9d4d9e3144
commit
fdc1018771
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Elastic Binary Trees - macros and structures for Multi-Byte data nodes.
|
* Elastic Binary Trees - macros and structures for Multi-Byte data nodes.
|
||||||
* Version 6.0
|
* Version 6.0.1
|
||||||
* (C) 2002-2010 - Willy Tarreau <w@1wt.eu>
|
* (C) 2002-2010 - Willy Tarreau <w@1wt.eu>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,8 +18,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define dprintf(x,...) do { } while(0)
|
|
||||||
|
|
||||||
#ifndef _EBMBTREE_H
|
#ifndef _EBMBTREE_H
|
||||||
#define _EBMBTREE_H
|
#define _EBMBTREE_H
|
||||||
|
|
||||||
@ -605,7 +603,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
if (len > old->node.pfx)
|
if (len > old->node.pfx)
|
||||||
len = old->node.pfx;
|
len = old->node.pfx;
|
||||||
bit = equal_bits(new->key, old->key, bit, len);
|
bit = equal_bits(new->key, old->key, bit, len);
|
||||||
dprintf(" [new=%p, old=%p] obit=%d, eqbit=%d\n", new, old, old->node.bit, bit);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,7 +610,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
|
|
||||||
bit = equal_bits(new->key, old->key, bit, old_node_bit >> 1);
|
bit = equal_bits(new->key, old->key, bit, old_node_bit >> 1);
|
||||||
bit = (bit << 1) + 1; // assume comparisons with normal nodes
|
bit = (bit << 1) + 1; // assume comparisons with normal nodes
|
||||||
dprintf(" [old=%p, new=%p] bit=%d/2, old_bit=%d/2\n", old, new, bit, old_node_bit);
|
|
||||||
|
|
||||||
/* we must always check that our prefix is larger than the nodes
|
/* we must always check that our prefix is larger than the nodes
|
||||||
* we visit, otherwise we have to stop going down. The following
|
* we visit, otherwise we have to stop going down. The following
|
||||||
@ -625,7 +621,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
up_ptr = &old->node.node_p;
|
up_ptr = &old->node.node_p;
|
||||||
new->node.bit = new->node.pfx << 1;
|
new->node.bit = new->node.pfx << 1;
|
||||||
diff = -1;
|
diff = -1;
|
||||||
dprintf(" [new=%p, old=%p] obit=%d, nbit=%d (1)\n", new, old, old->node.bit, new->node.bit);
|
|
||||||
goto insert_above;
|
goto insert_above;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,7 +634,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
up_ptr = &old->node.node_p;
|
up_ptr = &old->node.node_p;
|
||||||
new->node.bit = bit;
|
new->node.bit = bit;
|
||||||
diff = cmp_bits(new->key, old->key, bit >> 1);
|
diff = cmp_bits(new->key, old->key, bit >> 1);
|
||||||
dprintf(" --> diff=%d, node.bit=%d/2\n", diff, new->node.bit);
|
|
||||||
goto insert_above;
|
goto insert_above;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,7 +647,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
root = &old->node.branches;
|
root = &old->node.branches;
|
||||||
side = EB_LEFT;
|
side = EB_LEFT;
|
||||||
troot = root->b[side];
|
troot = root->b[side];
|
||||||
dprintf(" --> going down cover by left\n");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -662,7 +655,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
bit = old_node_bit >> 1; /* recheck that bit */
|
bit = old_node_bit >> 1; /* recheck that bit */
|
||||||
root = &old->node.branches;
|
root = &old->node.branches;
|
||||||
troot = root->b[side];
|
troot = root->b[side];
|
||||||
dprintf(" --> going down cover by right\n");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,7 +704,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
if (bit > old->node.pfx)
|
if (bit > old->node.pfx)
|
||||||
bit = old->node.pfx;
|
bit = old->node.pfx;
|
||||||
|
|
||||||
dprintf(" [old=%p, new=%p] bit2=%d\n", old, new, bit);
|
|
||||||
new->node.bit = (bit << 1) + 1; /* assume normal node by default */
|
new->node.bit = (bit << 1) + 1; /* assume normal node by default */
|
||||||
|
|
||||||
/* if one prefix is included in the second one, we don't compare bits
|
/* if one prefix is included in the second one, we don't compare bits
|
||||||
@ -731,7 +722,6 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
*/
|
*/
|
||||||
new->node.bit--; /* anticipate cover node insertion */
|
new->node.bit--; /* anticipate cover node insertion */
|
||||||
if (new->node.pfx == old->node.pfx) {
|
if (new->node.pfx == old->node.pfx) {
|
||||||
dprintf(" [inserting dup %p->%p]\n", old, new);
|
|
||||||
new->node.bit = -1; /* mark as new dup tree, just in case */
|
new->node.bit = -1; /* mark as new dup tree, just in case */
|
||||||
|
|
||||||
if (unlikely(eb_gettag(root_right))) {
|
if (unlikely(eb_gettag(root_right))) {
|
||||||
@ -760,14 +750,12 @@ __ebmb_insert_prefix(struct eb_root *root, struct ebmb_node *new, unsigned int l
|
|||||||
new_leaf = eb_dotag(&new->node.branches, EB_LEAF);
|
new_leaf = eb_dotag(&new->node.branches, EB_LEAF);
|
||||||
|
|
||||||
if (diff >= 0) {
|
if (diff >= 0) {
|
||||||
dprintf(" [old=%p, new=%p] inserting right, obit=%d/2, nbit=%d/2\n", old, new, old->node.bit, new->node.bit);
|
|
||||||
new->node.branches.b[EB_LEFT] = troot;
|
new->node.branches.b[EB_LEFT] = troot;
|
||||||
new->node.branches.b[EB_RGHT] = new_leaf;
|
new->node.branches.b[EB_RGHT] = new_leaf;
|
||||||
new->node.leaf_p = new_rght;
|
new->node.leaf_p = new_rght;
|
||||||
*up_ptr = new_left;
|
*up_ptr = new_left;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dprintf(" [old=%p, new=%p] inserting left, obit=%d/2, nbit=%d/2\n", old, new, old->node.bit, new->node.bit);
|
|
||||||
new->node.branches.b[EB_LEFT] = new_leaf;
|
new->node.branches.b[EB_LEFT] = new_leaf;
|
||||||
new->node.branches.b[EB_RGHT] = troot;
|
new->node.branches.b[EB_RGHT] = troot;
|
||||||
new->node.leaf_p = new_left;
|
new->node.leaf_p = new_left;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Elastic Binary Trees - generic macros and structures.
|
* Elastic Binary Trees - generic macros and structures.
|
||||||
* Version 6.0
|
* Version 6.0.1
|
||||||
* (C) 2002-2010 - Willy Tarreau <w@1wt.eu>
|
* (C) 2002-2010 - Willy Tarreau <w@1wt.eu>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -519,6 +519,12 @@ __eb_insert_dup(struct eb_node *sub, struct eb_node *new)
|
|||||||
* Public functions, for the end-user *
|
* Public functions, for the end-user *
|
||||||
\**************************************/
|
\**************************************/
|
||||||
|
|
||||||
|
/* Return non-zero if the tree is empty, otherwise zero */
|
||||||
|
static inline int eb_is_empty(struct eb_root *root)
|
||||||
|
{
|
||||||
|
return !root->b[EB_LEFT];
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the first leaf in the tree starting at <root>, or NULL if none */
|
/* Return the first leaf in the tree starting at <root>, or NULL if none */
|
||||||
static inline struct eb_node *eb_first(struct eb_root *root)
|
static inline struct eb_node *eb_first(struct eb_root *root)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user