33 int (*
cmp)(
void *key,
const void *
b),
void *next[2])
38 if (next) next[v >> 31] = t->
elem;
65 key = t->
elem = next_elem[i];
75 int i = (v >> 31) ^ !!*next;
77 t->
state += 2 * i - 1;
79 if (!(t->
state & 1)) {
99 if (( *child )->state * 2 == -t->
state) {
100 *tp = (*child)->
child[i ^ 1];
103 *child = ( *tp )->
child[i ^ 1];
106 (*tp)->child[0]->state = -((*tp)->state > 0);
107 (*tp)->child[1]->state = (*tp)->state < 0;
111 *child = (*child)->
child[i ^ 1];
113 if ((*tp)->state) t->
state = 0;
115 (*tp)->state = -t->
state;
119 if (!(*tp)->state ^ !!*next)
144 int (*
cmp)(
void *opaque,
void *
elem),
145 int (*enu)(
void *opaque,
void *elem))
152 enu(opaque, t->
elem);
168 if (left>999 || right>999)
170 if (right - left != t->
state)
174 return FFMAX(left, right) + 1;
185 print(t->
child[0], depth + 1);
186 print(t->
child[1], depth + 1);
191 static int cmp(
void *a,
const void *
b)
193 return (uint8_t *) a - (
const uint8_t *) b;
205 for (i = 0; i < 10000; i++) {
207 if (
check(root) > 999) {