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 --- merge-recursive.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index 3abba3a618..8787a40b0c 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -65,8 +65,7 @@ static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap, return NULL; hashmap_entry_init(&key.ent, strhash(dir)); key.dir = dir; - return hashmap_get_entry(hashmap, &key, NULL, - struct dir_rename_entry, ent); + return hashmap_get_entry(hashmap, &key, ent, NULL); } static int dir_rename_cmp(const void *unused_cmp_data, @@ -104,8 +103,7 @@ static struct collision_entry *collision_find_entry(struct hashmap *hashmap, hashmap_entry_init(&key.ent, strhash(target_file)); key.target_file = target_file; - return hashmap_get_entry(hashmap, &key, NULL, - struct collision_entry, ent); + return hashmap_get_entry(hashmap, &key, ent, NULL); } static int collision_cmp(const void *unused_cmp_data, -- cgit v1.2.3