builtin/difftool.c: drop hashmap_cmp_fn cast

Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Jun 30, 2017 at 17:28 UTC 7db316bcbef06025b8254a4d5ae3fe2c6237ec18
1 file changed +22 -15
builtin/difftool.c
+22 -15
@@ -131,10 +131,12 @@ struct working_tree_entry {
131 };
132
133 static int working_tree_entry_cmp(const void *unused_cmp_data,
134 - struct working_tree_entry *a,
135 - struct working_tree_entry *b,
136 - void *unused_keydata)
134 + const void *entry,
135 + const void *entry_or_key,
136 + const void *unused_keydata)
137 {
138 + const struct working_tree_entry *a = entry;
139 + const struct working_tree_entry *b = entry_or_key;
140 return strcmp(a->path, b->path);
141 }
142
@@ -149,9 +151,13 @@ struct pair_entry {
151 };
152
153 static int pair_cmp(const void *unused_cmp_data,
152 - struct pair_entry *a, struct pair_entry *b,
153 - void *unused_keydata)
154 + const void *entry,
155 + const void *entry_or_key,
156 + const void *unused_keydata)
157 {
158 + const struct pair_entry *a = entry;
159 + const struct pair_entry *b = entry_or_key;
160 +
161 return strcmp(a->path, b->path);
162 }
163
@@ -179,9 +185,13 @@ struct path_entry {
185 };
186
187 static int path_entry_cmp(const void *unused_cmp_data,
182 - struct path_entry *a, struct path_entry *b,
183 - void *key)
188 + const void *entry,
189 + const void *entry_or_key,
190 + const void *key)
191 {
192 + const struct path_entry *a = entry;
193 + const struct path_entry *b = entry_or_key;
194 +
195 return strcmp(a->path, key ? key : b->path);
196 }
197
@@ -372,10 +382,9 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
382 rdir_len = rdir.len;
383 wtdir_len = wtdir.len;
384
375 - hashmap_init(&working_tree_dups,
376 - (hashmap_cmp_fn)working_tree_entry_cmp, NULL, 0);
377 - hashmap_init(&submodules, (hashmap_cmp_fn)pair_cmp, NULL, 0);
378 - hashmap_init(&symlinks2, (hashmap_cmp_fn)pair_cmp, NULL, 0);
385 + hashmap_init(&working_tree_dups, working_tree_entry_cmp, NULL, 0);
386 + hashmap_init(&submodules, pair_cmp, NULL, 0);
387 + hashmap_init(&symlinks2, pair_cmp, NULL, 0);
388
389 child.no_stdin = 1;
390 child.git_cmd = 1;
@@ -585,10 +594,8 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
594 * in the common case of --symlinks and the difftool updating
595 * files through the symlink.
596 */
588 - hashmap_init(&wt_modified, (hashmap_cmp_fn)path_entry_cmp,
589 - NULL, wtindex.cache_nr);
590 - hashmap_init(&tmp_modified, (hashmap_cmp_fn)path_entry_cmp,
591 - NULL, wtindex.cache_nr);
597 + hashmap_init(&wt_modified, path_entry_cmp, NULL, wtindex.cache_nr);
598 + hashmap_init(&tmp_modified, path_entry_cmp, NULL, wtindex.cache_nr);
599
600 for (i = 0; i < wtindex.cache_nr; i++) {
601 struct hashmap_entry dummy;