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 --- range-diff.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'range-diff.c') diff --git a/range-diff.c b/range-diff.c index 9df53569bb..22ad959cee 100644 --- a/range-diff.c +++ b/range-diff.c @@ -229,9 +229,7 @@ static void find_exact_matches(struct string_list *a, struct string_list *b) util->patch = b->items[i].string; util->diff = util->patch + util->diff_offset; hashmap_entry_init(&util->e, strhash(util->diff)); - other = hashmap_remove_entry(&map, util, NULL, - struct patch_util, - e /* member name */); + other = hashmap_remove_entry(&map, util, e, NULL); if (other) { if (other->matching >= 0) BUG("already assigned!"); -- cgit v1.2.1