Skip to content

Commit 9ab4295

Browse files
stefanbellergitster
authored andcommitted
convert/sub-process: drop cast to hashmap_cmp_fn
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 77bdc09 commit 9ab4295

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

convert.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
583583

584584
if (!subprocess_map_initialized) {
585585
subprocess_map_initialized = 1;
586-
hashmap_init(&subprocess_map, (hashmap_cmp_fn) cmd2process_cmp,
587-
NULL, 0);
586+
hashmap_init(&subprocess_map, cmd2process_cmp, NULL, 0);
588587
entry = NULL;
589588
} else {
590589
entry = (struct cmd2process *)subprocess_find_entry(&subprocess_map, cmd);

sub-process.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
#include "pkt-line.h"
77

88
int cmd2process_cmp(const void *unused_cmp_data,
9-
const struct subprocess_entry *e1,
10-
const struct subprocess_entry *e2,
9+
const void *entry,
10+
const void *entry_or_key,
1111
const void *unused_keydata)
1212
{
13+
const struct subprocess_entry *e1 = entry;
14+
const struct subprocess_entry *e2 = entry_or_key;
15+
1316
return strcmp(e1->cmd, e2->cmd);
1417
}
1518

sub-process.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ struct subprocess_entry {
2121
/* subprocess functions */
2222

2323
extern int cmd2process_cmp(const void *unused_cmp_data,
24-
const struct subprocess_entry *e1,
25-
const struct subprocess_entry *e2,
24+
const void *e1,
25+
const void *e2,
2626
const void *unused_keydata);
2727

2828
typedef int(*subprocess_start_fn)(struct subprocess_entry *entry);

0 commit comments

Comments
 (0)