Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
initialize fields at declaration, not everywhere in code
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 15 Dec 2015 21:39:39 +0000 (22:39 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 15 Dec 2015 21:39:39 +0000 (22:39 +0100)
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp

index 2b7c2e3..a8d80c7 100644 (file)
@@ -132,7 +132,8 @@ void CpuModel::updateActionsStateFull(double now, double delta)
 /************
  * Resource *
  ************/
 /************
  * 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)
  , 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);
 
   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);
   if (model->getUpdateMechanism() != UM_UNDEFINED) {
        p_constraintCore = xbt_new(lmm_constraint_t, core);
        p_constraintCoreId = xbt_new(void*, core);
index 590b798..c74e737 100644 (file)
@@ -182,8 +182,8 @@ public:
   double m_speedScale;           /*< Percentage of CPU available according to the trace, in [O,1] */
 
   /* Note (hypervisor): */
   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;
 };
 
 /**********
 };
 
 /**********