X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fasearch%2Ftest%2Frun.c;h=ae35ac0c8ff43a8ef295820cc9d35e9d9940560f;hb=4822f24f627f452a1282ae6b2764ebf0aee8fa8d;hp=2a896fccfe807c2c9a0ecb28dc1ea4d02e2b395b;hpb=93d1e1063c6b5599ab334398234d2de05c1236e8;p=ccan diff --git a/ccan/asearch/test/run.c b/ccan/asearch/test/run.c index 2a896fcc..ae35ac0c 100644 --- a/ccan/asearch/test/run.c +++ b/ccan/asearch/test/run.c @@ -3,7 +3,9 @@ #include #include -static int test_cmp(const int *key, const int *elt) +#include + +static int test_cmp(const int *key, const int *elt, void *ctx) { if (*key < *elt) return -1; @@ -23,12 +25,14 @@ int main(void) for (start = 0; start < ARRAY_SIZE(arr); start++) { for (num = 0; num < ARRAY_SIZE(arr) - start; num++) { key = 7; - ok1(asearch(&key, &arr[start], num, test_cmp) == NULL); + ok1(asearch(&key, &arr[start], num, test_cmp, + NULL) == NULL); total++; for (i = start; i < start+num; i++) { const int *ret; key = arr[i]; - ret = asearch(&key, &arr[start], num, test_cmp); + ret = asearch(&key, &arr[start], num, + test_cmp, NULL); ok1(ret); ok1(ret && *ret == key); total++;