summaryrefslogtreecommitdiff
path: root/builtin/difftool.c
diff options
context:
space:
mode:
authorLibravatar Eric Wong <e@80x24.org>2019-10-06 23:30:29 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-07 10:20:10 +0900
commitb94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70 (patch)
tree81566486743a5dafb2dddaf09de597529223f315 /builtin/difftool.c
parenthashmap_get_next takes "const struct hashmap_entry *" (diff)
downloadtgif-b94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70.tar.xz
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 98ffc04c61..82c146718d 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,