From: Arnaud Giersch Date: Wed, 20 Nov 2013 22:31:33 +0000 (+0100) Subject: Fix initialization order. X-Git-Tag: v3_11_beta~252 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0c43de62fbe4bfc243d6512296e09207e80bcd54 Fix initialization order. --- diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index dfbfd3e650..89bd2eeae4 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -200,10 +200,10 @@ void CpuCas01Model::addTraces() * Resource * ************/ CpuCas01Lmm::CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, xbt_dynar_t powerPeak, - int pstate, double powerScale, tmgr_trace_t powerTrace, int core, - e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace, - xbt_dict_t properties) : - CpuLmm(model, name, properties), Resource(model, name, properties) { + int pstate, double powerScale, tmgr_trace_t powerTrace, int core, + e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace, + xbt_dict_t properties) : + Resource(model, name, properties), CpuLmm(model, name, properties) { m_powerPeak = xbt_dynar_get_as(powerPeak, pstate, double); p_powerPeakList = powerPeak; m_pstate = pstate; diff --git a/src/surf/storage.hpp b/src/surf/storage.hpp index 4692baf130..91afd10f22 100644 --- a/src/surf/storage.hpp +++ b/src/surf/storage.hpp @@ -103,7 +103,7 @@ class StorageAction : virtual public Action { public: StorageAction(){}; StorageAction(ModelPtr /*model*/, double /*cost*/, bool /*failed*/, StoragePtr storage, e_surf_action_storage_type_t type) - : p_storage(storage), m_type(type) {}; + : m_type(type), p_storage(storage) {}; diff --git a/src/surf/surf.cpp b/src/surf/surf.cpp index d7fec1b68c..2d9661742c 100644 --- a/src/surf/surf.cpp +++ b/src/surf/surf.cpp @@ -419,9 +419,9 @@ void surf_exit(void) *********/ Model::Model(string name) - : m_name(name), m_resOnCB(0), m_resOffCB(0), - m_actSuspendCB(0), m_actCancelCB(0), m_actResumeCB(0), - p_maxminSystem(0) + : p_maxminSystem(0), m_name(name), + m_resOnCB(0), m_resOffCB(0), + m_actCancelCB(0), m_actSuspendCB(0), m_actResumeCB(0) { ActionPtr action = NULL; p_readyActionSet = xbt_swag_new(xbt_swag_offset(*action, p_stateHookup)); @@ -664,7 +664,7 @@ void Model::notifyActionSuspend(ActionPtr a) ************/ Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props) - : m_name(xbt_strdup(name)), m_running(true), p_model(model), m_properties(props) + : m_name(xbt_strdup(name)), m_properties(props), p_model(model), m_running(true) {} Resource::Resource(){ @@ -749,9 +749,14 @@ const char *surf_action_state_names[6] = { Action::Action(){} Action::Action(ModelPtr model, double cost, bool failed): - m_cost(cost), p_model(model), m_failed(failed), m_remains(cost), - m_refcount(1), m_priority(1.0), m_maxDuration(NO_MAX_DURATION), - m_start(surf_get_clock()), m_finish(-1.0) + m_priority(1.0), + m_failed(failed), + m_start(surf_get_clock()), m_finish(-1.0), + m_remains(cost), + m_maxDuration(NO_MAX_DURATION), + m_cost(cost), + p_model(model), + m_refcount(1) { #ifdef HAVE_TRACING p_category = NULL; diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index 8f32c8b8e8..6f7a5682fd 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -82,7 +82,7 @@ public: class Onelink { public: Onelink(void *link, RoutingEdgePtr src, RoutingEdgePtr dst) - : p_link(link), p_src(src), p_dst(dst) {}; + : p_src(src), p_dst(dst), p_link(link) {}; RoutingEdgePtr p_src; RoutingEdgePtr p_dst; void *p_link; diff --git a/src/surf/vm_workstation.cpp b/src/surf/vm_workstation.cpp index fe17e16c95..aa743cf9fc 100644 --- a/src/surf/vm_workstation.cpp +++ b/src/surf/vm_workstation.cpp @@ -181,10 +181,10 @@ double WorkstationVMModel::shareResources(double now) WorkstationVM2013Lmm::WorkstationVM2013Lmm(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation) - : WorkstationVM2013(model, name, props, NULL, NULL), - WorkstationCLM03Lmm(model, name, props, NULL, NULL, NULL), + : Resource(model, name, props), WorkstationCLM03(model, name, props, NULL, NULL, NULL), - Resource(model, name, props) { + WorkstationVM2013(model, name, props, NULL, NULL), + WorkstationCLM03Lmm(model, name, props, NULL, NULL, NULL) { WorkstationCLM03Ptr sub_ws = dynamic_cast( static_cast( surf_workstation_resource_priv(ind_phys_workstation))); diff --git a/src/surf/workstation_ptask_L07.cpp b/src/surf/workstation_ptask_L07.cpp index ce302987cd..2b7a591aaf 100644 --- a/src/surf/workstation_ptask_L07.cpp +++ b/src/surf/workstation_ptask_L07.cpp @@ -441,8 +441,8 @@ void WorkstationL07Model::addTraces() WorkstationL07::WorkstationL07(WorkstationModelPtr model, const char* name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu) : Resource(model, name, props), - WorkstationCLM03Lmm(model, name, props, NULL, netElm, cpu), - WorkstationCLM03(model, name, props, NULL, netElm, cpu) + WorkstationCLM03(model, name, props, NULL, netElm, cpu), + WorkstationCLM03Lmm(model, name, props, NULL, netElm, cpu) { }