From 84636fc2af4dfc77b43479909273ebadb4f9b7cb Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 14 Dec 2020 00:22:04 +0100 Subject: Codechange: Remove all remaining uses of cpp_offset. --- src/table/newgrf_debug_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/table/newgrf_debug_data.h') 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(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(b)->variable); }, cpp_sizeof(base, variable), bit, cb_id } #define NIC_END() { nullptr, 0, 0, 0, 0 } /* Helper for filling variable tables */ -- cgit v1.2.3-70-g09d2