Skip to content

Commit ee1df66

Browse files
stefanbellergitster
authored andcommitted
diff.c: adjust hash function signature to match hashmap expectation
This makes the follow up patch easier. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3783aad commit ee1df66

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

diff.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,15 @@ struct moved_entry {
707707
struct moved_entry *next_line;
708708
};
709709

710-
static int moved_entry_cmp(const struct diff_options *diffopt,
711-
const struct moved_entry *a,
712-
const struct moved_entry *b,
710+
static int moved_entry_cmp(const void *hashmap_cmp_fn_data,
711+
const void *entry,
712+
const void *entry_or_key,
713713
const void *keydata)
714714
{
715+
const struct diff_options *diffopt = hashmap_cmp_fn_data;
716+
const struct moved_entry *a = entry;
717+
const struct moved_entry *b = entry_or_key;
718+
715719
return !xdiff_compare_lines(a->es->line, a->es->len,
716720
b->es->line, b->es->len,
717721
diffopt->xdl_opts);
@@ -5534,10 +5538,8 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
55345538
if (o->color_moved) {
55355539
struct hashmap add_lines, del_lines;
55365540

5537-
hashmap_init(&del_lines,
5538-
(hashmap_cmp_fn)moved_entry_cmp, o, 0);
5539-
hashmap_init(&add_lines,
5540-
(hashmap_cmp_fn)moved_entry_cmp, o, 0);
5541+
hashmap_init(&del_lines, moved_entry_cmp, o, 0);
5542+
hashmap_init(&add_lines, moved_entry_cmp, o, 0);
55415543

55425544
add_lines_to_move_detection(o, &add_lines, &del_lines);
55435545
mark_color_as_moved(o, &add_lines, &del_lines);

0 commit comments

Comments
 (0)