]> git.ozlabs.org Git - ccan/blobdiff - ccan/htable/test/run-size.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / htable / test / run-size.c
index c92401c3c67d0d1d525c33f33f58d055512ee35f..090ff99683428b30ac3b070b88a4e2df0238a69f 100644 (file)
@@ -8,13 +8,13 @@
 
 /* We use the number divided by two as the hash (for lots of
    collisions). */
-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;
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
        struct htable ht;
        uint64_t val[NUM_VALS];
@@ -26,8 +26,8 @@ int main(int argc, char *argv[])
 
        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]);
        }
        htable_clear(&ht);