X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/04b62daf10d4a89e8a74ec793403183009da153b..688697437ee29632f93998b1d41fcc0f8cb9faee:/src/surf/workstation_KCCFLN05.c diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index 1c3288c74a..c91ad04542 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -560,19 +560,18 @@ static surf_action_t execute_parallel_task(int cpu_nb, return NULL; } -static void* get_route(void *src, void *dst) { - /* TODO: return a NULL-terminated array of network_link_KCCFLN05_t */ - +/* returns a NULL-terminated array of network_link_KCCFLN05_t */ +static const void** get_route(void *src, void *dst) { cpu_KCCFLN05_t card_src = src; cpu_KCCFLN05_t card_dst = dst; route_KCCFLN05_t route = &(ROUTE(card_src->id, card_dst->id)); int route_size = route->size; - network_link_KCCFLN05_t *link_list = route->links; - link_list = xbt_realloc(link_list, (route_size+1) * sizeof(route_KCCFLN05_t)); - link_list[route_size] = NULL; + /* add NULL at the end of the array if not present */ + route->links = xbt_realloc(route->links, (route_size+1) * sizeof(route_KCCFLN05_t)); + route->links[route_size] = NULL; - return link_list; + return (const void**) route->links; } /**************************************/