diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-14 00:22:04 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-02-13 20:08:53 +0100 |
commit | 84636fc2af4dfc77b43479909273ebadb4f9b7cb (patch) | |
tree | a4e33da78ab32008675bef8df22e9ca6a2ffcf1a /src/table/newgrf_debug_data.h | |
parent | 7845434270524d4c777a6711d2e17ac89eeeeb89 (diff) | |
download | openttd-84636fc2af4dfc77b43479909273ebadb4f9b7cb.tar.xz |
Codechange: Remove all remaining uses of cpp_offset.
Diffstat (limited to 'src/table/newgrf_debug_data.h')
-rw-r--r-- | src/table/newgrf_debug_data.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index e31d09338..e35b2eecb 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -12,11 +12,11 @@ #include "../newgrf_roadtype.h" /* Helper for filling property tables */ -#define NIP(prop, base, variable, type, name) { name, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type } +#define NIP(prop, base, variable, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), prop, type } #define NIP_END() { nullptr, 0, 0, 0, 0 } /* Helper for filling callback tables */ -#define NIC(cb_id, base, variable, bit) { #cb_id, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), bit, cb_id } +#define NIC(cb_id, base, variable, bit) { #cb_id, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), bit, cb_id } #define NIC_END() { nullptr, 0, 0, 0, 0 } /* Helper for filling variable tables */ |