Skip to content

Commit 152cbdc

Browse files
stefanbellergitster
authored andcommitted
submodule-config.c: drop hashmap_cmp_fn cast
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 45dcb35 commit 152cbdc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

submodule-config.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,33 @@ static struct submodule_cache the_submodule_cache;
3535
static int is_cache_init;
3636

3737
static int config_path_cmp(const void *unused_cmp_data,
38-
const struct submodule_entry *a,
39-
const struct submodule_entry *b,
38+
const void *entry,
39+
const void *entry_or_key,
4040
const void *unused_keydata)
4141
{
42+
const struct submodule_entry *a = entry;
43+
const struct submodule_entry *b = entry_or_key;
44+
4245
return strcmp(a->config->path, b->config->path) ||
4346
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
4447
}
4548

4649
static int config_name_cmp(const void *unused_cmp_data,
47-
const struct submodule_entry *a,
48-
const struct submodule_entry *b,
50+
const void *entry,
51+
const void *entry_or_key,
4952
const void *unused_keydata)
5053
{
54+
const struct submodule_entry *a = entry;
55+
const struct submodule_entry *b = entry_or_key;
56+
5157
return strcmp(a->config->name, b->config->name) ||
5258
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
5359
}
5460

5561
static void cache_init(struct submodule_cache *cache)
5662
{
57-
hashmap_init(&cache->for_path, (hashmap_cmp_fn) config_path_cmp, NULL, 0);
58-
hashmap_init(&cache->for_name, (hashmap_cmp_fn) config_name_cmp, NULL, 0);
63+
hashmap_init(&cache->for_path, config_path_cmp, NULL, 0);
64+
hashmap_init(&cache->for_name, config_name_cmp, NULL, 0);
5965
}
6066

6167
static void free_one_config(struct submodule_entry *entry)

0 commit comments

Comments
 (0)