From f7397f4d3ef62a8b6a9463a357875ee51479a6a8 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 24 Mar 2018 10:36:54 +0100 Subject: [PATCH] cosmetics: init fields at declaration, emptying the ctor --- include/simgrid/kernel/resource/Model.hpp | 10 +++++----- src/kernel/resource/Model.cpp | 11 +---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index eb4b01783f..3478fee4be 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -94,15 +94,15 @@ public: virtual bool nextOccuringEventIsIdempotent() { return true; } protected: - ActionLmmListPtr modifiedSet_; + ActionLmmListPtr modifiedSet_ = nullptr; lmm_system_t maxminSystem_ = nullptr; private: e_UM_t updateMechanism_ = UM_UNDEFINED; - ActionList* readyActionSet_; /**< Actions in state SURF_ACTION_READY */ - ActionList* runningActionSet_; /**< Actions in state SURF_ACTION_RUNNING */ - ActionList* failedActionSet_; /**< Actions in state SURF_ACTION_FAILED */ - ActionList* doneActionSet_; /**< Actions in state SURF_ACTION_DONE */ + ActionList* readyActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_READY */ + ActionList* runningActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_RUNNING */ + ActionList* failedActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_FAILED */ + ActionList* doneActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_DONE */ heap_type actionHeap_; }; diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index 2d70b7ed02..54b03920ca 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -12,16 +12,7 @@ namespace simgrid { namespace kernel { namespace resource { -Model::Model() : maxminSystem_(nullptr) -{ - readyActionSet_ = new ActionList(); - runningActionSet_ = new ActionList(); - failedActionSet_ = new ActionList(); - doneActionSet_ = new ActionList(); - - modifiedSet_ = nullptr; - updateMechanism_ = UM_UNDEFINED; -} +Model::Model() = default; Model::~Model() { -- 2.20.1