diff options
author | Eric Wong <e@80x24.org> | 2019-10-07 01:30:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-07 03:20:12 +0200 |
commit | 404ab78e39fc74c4eb604b6003642ed264f687a6 (patch) | |
tree | 54cea276f612f84304b9420257a8a667d02ccbbe /sub-process.c | |
parent | OFFSETOF_VAR macro to simplify hashmap iterators (diff) | |
download | git-404ab78e39fc74c4eb604b6003642ed264f687a6.tar.xz git-404ab78e39fc74c4eb604b6003642ed264f687a6.zip |
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 <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sub-process.c')
-rw-r--r-- | sub-process.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sub-process.c b/sub-process.c index ad94f72665..1b1af9dcbd 100644 --- a/sub-process.c +++ b/sub-process.c @@ -24,8 +24,7 @@ struct subprocess_entry *subprocess_find_entry(struct hashmap *hashmap, const ch hashmap_entry_init(&key.ent, strhash(cmd)); key.cmd = cmd; - return hashmap_get_entry(hashmap, &key, NULL, - struct subprocess_entry, ent); + return hashmap_get_entry(hashmap, &key, ent, NULL); } int subprocess_read_status(int fd, struct strbuf *status) |