From: Martin Quinson Date: Tue, 15 Dec 2015 21:39:39 +0000 (+0100) Subject: initialize fields at declaration, not everywhere in code X-Git-Tag: v3_13~1440 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/00db5795b9e8a06e2aac8d8ec9ea2784ab63542f?ds=sidebyside initialize fields at declaration, not everywhere in code --- diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 2b7c2e321e..a8d80c7106 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -132,7 +132,8 @@ void CpuModel::updateActionsStateFull(double now, double delta) /************ * Resource * ************/ -Cpu::Cpu(){ +Cpu::Cpu() +{ } @@ -143,8 +144,6 @@ Cpu::Cpu(Model *model, const char *name, xbt_dict_t props, , m_core(core) , m_speedPeak(speedPeak) , m_speedScale(speedScale) - , p_constraintCore(NULL) - , p_constraintCoreId(NULL) { } @@ -161,8 +160,6 @@ Cpu::Cpu(Model *model, const char *name, xbt_dict_t props, if (core > 1) xbt_assert(model == surf_cpu_model_pm); - p_constraintCore = NULL; - p_constraintCoreId = NULL; if (model->getUpdateMechanism() != UM_UNDEFINED) { p_constraintCore = xbt_new(lmm_constraint_t, core); p_constraintCoreId = xbt_new(void*, core); diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 590b798519..c74e737bbc 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -182,8 +182,8 @@ public: double m_speedScale; /*< Percentage of CPU available according to the trace, in [O,1] */ /* Note (hypervisor): */ - lmm_constraint_t *p_constraintCore; - void **p_constraintCoreId; + lmm_constraint_t *p_constraintCore=NULL; + void **p_constraintCoreId=NULL; }; /**********