]> the.earth.li Git - onak.git/commitdiff
Properly cast llfind parameter
authorJonathan McDowell <noodles@earth.li>
Sun, 10 Aug 2025 16:42:46 +0000 (17:42 +0100)
committerJonathan McDowell <noodles@earth.li>
Sun, 10 Aug 2025 16:42:46 +0000 (17:42 +0100)
GCC 15 gets stricter about various things, causing us to error out on
build due to this assignment without a cast.

hash.c

diff --git a/hash.c b/hash.c
index 9357831ccc9b352fd3531f8afc4ebaf54df58700..4671f744f28904040540199efb2dface31df0881 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -140,10 +140,10 @@ static int stats_key_cmp(struct stats_key *key, uint64_t *keyid)
 
 struct stats_key *findinhash(uint64_t keyid)
 {
-       int (*p)();
+       int (*p)(const void *, const void *);
        struct ll *found;
 
-       p = stats_key_cmp;
+       p = (int (*)(const void *, const void *))stats_key_cmp;
        if ((found = llfind(hashtable[keyid & HASHMASK], &keyid, p))==NULL) {
                return NULL;
        }