Archived
1
0
Fork 0

rbtree.c: rbtree_walk: pass rbnode->key instead of rbnode to callback function

This commit is contained in:
Henrik Hautakoski 2011-01-05 09:11:56 +01:00
parent 2c54173a52
commit 0fba36440c
4 changed files with 8 additions and 7 deletions

View file

@ -94,14 +94,14 @@ static int keyref_exists(int low, int high, int value) {
return 0;
}
static void walk_fn(rbnode *n) {
static void walk_fn(const void *key) {
static int i = 0;
while(keyref_exists(0, i-1, keyref[i]))
i++;
assert(keyref[i] == *((int*)n->key));
assert(keyref[i] == *((int*)key));
if (++i > NODES)
i = 0;