From: Martin Quinson Date: Thu, 10 Nov 2011 17:05:39 +0000 (+0100) Subject: Kill global_routing->get_route_or_null X-Git-Tag: exp_20120216~329 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/65dc5e18ada92df9d138177c059be127a10810f5?ds=sidebyside Kill global_routing->get_route_or_null It was used at only one location, so I setup a TRY/CATCH in there instead --- diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 5164bfa79c..f63b722bb7 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -110,7 +110,13 @@ static void recursiveGraphExtraction (AS_t rc, container_t container, xbt_dict_t strcmp (child1_name, child2_name) != 0){ xbt_dynar_t route = NULL; - route = global_routing->get_route_or_null (child1_name, child2_name); + xbt_ex_t e; + + TRY { + route = routing_get_route(child1_name, child2_name); + } CATCH(e) { + xbt_ex_free(e); + } if (route == NULL) continue; if (TRACE_onelink_only()){ diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 2963ec9211..5162f6806c 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -169,7 +169,6 @@ struct s_routing_global { AS_t root; void *loopback; size_t size_of_link; - xbt_dynar_t(*get_route_or_null) (const char *src, const char *dst); xbt_dynar_t(*get_route_no_cleanup) (const char *src, const char *dst); xbt_dynar_t(*get_onelink_routes) (void); double (*get_latency) (const char *src, const char *dst); diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index cef283285f..b63579d024 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -620,27 +620,6 @@ xbt_dynar_t routing_get_route(const char *src, const char *dst) { return route; } -/** - * \brief Generic method: find a route between hosts - * - * \param src the source host name - * \param dst the destination host name - * - * same as get_route, but return NULL if any exception is raised. - */ -static xbt_dynar_t get_route_or_null(const char *src, const char *dst) -{ - xbt_dynar_t route = NULL; - xbt_ex_t exception; - TRY { - get_route_latency(src, dst, &route, NULL, 1); - } CATCH(exception) { - xbt_ex_free(exception); - return NULL; - } - return route; -} - /** * \brief Generic method: find a route between hosts * @@ -723,7 +702,6 @@ void routing_model_create(size_t size_of_links, void *loopback) /* config the uniq global routing */ global_routing = xbt_new0(s_routing_global_t, 1); global_routing->root = NULL; - global_routing->get_route_or_null = get_route_or_null; global_routing->get_latency = get_latency; global_routing->get_route_no_cleanup = get_route_no_cleanup; global_routing->get_onelink_routes = get_onelink_routes;