From: Martin Quinson Date: Sat, 24 Mar 2018 09:36:54 +0000 (+0100) Subject: cosmetics: init fields at declaration, emptying the ctor X-Git-Tag: v3.20~645 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f7397f4d3ef62a8b6a9463a357875ee51479a6a8 cosmetics: init fields at declaration, emptying the ctor --- 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() {