From a31bf66b771694aa72de6bbfe1922b41b2ffee2c Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:44:29 +0200 Subject: [PATCH] Fix compiler warning about uninitialized member fHolder was also initialized before, but in a source file while the compiler seems to only have checked the header file. This moves the minimalistic code of the source file into the header file. --- Kassiopeia/Objects/CMakeLists.txt | 1 - Kassiopeia/Objects/Include/KSObject.h | 4 ++++ Kassiopeia/Objects/Source/KSObject.cxx | 10 ---------- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 Kassiopeia/Objects/Source/KSObject.cxx diff --git a/Kassiopeia/Objects/CMakeLists.txt b/Kassiopeia/Objects/CMakeLists.txt index 3e6636e23..e3362f341 100644 --- a/Kassiopeia/Objects/CMakeLists.txt +++ b/Kassiopeia/Objects/CMakeLists.txt @@ -37,7 +37,6 @@ endforeach( BASENAME ) # source files set( OBJECTS_SOURCE_BASENAMES KSObjectsMessage.cxx - KSObject.cxx KSCommand.cxx KSCommandGroup.cxx KSComponent.cxx diff --git a/Kassiopeia/Objects/Include/KSObject.h b/Kassiopeia/Objects/Include/KSObject.h index a4ba1a3ac..33f826a39 100644 --- a/Kassiopeia/Objects/Include/KSObject.h +++ b/Kassiopeia/Objects/Include/KSObject.h @@ -56,6 +56,10 @@ class KSObject : public katrin::KTagged mutable KSHolder* fHolder; }; +KSObject::KSObject() : KTagged(), fHolder(nullptr) {} +KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy), fHolder(nullptr) {} +KSObject::~KSObject() = default; + inline KSObject::KSHolder::KSHolder() = default; inline KSObject::KSHolder::~KSHolder() = default; diff --git a/Kassiopeia/Objects/Source/KSObject.cxx b/Kassiopeia/Objects/Source/KSObject.cxx deleted file mode 100644 index e33b0af8f..000000000 --- a/Kassiopeia/Objects/Source/KSObject.cxx +++ /dev/null @@ -1,10 +0,0 @@ -#include "KSObject.h" - -namespace Kassiopeia -{ - -KSObject::KSObject() : KTagged(), fHolder(nullptr) {} -KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy), fHolder(nullptr) {} -KSObject::~KSObject() = default; - -} // namespace Kassiopeia