diff options
author | Stefan Beller <sbeller@google.com> | 2017-06-30 17:28:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-05 13:53:12 -0700 |
commit | 152cbdc64e0c8d07adbd63f029f8fa5bb7c45ddf (patch) | |
tree | 2074a25a6af5c27f5946b996d138ad2577d24fb0 /submodule-config.c | |
parent | 45dcb35f9a4755f3530fe9ec6a1622deeefe36bf (diff) | |
download | git-152cbdc64e0c8d07adbd63f029f8fa5bb7c45ddf.tar.gz |
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>
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/submodule-config.c b/submodule-config.c index 0e1126183d..edc8dd04b6 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -35,27 +35,33 @@ static struct submodule_cache the_submodule_cache; static int is_cache_init; static int config_path_cmp(const void *unused_cmp_data, - const struct submodule_entry *a, - const struct submodule_entry *b, + const void *entry, + const void *entry_or_key, 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) || hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1); } static int config_name_cmp(const void *unused_cmp_data, - const struct submodule_entry *a, - const struct submodule_entry *b, + const void *entry, + const void *entry_or_key, 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) || hashcmp(a->config->gitmodules_sha1, b->config->gitmodules_sha1); } 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_name, (hashmap_cmp_fn) config_name_cmp, NULL, 0); + hashmap_init(&cache->for_path, config_path_cmp, NULL, 0); + hashmap_init(&cache->for_name, config_name_cmp, NULL, 0); } static void free_one_config(struct submodule_entry *entry) |