From e706356251849dd3b28d2a78355fc0493cfdb4eb Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 14 Nov 2011 16:42:43 +0100 Subject: [PATCH] tiny cleanups, and add a FIXME --- src/surf/surf_private.h | 3 +-- src/surf/surf_routing_vivaldi.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index f8a74470c4..d911f0af46 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -132,8 +132,7 @@ typedef struct s_as { struct s_as *routing_father; xbt_dict_t routing_sons; - route_t(*get_route) (AS_t as, - const char *src, const char *dst); + route_t(*get_route) (AS_t as, const char *src, const char *dst); double(*get_latency) (AS_t as, const char *src, const char *dst, route_t e_route); diff --git a/src/surf/surf_routing_vivaldi.c b/src/surf/surf_routing_vivaldi.c index bffcb4f89a..014c412922 100644 --- a/src/surf/surf_routing_vivaldi.c +++ b/src/surf/surf_routing_vivaldi.c @@ -26,6 +26,7 @@ static double euclidean_dist_comp(int index, xbt_dynar_t src, xbt_dynar_t dst) { double src_coord, dst_coord; + // FIXME converting from string to float each time we need a coordinate is ... suboptimal src_coord = atof(xbt_dynar_get_as(src, index, char *)); dst_coord = atof(xbt_dynar_get_as(dst, index, char *)); @@ -54,7 +55,7 @@ static double base_vivaldi_get_latency (const char *src, const char *dst) return euclidean_dist / 1000; } -static double vivaldi_get_link_latency (AS_t rc,const char *src, const char *dst, route_t e_route) +static double vivaldi_get_latency (AS_t rc,const char *src, const char *dst, route_t e_route) { if(routing_get_network_element_type(src) == SURF_NETWORK_ELEMENT_AS) { int need_to_clean = e_route?0:1; @@ -73,6 +74,6 @@ AS_t model_vivaldi_create(void) { AS_t new_component = model_rulebased_create(); new_component->get_route = vivaldi_get_route; - new_component->get_latency = vivaldi_get_link_latency; + new_component->get_latency = vivaldi_get_latency; return new_component; } -- 2.20.1