Skip to content

Commit

Permalink
hlink: Fix function pointer cast in qsort()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
charmitro committed Nov 20, 2024
1 parent 321dd78 commit b23ea19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down

0 comments on commit b23ea19

Please sign in to comment.