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:29 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-07 04:20:10 +0300
commitb94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70 (patch)
tree81566486743a5dafb2dddaf09de597529223f315 /builtin/difftool.c
parentf6eb6bdcf2719defc3d38e0e2712fa3e18d29e91 (diff)
hashmap_add takes "struct hashmap_entry *"
This is less error-prone than "void *" as the compiler now detects invalid types being passed. 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 98ffc04c61e..82c146718da 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -168,7 +168,7 @@ static void add_left_or_right(struct hashmap *map, const char *path,
e = existing;
} else {
e->left[0] = e->right[0] = '\0';
- hashmap_add(map, e);
+ hashmap_add(map, &e->entry);
}
strlcpy(is_right ? e->right : e->left, content, PATH_MAX);
}
@@ -235,7 +235,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
struct path_entry *entry;
FLEX_ALLOC_STR(entry, path, buf.buf);
hashmap_entry_init(&entry->entry, strhash(buf.buf));
- hashmap_add(result, entry);
+ hashmap_add(result, &entry->entry);
}
fclose(fp);
if (finish_command(&diff_files))
@@ -466,7 +466,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
free(entry);
continue;
}
- hashmap_add(&working_tree_dups, entry);
+ hashmap_add(&working_tree_dups, &entry->entry);
if (!use_wt_file(workdir, dst_path, &roid)) {
if (checkout_path(rmode, &roid, dst_path,