Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff.c: adjust hash function signature to match hashmap expectation
author
Stefan Beller
<sbeller@google.com>
Mon, 16 Jul 2018 23:05:38 +0000
(16:05 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 17 Jul 2018 18:25:31 +0000
(11:25 -0700)
This makes the follow up patch easier.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
3783aad
)
diff --git
a/diff.c
b/diff.c
index ce7bedc1b9221c7877e94ffa695bc3654c8b26b5..d1bae900cdccf3a2dd09ce8e09e317da8e587688 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-707,11
+707,15
@@
struct moved_entry {
struct moved_entry *next_line;
};
struct moved_entry *next_line;
};
-static int moved_entry_cmp(const
struct diff_options *diffopt
,
- const
struct moved_entry *a
,
- const
struct moved_entry *b
,
+static int moved_entry_cmp(const
void *hashmap_cmp_fn_data
,
+ const
void *entry
,
+ const
void *entry_or_key
,
const void *keydata)
{
const void *keydata)
{
+ const struct diff_options *diffopt = hashmap_cmp_fn_data;
+ const struct moved_entry *a = entry;
+ const struct moved_entry *b = entry_or_key;
+
return !xdiff_compare_lines(a->es->line, a->es->len,
b->es->line, b->es->len,
diffopt->xdl_opts);
return !xdiff_compare_lines(a->es->line, a->es->len,
b->es->line, b->es->len,
diffopt->xdl_opts);
@@
-5534,10
+5538,8
@@
static void diff_flush_patch_all_file_pairs(struct diff_options *o)
if (o->color_moved) {
struct hashmap add_lines, del_lines;
if (o->color_moved) {
struct hashmap add_lines, del_lines;
- hashmap_init(&del_lines,
- (hashmap_cmp_fn)moved_entry_cmp, o, 0);
- hashmap_init(&add_lines,
- (hashmap_cmp_fn)moved_entry_cmp, o, 0);
+ hashmap_init(&del_lines, moved_entry_cmp, o, 0);
+ hashmap_init(&add_lines, moved_entry_cmp, o, 0);
add_lines_to_move_detection(o, &add_lines, &del_lines);
mark_color_as_moved(o, &add_lines, &del_lines);
add_lines_to_move_detection(o, &add_lines, &del_lines);
mark_color_as_moved(o, &add_lines, &del_lines);