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 --- hashmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hashmap.c') diff --git a/hashmap.c b/hashmap.c index 65b447f6cd..39c13110bc 100644 --- a/hashmap.c +++ b/hashmap.c @@ -311,7 +311,7 @@ const void *memintern(const void *data, size_t len) /* lookup interned string in pool */ hashmap_entry_init(&key.ent, memhash(data, len)); key.len = len; - e = hashmap_get_entry(&map, &key, data, struct pool_entry, ent); + e = hashmap_get_entry(&map, &key, ent, data); if (!e) { /* not found: create it */ FLEX_ALLOC_MEM(e, data, data, len); -- cgit v1.2.3