Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
less char*, more std::string
[simgrid.git] / src / kernel / routing / AsFloyd.cpp
index 04b9536..2b5d921 100644 (file)
@@ -53,7 +53,7 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar
   do {
     pred = TO_FLOYD_PRED(src->id(), cur);
     if (pred == -1)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name(), dst->name());
+      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name().c_str(), dst->name().c_str());
     route_stack.push_back(TO_FLOYD_LINK(pred, cur));
     cur = pred;
   } while (cur != src->id());
@@ -67,7 +67,8 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar
   while (!route_stack.empty()) {
     sg_platf_route_cbarg_t e_route = route_stack.back();
     route_stack.pop_back();
-    if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr && strcmp(prev_dst_gw->name(), e_route->gw_src->name())) {
+    if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
+        strcmp(prev_dst_gw->name().c_str(), e_route->gw_src->name().c_str())) {
       routing_platf->getRouteAndLatency(prev_dst_gw, e_route->gw_src, route->link_list, lat);
     }
 
@@ -106,11 +107,13 @@ void AsFloyd::addRoute(sg_platf_route_cbarg_t route)
   /* Check that the route does not already exist */
   if (route->gw_dst) // AS route (to adapt the error message, if any)
     xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
-        "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
-        route->src->name(),route->gw_src->name(),route->dst->name(),route->gw_dst->name());
+               "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
+               route->src->name().c_str(), route->gw_src->name().c_str(), route->dst->name().c_str(),
+               route->gw_dst->name().c_str());
   else
     xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
-        "The route between %s and %s already exists (Rq: routes are symmetrical by default).", route->src->name(),route->dst->name());
+               "The route between %s and %s already exists (Rq: routes are symmetrical by default).",
+               route->src->name().c_str(), route->dst->name().c_str());
 
   TO_FLOYD_LINK(route->src->id(), route->dst->id()) = newExtendedRoute(hierarchy_, route, 1);
   TO_FLOYD_PRED(route->src->id(), route->dst->id()) = route->src->id();
@@ -119,13 +122,15 @@ void AsFloyd::addRoute(sg_platf_route_cbarg_t route)
 
   if (route->symmetrical == true) {
     if (route->gw_dst) // AS route (to adapt the error message, if any)
-      xbt_assert(nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
+      xbt_assert(
+          nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
           "The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
-          route->dst->name(),route->gw_dst->name(),route->src->name(),route->gw_src->name());
+          route->dst->name().c_str(), route->gw_dst->name().c_str(), route->src->name().c_str(),
+          route->gw_src->name().c_str());
     else
       xbt_assert(nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
-          "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
-          route->dst->name(),route->src->name());
+                 "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
+                 route->dst->name().c_str(), route->src->name().c_str());
 
     if(route->gw_dst && route->gw_src) {
       NetCard* gw_tmp = route->gw_src;
@@ -134,10 +139,10 @@ void AsFloyd::addRoute(sg_platf_route_cbarg_t route)
     }
 
     if(!route->gw_src && !route->gw_dst)
-      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name(), route->src->name());
+      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name().c_str(), route->src->name().c_str());
     else
-      XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name(),
-          route->gw_src->name(), route->src->name(), route->gw_dst->name());
+      XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name().c_str(), route->gw_src->name().c_str(),
+                route->src->name().c_str(), route->gw_dst->name().c_str());
 
     TO_FLOYD_LINK(route->dst->id(), route->src->id()) = newExtendedRoute(hierarchy_, route, 0);
     TO_FLOYD_PRED(route->dst->id(), route->src->id()) = route->dst->id();