]> git.ozlabs.org Git - ccan/blobdiff - ccan/htable/test/run-copy.c
tal: add tal_dup_or_null and tal_dup_talarr helpers.
[ccan] / ccan / htable / test / run-copy.c
index 2bc1778614e1146fb4e96e0ac188c47d5ef9c10f..f8a35006085d6efa5dc96e34f3f5fd0cf0473eb1 100644 (file)
@@ -6,7 +6,7 @@
 
 #define NUM_VALS 512
 
-static size_t hash(const void *elem, void *unused)
+static size_t hash(const void *elem, void *unused UNNEEDED)
 {
        size_t h = *(uint64_t *)elem / 2;
        return h;
@@ -28,8 +28,8 @@ int main(void)
 
        htable_init(&ht, hash, NULL);
        for (i = 0; i < NUM_VALS; i++) {
-               ok1(ht.max >= i);
-               ok1(ht.max <= i * 2);
+               ok1(ht_max(&ht) >= i);
+               ok1(ht_max(&ht) <= i * 2);
                htable_add(&ht, hash(&val[i], NULL), &val[i]);
        }