Files
git/builtin
Eric Wong 23dee69f53 OFFSETOF_VAR macro to simplify hashmap iterators
While we cannot rely on a `__typeof__' operator being portable
to use with `offsetof'; we can calculate the pointer offset
using an existing pointer and the address of a member using
pointer arithmetic for compilers without `__typeof__'.

This allows us to simplify usage of hashmap iterator macros
by not having to specify a type when a pointer of that type
is already given.

In the future, list iterator macros (e.g. list_for_each_entry)
may also be implemented using OFFSETOF_VAR to save hackers the
trouble of using container_of/list_entry macros and without
relying on non-portable `__typeof__'.

v3: use `__typeof__' to avoid clang warnings

Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-07 10:20:11 +09:00
..
2019-07-19 11:30:20 -07:00
2019-01-29 12:47:54 -08:00
2019-04-25 16:41:12 +09:00
2019-08-02 09:55:03 -07:00
2019-05-13 14:22:54 +09:00
2019-01-18 13:49:52 -08:00
2019-07-29 12:39:14 -07:00
2019-07-19 11:30:21 -07:00
2019-06-19 08:19:21 -07:00