Skip to content

Commit 8d0017d

Browse files
stefanbellergitster
authored andcommitted
patch-ids.c: drop hashmap_cmp_fn cast
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9ab4295 commit 8d0017d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

patch-ids.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
3535
* the side of safety. The actual value being negative does not have
3636
* any significance; only that it is non-zero matters.
3737
*/
38-
static int patch_id_cmp(struct diff_options *opt,
39-
struct patch_id *a,
40-
struct patch_id *b,
38+
static int patch_id_cmp(const void *cmpfn_data,
39+
const void *entry,
40+
const void *entry_or_key,
4141
const void *unused_keydata)
4242
{
43+
/* NEEDSWORK: const correctness? */
44+
struct diff_options *opt = (void *)cmpfn_data;
45+
struct patch_id *a = (void *)entry;
46+
struct patch_id *b = (void *)entry_or_key;
47+
4348
if (is_null_oid(&a->patch_id) &&
4449
commit_patch_id(a->commit, opt, &a->patch_id, 0))
4550
return error("Could not get patch ID for %s",
@@ -58,8 +63,7 @@ int init_patch_ids(struct patch_ids *ids)
5863
ids->diffopts.detect_rename = 0;
5964
DIFF_OPT_SET(&ids->diffopts, RECURSIVE);
6065
diff_setup_done(&ids->diffopts);
61-
hashmap_init(&ids->patches, (hashmap_cmp_fn)patch_id_cmp,
62-
&ids->diffopts, 256);
66+
hashmap_init(&ids->patches, patch_id_cmp, &ids->diffopts, 256);
6367
return 0;
6468
}
6569

0 commit comments

Comments
 (0)