aboutsummaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-08-25 10:37:37 -0700
committerJunio C Hamano <gitster@pobox.com>2023-08-25 10:37:38 -0700
commiteccee1854c4c2c4a58a3e9fbbc2431e8b945ee90 (patch)
treea58fd77f6d0234b66c898f8384cd43048c7edab9 /range-diff.c
parent23013a49c82025227748b2be413f183e5d44d2fd (diff)
parentbeaa1d952b90523a167a5d3f24e0a8ce56a4afcd (diff)
downloadgit-eccee1854c4c2c4a58a3e9fbbc2431e8b945ee90.tar.xz
Merge branch 'jk/function-pointer-mismatches-fix'
Code clean-up to please clang-18. * jk/function-pointer-mismatches-fix: hashmap: use expected signatures for comparison functions
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/range-diff.c b/range-diff.c
index 2e86063491..ca5493984a 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -230,16 +230,19 @@ cleanup:
}
static int patch_util_cmp(const void *cmp_data UNUSED,
- const struct patch_util *a,
- const struct patch_util *b,
- const char *keydata)
+ const struct hashmap_entry *ha,
+ const struct hashmap_entry *hb,
+ const void *keydata)
{
+ const struct patch_util
+ *a = container_of(ha, const struct patch_util, e),
+ *b = container_of(hb, const struct patch_util, e);
return strcmp(a->diff, keydata ? keydata : b->diff);
}
static void find_exact_matches(struct string_list *a, struct string_list *b)
{
- struct hashmap map = HASHMAP_INIT((hashmap_cmp_fn)patch_util_cmp, NULL);
+ struct hashmap map = HASHMAP_INIT(patch_util_cmp, NULL);
int i;
/* First, add the patches of a to a hash map */