Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-07 02:30:27 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-07 04:20:09 +0300
commitd22245a2e360d2e708ca37169be8eb5a5899b98d (patch)
treef1bde8f5da6ea424fa1f9538d6debd4b5fd6b5f4 /builtin/difftool.c
parentd0a48a0a1d0df49af2e5fd6a80b0d84776c285aa (diff)
hashmap_entry_init takes "struct hashmap_entry *"
C compilers do type checking to make life easier for us. So rely on that and update all hashmap_entry_init callers to take "struct hashmap_entry *" to avoid future bugs while improving safety and readability. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/difftool.c')
-rw-r--r--builtin/difftool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 16eb8b70ea3..98ffc04c61e 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -161,7 +161,7 @@ static void add_left_or_right(struct hashmap *map, const char *path,
struct pair_entry *e, *existing;
FLEX_ALLOC_STR(e, path, path);
- hashmap_entry_init(e, strhash(path));
+ hashmap_entry_init(&e->entry, strhash(path));
existing = hashmap_get(map, e, NULL);
if (existing) {
free(e);
@@ -234,7 +234,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
while (!strbuf_getline_nul(&buf, fp)) {
struct path_entry *entry;
FLEX_ALLOC_STR(entry, path, buf.buf);
- hashmap_entry_init(entry, strhash(buf.buf));
+ hashmap_entry_init(&entry->entry, strhash(buf.buf));
hashmap_add(result, entry);
}
fclose(fp);
@@ -461,7 +461,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
/* Avoid duplicate working_tree entries */
FLEX_ALLOC_STR(entry, path, dst_path);
- hashmap_entry_init(entry, strhash(dst_path));
+ hashmap_entry_init(&entry->entry, strhash(dst_path));
if (hashmap_get(&working_tree_dups, entry, NULL)) {
free(entry);
continue;