summaryrefslogtreecommitdiff
path: root/lib/ccan/htable/tools
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:44 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:44 +1030
commita0bff7d0625e8f3bbbabfc3d5b6d3497cea078f1 (patch)
tree62fec6ec4a70295c4af9404bcdb2cee871829337 /lib/ccan/htable/tools
parent11c90462cdeb80785a5b855047db8d6bbe71645a (diff)
downloadsamba-a0bff7d0625e8f3bbbabfc3d5b6d3497cea078f1.tar.gz
samba-a0bff7d0625e8f3bbbabfc3d5b6d3497cea078f1.tar.bz2
samba-a0bff7d0625e8f3bbbabfc3d5b6d3497cea078f1.zip
lib/ccan/htable: fix tools/speed.
As pointed out by Christian Thaeter, it has bitrotted. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit f725bbb1987284933e0f21dfb8f2ce7a1f0806e5)
Diffstat (limited to 'lib/ccan/htable/tools')
-rw-r--r--lib/ccan/htable/tools/speed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ccan/htable/tools/speed.c b/lib/ccan/htable/tools/speed.c
index 26231924a1..194f11201f 100644
--- a/lib/ccan/htable/tools/speed.c
+++ b/lib/ccan/htable/tools/speed.c
@@ -4,6 +4,7 @@
#include <ccan/hash/hash.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
@@ -28,9 +29,9 @@ static size_t hash_obj(const unsigned int *key)
return hashl(key, 1, 0);
}
-static bool cmp(const unsigned int *key1, const unsigned int *key2)
+static bool cmp(const struct object *object, const unsigned int *key)
{
- return *key1 == *key2;
+ return object->key == *key;
}
HTABLE_DEFINE_TYPE(struct object, objkey, hash_obj, cmp, obj);