submodule-config.c: drop hashmap_cmp_fn cast
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
45dcb35f9a
commit
152cbdc64e
@ -35,27 +35,33 @@ static struct submodule_cache the_submodule_cache;
|
|||||||
static int is_cache_init;
|
static int is_cache_init;
|
||||||
|
|
||||||
static int config_path_cmp(const void *unused_cmp_data,
|
static int config_path_cmp(const void *unused_cmp_data,
|
||||||
const struct submodule_entry *a,
|
const void *entry,
|
||||||
const struct submodule_entry *b,
|
const void *entry_or_key,
|
||||||
const void *unused_keydata)
|
const void *unused_keydata)
|
||||||
{
|
{
|
||||||
|
const struct submodule_entry *a = entry;
|
||||||
|
const struct submodule_entry *b = entry_or_key;
|
||||||
|
|
||||||
return strcmp(a->config->path, b->config->path) ||
|
return strcmp(a->config->path, b->config->path) ||
|
||||||
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
|
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_name_cmp(const void *unused_cmp_data,
|
static int config_name_cmp(const void *unused_cmp_data,
|
||||||
const struct submodule_entry *a,
|
const void *entry,
|
||||||
const struct submodule_entry *b,
|
const void *entry_or_key,
|
||||||
const void *unused_keydata)
|
const void *unused_keydata)
|
||||||
{
|
{
|
||||||
|
const struct submodule_entry *a = entry;
|
||||||
|
const struct submodule_entry *b = entry_or_key;
|
||||||
|
|
||||||
return strcmp(a->config->name, b->config->name) ||
|
return strcmp(a->config->name, b->config->name) ||
|
||||||
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
|
hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cache_init(struct submodule_cache *cache)
|
static void cache_init(struct submodule_cache *cache)
|
||||||
{
|
{
|
||||||
hashmap_init(&cache->for_path, (hashmap_cmp_fn) config_path_cmp, NULL, 0);
|
hashmap_init(&cache->for_path, config_path_cmp, NULL, 0);
|
||||||
hashmap_init(&cache->for_name, (hashmap_cmp_fn) config_name_cmp, NULL, 0);
|
hashmap_init(&cache->for_name, config_name_cmp, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_one_config(struct submodule_entry *entry)
|
static void free_one_config(struct submodule_entry *entry)
|
||||||
|
Loading…
Reference in New Issue
Block a user