summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-07-01 00:28:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-05 20:53:12 (GMT)
commit9ab42958f6c103fc75fcf2598ccb18e2c493c0fb (patch)
tree5638786061d73ae9d9edfbc2974927eca447f1df
parent77bdc09786b731a9e2757a86d025e2859a5b333f (diff)
downloadgit-9ab42958f6c103fc75fcf2598ccb18e2c493c0fb.zip
git-9ab42958f6c103fc75fcf2598ccb18e2c493c0fb.tar.gz
git-9ab42958f6c103fc75fcf2598ccb18e2c493c0fb.tar.bz2
convert/sub-process: drop cast to hashmap_cmp_fn
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--convert.c3
-rw-r--r--sub-process.c7
-rw-r--r--sub-process.h4
3 files changed, 8 insertions, 6 deletions
diff --git a/convert.c b/convert.c
index deaf0ba..04966c7 100644
--- a/convert.c
+++ b/convert.c
@@ -583,8 +583,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
if (!subprocess_map_initialized) {
subprocess_map_initialized = 1;
- hashmap_init(&subprocess_map, (hashmap_cmp_fn) cmd2process_cmp,
- NULL, 0);
+ hashmap_init(&subprocess_map, cmd2process_cmp, NULL, 0);
entry = NULL;
} else {
entry = (struct cmd2process *)subprocess_find_entry(&subprocess_map, cmd);
diff --git a/sub-process.c b/sub-process.c
index a3cfab1..6cbffa4 100644
--- a/sub-process.c
+++ b/sub-process.c
@@ -6,10 +6,13 @@
#include "pkt-line.h"
int cmd2process_cmp(const void *unused_cmp_data,
- const struct subprocess_entry *e1,
- const struct subprocess_entry *e2,
+ const void *entry,
+ const void *entry_or_key,
const void *unused_keydata)
{
+ const struct subprocess_entry *e1 = entry;
+ const struct subprocess_entry *e2 = entry_or_key;
+
return strcmp(e1->cmd, e2->cmd);
}
diff --git a/sub-process.h b/sub-process.h
index 96a2cca..8cd07a5 100644
--- a/sub-process.h
+++ b/sub-process.h
@@ -21,8 +21,8 @@ struct subprocess_entry {
/* subprocess functions */
extern int cmd2process_cmp(const void *unused_cmp_data,
- const struct subprocess_entry *e1,
- const struct subprocess_entry *e2,
+ const void *e1,
+ const void *e2,
const void *unused_keydata);
typedef int(*subprocess_start_fn)(struct subprocess_entry *entry);