Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give a default value at field declaration, not everywhere in subclasses
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 25 Dec 2015 21:14:25 +0000 (22:14 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 25 Dec 2015 21:51:10 +0000 (22:51 +0100)
src/surf/cpu_cas01.cpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/host_ptask_L07.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp

index 014f9da..46bec97 100644 (file)
@@ -317,7 +317,6 @@ CpuCas01Action::CpuCas01Action(Model *model, double cost, bool failed, double sp
                     lmm_variable_new(model->getMaxminSystem(), this,
                     1.0, speed, 1))
 {
-  m_suspended = 0;
   if (model->getUpdateMechanism() == UM_LAZY) {
     m_indexHeap = -1;
     m_lastUpdate = surf_get_clock();
index 6ea0152..6f77ebf 100644 (file)
@@ -858,8 +858,6 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed,
                                 CpuTi *cpu)
  : CpuAction(model_, cost, failed)
 {
-  m_suspended = 0;        /* Should be useless because of the
-                                calloc but it seems to help valgrind... */
   p_cpu = cpu;
   m_indexHeap = -1;
   p_cpu->modified(true);
index 06b10df..9d6d922 100644 (file)
@@ -99,7 +99,7 @@ public:
 
   CpuTi *p_cpu;
   int m_indexHeap;
-  int m_suspended;
+  int m_suspended = 0;
 public:
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
index 216dfcb..1f8a487 100644 (file)
@@ -228,7 +228,6 @@ Action *HostL07Model::executeParallelTask(int host_nb,
 
   XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
          action, host_nb, nb_link);
-  action->m_suspended = 0; /* valgrind seems to want it despite the calloc... */
   action->p_computationAmount = flops_amount;
   action->p_communicationAmount = bytes_amount;
   action->m_latency = latency;
index 695653f..5abc5ca 100644 (file)
@@ -699,7 +699,6 @@ void Action::initialize(simgrid::surf::Model *model, double cost, bool failed,
   p_variable = var;
   m_lastValue = 0;
   m_lastUpdate = 0;
-  m_suspended = false;
   m_hat = NOTSET;
   p_category = NULL;
   p_stateHookup.prev = 0;
index 0c16aaf..0d322d8 100644 (file)
@@ -292,7 +292,7 @@ protected:
   lmm_variable_t p_variable;
   double m_lastValue;
   double m_lastUpdate;
-  int m_suspended;
+  int m_suspended = 0;
   int m_indexHeap;
   enum heap_action_type m_hat;
 };