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>
This commit is contained in:

committed by
Junio C Hamano

parent
f6eb6bdcf2
commit
b94e5c1df6
@ -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,
|
||||
|
Reference in New Issue
Block a user