From 386651153bfd25a0850e096a3770fd73387ef69b Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Thu, 20 Jun 2024 15:33:56 +0300 Subject: [PATCH] Improve EDA_ITEM memory layout slightly. --- common/eda_item.cpp | 16 ++++++++-------- include/eda_item.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/eda_item.cpp b/common/eda_item.cpp index aa4c400fd8..d66a8f9320 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -35,27 +35,27 @@ #include EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType ) : - m_parent( parent ), - m_forceVisible( false ), + m_structType( idType ), m_flags( 0 ), - m_structType( idType ) + m_parent( parent ), + m_forceVisible( false ) { } EDA_ITEM::EDA_ITEM( KICAD_T idType ) : + m_structType( idType ), + m_flags( 0 ), m_parent( nullptr ), m_forceVisible( false ), - m_flags( 0 ), - m_structType( idType ) { } EDA_ITEM::EDA_ITEM( const EDA_ITEM& base ) : m_Uuid( base.m_Uuid ), - m_parent( base.m_parent ), - m_forceVisible( base.m_forceVisible ), + m_structType( base.m_structType ), m_flags( base.m_flags ), - m_structType( base.m_structType ) + m_parent( base.m_parent ), + m_forceVisible( base.m_forceVisible ) { SetForcedTransparency( base.GetForcedTransparency() ); } diff --git a/include/eda_item.h b/include/eda_item.h index d649e71806..5cfbe442cd 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -484,17 +484,17 @@ protected: public: const KIID m_Uuid; -protected: - EDA_ITEM* m_parent; ///< Linked list: Link (parent struct) - bool m_forceVisible; - EDA_ITEM_FLAGS m_flags; - private: /** * Run time identification, _keep private_ so it can never be changed after a ctor * sets it. See comment near SetType() regarding virtual functions. */ - KICAD_T m_structType; + KICAD_T m_structType; + +protected: + EDA_ITEM_FLAGS m_flags; + EDA_ITEM* m_parent; ///< Linked list: Link (parent struct) + bool m_forceVisible; };