]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
hlink: Fix function pointer cast in qsort()
authorCharalampos Mitrodimas <charmitro@posteo.net>
Wed, 20 Nov 2024 12:55:50 +0000 (14:55 +0200)
committerAndrew Tridgell <andrew@tridgell.net>
Tue, 17 Dec 2024 21:56:27 +0000 (08:56 +1100)
Replace unsafe generic function pointer cast with proper type cast for
qsort() comparison function. This fixes a potential type mismatch
warning without changing the behavior.

Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
hlink.c

diff --git a/hlink.c b/hlink.c
index 20291f2673fdb5af3731c077a978ca297c9e0f0a..2c14407ad9a2b20556a6e4dc76a46c3ae4c75bfa 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -117,7 +117,7 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
        struct ht_int32_node *node = NULL;
        int32 gnum, gnum_next;
 
-       qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)()) hlink_compare_gnum);
+       qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)(const void*, const void*))hlink_compare_gnum);
 
        for (from = 0; from < ndx_count; from++) {
                file = hlink_flist->sorted[ndx_list[from]];