From 1cf1fb25950fe8abfd912bb3ad6c4bb6f2fe409e Mon Sep 17 00:00:00 2001 From: anatol Date: Mon, 11 Dec 2023 23:30:20 +0200 Subject: [PATCH] WIP --- node/processor.h | 3 +-- utility/common.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/node/processor.h b/node/processor.h index ed942d99b..1691d96c1 100644 --- a/node/processor.h +++ b/node/processor.h @@ -843,8 +843,7 @@ class NodeProcessor Type m_Value; bool operator < (const Key& x) const { return m_Value < x.m_Value; } IMPLEMENT_GET_PARENT_OBJ(Entry, m_Key) - }; - Key m_Key; + } m_Key; struct Mru :public boost::intrusive::list_base_hook<> diff --git a/utility/common.h b/utility/common.h index 821b871af..7bed67029 100644 --- a/utility/common.h +++ b/utility/common.h @@ -55,7 +55,7 @@ #define IMPLEMENT_GET_PARENT_OBJ(parent_class, this_var) \ parent_class& get_ParentObj() const { \ - parent_class* p = (parent_class*) (((uint8_t*) this) + 1 - (uint8_t*) (&((parent_class*) 1)->this_var)); \ + parent_class* p = (parent_class*) (((uint8_t*) this) - offsetof(parent_class, this_var)); \ assert(this == &p->this_var); /* this also tests that the variable of the correct type */ \ return *p; \ }