Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix cxx flag for win build
[simgrid.git] / src / surf / network_constant.cpp
index 13fff27..ce29ef0 100644 (file)
@@ -4,7 +4,7 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 static int host_number_int = 0;
 
-static void netcste_count_hosts(sg_platf_host_cbarg_t h) {
+static void netcste_count_hosts(sg_platf_host_cbarg_t /*h*/) {
   host_number_int++;
 }
 
@@ -20,17 +20,16 @@ void surf_network_model_init_Constant()
 
   ModelPtr model = static_cast<ModelPtr>(surf_network_model);
   xbt_dynar_push(model_list, &model);
-
-  routing_model_create(NULL);
 }
 
-double NetworkConstantModel::shareResources(double now)
+double NetworkConstantModel::shareResources(double /*now*/)
 {
   void *_action = NULL;
   NetworkConstantActionLmmPtr action = NULL;
   double min = -1.0;
 
-  xbt_swag_foreach(_action, p_runningActionSet) {
+  xbt_swag_t actionSet = getRunningActionSet();
+  xbt_swag_foreach(_action, actionSet) {
        action = dynamic_cast<NetworkConstantActionLmmPtr>(static_cast<ActionPtr>(_action));
     if (action->m_latency > 0) {
       if (min < 0)
@@ -43,12 +42,12 @@ double NetworkConstantModel::shareResources(double now)
   return min;
 }
 
-void NetworkConstantModel::updateActionsState(double now, double delta)
+void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
 {
   void *_action, *_next_action;
   NetworkConstantActionLmmPtr action = NULL;
-
-  xbt_swag_foreach_safe(_action, _next_action, p_runningActionSet) {
+  xbt_swag_t actionSet = getRunningActionSet();
+  xbt_swag_foreach_safe(_action, _next_action, actionSet) {
        action = dynamic_cast<NetworkConstantActionLmmPtr>(static_cast<ActionPtr>(_action));
     if (action->m_latency > 0) {
       if (action->m_latency > delta) {
@@ -57,17 +56,16 @@ void NetworkConstantModel::updateActionsState(double now, double delta)
         action->m_latency = 0.0;
       }
     }
-    double_update(&(action->m_remains),
-                  action->m_cost * delta / action->m_latInit);
-    if (action->m_maxDuration != NO_MAX_DURATION)
-      double_update(&(action->m_maxDuration), delta);
+    action->updateRemains(action->getCost() * delta / action->m_latInit);
+    if (action->getMaxDuration() != NO_MAX_DURATION)
+      action->updateMaxDuration(delta);
 
-    if (action->m_remains <= 0) {
-      action->m_finish = surf_get_clock();
+    if (action->getRemains() <= 0) {
+      action->finish();
       action->setState(SURF_ACTION_DONE);
-    } else if ((action->m_maxDuration != NO_MAX_DURATION)
-               && (action->m_maxDuration <= 0)) {
-      action->m_finish = surf_get_clock();
+    } else if ((action->getMaxDuration() != NO_MAX_DURATION)
+               && (action->getMaxDuration() <= 0)) {
+      action->finish();
       action->setState(SURF_ACTION_DONE);
     }
   }
@@ -80,7 +78,7 @@ ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr d
   char *dst_name = dst->p_name;
 
   XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
-  NetworkConstantActionLmmPtr action = new NetworkConstantActionLmm(this, sg_latency_factor);
+  NetworkConstantActionLmmPtr action = new NetworkConstantActionLmm(this, size, sg_latency_factor);
   XBT_OUT();
 
   return action;
@@ -94,8 +92,8 @@ bool NetworkConstantLinkLmm::isUsed()
   return 0;
 }
 
-void NetworkConstantLinkLmm::updateState(tmgr_trace_event_t event_type,
-                                      double value, double time)
+void NetworkConstantLinkLmm::updateState(tmgr_trace_event_t /*event_type*/,
+                                         double /*value*/, double /*time*/)
 {
   DIE_IMPOSSIBLE;
 }
@@ -139,7 +137,7 @@ void NetworkConstantActionLmm::cancel()
 }
 
 #ifdef HAVE_TRACING
-void NetworkConstantActionLmm::setCategory(const char *category)
+void NetworkConstantActionLmm::setCategory(const char */*category*/)
 {
   //ignore completely the categories in constant model, they are not traced
 }