From 404ab78e39fc74c4eb604b6003642ed264f687a6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Oct 2019 23:30:42 +0000 Subject: hashmap: remove type arg from hashmap_{get,put,remove}_entry Since these macros already take a `keyvar' pointer of a known type, we can rely on OFFSETOF_VAR to get the correct offset without relying on non-portable `__typeof__' and `offsetof'. Argument order is also rearranged, so `keyvar' and `member' are sequential as they are used as: `keyvar->member' Signed-off-by: Eric Wong Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- builtin/difftool.c | 2 +- builtin/fast-export.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin') diff --git a/builtin/difftool.c b/builtin/difftool.c index f2d4d1e0f8..c280e682b2 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -167,7 +167,7 @@ static void add_left_or_right(struct hashmap *map, const char *path, FLEX_ALLOC_STR(e, path, path); hashmap_entry_init(&e->entry, strhash(path)); - existing = hashmap_get_entry(map, e, NULL, struct pair_entry, entry); + existing = hashmap_get_entry(map, e, entry, NULL); if (existing) { free(e); e = existing; diff --git a/builtin/fast-export.c b/builtin/fast-export.c index ef0578bf90..e3de403efd 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -156,7 +156,7 @@ static const void *anonymize_mem(struct hashmap *map, hashmap_entry_init(&key.hash, memhash(orig, *len)); key.orig = orig; key.orig_len = *len; - ret = hashmap_get_entry(map, &key, NULL, struct anonymized_entry, hash); + ret = hashmap_get_entry(map, &key, hash, NULL); if (!ret) { ret = xmalloc(sizeof(*ret)); -- cgit v1.2.1