Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In XBT_LOG_NEW_SUBCATEGORY_helper, protect function declaration with SG_{BEGIN,END...
[simgrid.git] / src / surf / surf_routing_floyd.cpp
index 6bd1969..0f2bd28 100644 (file)
@@ -5,11 +5,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "surf_routing_floyd.hpp"
-#include "network.hpp"
+#include "network_interface.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
-}
 
 #define TO_FLOYD_COST(i,j) (p_costTable)[(i)+(j)*table_size]
 #define TO_FLOYD_PRED(i,j) (p_predecessorTable)[(i)+(j)*table_size]
@@ -26,6 +24,9 @@ void model_floyd_end(AS_t current_routing)
 }
 
 AsFloyd::AsFloyd(): AsGeneric() {
+  p_predecessorTable = NULL;
+  p_costTable = NULL;
+  p_linkTable = NULL;
 }
 
 AsFloyd::~AsFloyd(){
@@ -120,7 +121,7 @@ void AsFloyd::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_plat
     xbt_dynar_foreach(links, cpt, link) {
       xbt_dynar_push_as(res->link_list, sg_routing_link_t, link);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(link))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(link))->getLatency();
     }
 
     prev_dst_gw = e_route->gw_dst;