Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless length modifier 'l' in %l[efg] for printf.
[simgrid.git] / src / surf / surf_interface.cpp
index 4378973..4b1889a 100644 (file)
@@ -558,14 +558,14 @@ double Model::shareResourcesLazy(double now)
       max_dur_flag = 1;
     }
 
-    XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
+    XBT_DEBUG("Action(%p) Start %f Finish %f Max_duration %f", action,
         action->getStartTime(), now + value,
         action->getMaxDuration());
 
     if (min != -1) {
       action->heapRemove(p_actionHeap);
       action->heapInsert(p_actionHeap, min, max_dur_flag ? MAX_DURATION : NORMAL);
-      XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min,
+      XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min,
                 now);
     } else DIE_IMPOSSIBLE;
   }
@@ -576,7 +576,7 @@ double Model::shareResourcesLazy(double now)
   else
     min = -1;
 
-  XBT_DEBUG("The minimum with the HEAP %lf", min);
+  XBT_DEBUG("The minimum with the HEAP %f", min);
 
   return min;
 }
@@ -666,17 +666,17 @@ Resource::Resource()
 : p_name(NULL), p_properties(NULL), p_model(NULL)
 {}
 
-Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props)
+Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props)
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(SURF_RESOURCE_ON)
 {}
 
-Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
+Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(SURF_RESOURCE_ON), p_constraint(constraint)
 {}
 
-Resource::Resource(surf_model_t model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
+Resource::Resource(ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
   : p_name(xbt_strdup(name)), p_properties(props), p_model(model)
   , m_running(true), m_stateCurrent(stateInit)
 {}
@@ -724,6 +724,8 @@ const char *Resource::getName() {
 }
 
 xbt_dict_t Resource::getProperties() {
+  if (p_properties==NULL)
+       p_properties = xbt_dict_new();
   return p_properties;
 }