X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-traverse.c;h=4de0ebdef2861a080fdae7d19eff129a1b8c48b0;hb=fc44729c471bcdc7ab0410448d991a65e74cec3d;hp=0a6310027beaf3c4c6a3770e5b0b57eae1587eb0;hpb=b21004624683be5bf1d8f75e3b5be4e9618049ee;p=ccan diff --git a/ccan/tdb2/test/run-traverse.c b/ccan/tdb2/test/run-traverse.c index 0a631002..4de0ebde 100644 --- a/ccan/tdb2/test/run-traverse.c +++ b/ccan/tdb2/test/run-traverse.c @@ -1,11 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include -#include +#include "tdb2-source.h" #include #include "logging.h" @@ -38,9 +31,9 @@ struct trav_data { enum TDB_ERROR delete_error; }; -static int trav(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, void *p) +static int trav(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, + struct trav_data *td) { - struct trav_data *td = p; int val; td->calls++; @@ -75,9 +68,8 @@ struct trav_grow_data { }; static int trav_grow(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, - void *p) + struct trav_grow_data *tgd) { - struct trav_grow_data *tgd = p; int val; unsigned char buffer[128] = { 0 }; @@ -114,8 +106,8 @@ int main(int argc, char *argv[]) TDB_INTERNAL|TDB_CONVERT, TDB_CONVERT, TDB_NOMMAP|TDB_CONVERT }; union tdb_attribute hattr = { .hash = { .base = { TDB_ATTRIBUTE_HASH }, - .hash_fn = fixedhash, - .hash_private = &seed } }; + .fn = fixedhash, + .data = &seed } }; hattr.base.next = &tap_log_attr;