From db76b8c2bb3acf20452613ccac46a9bee673f1b6 Mon Sep 17 00:00:00 2001 From: alegrand Date: Wed, 1 Dec 2010 15:52:11 +0000 Subject: [PATCH] Use a cleaner function type for get_link_latency functions. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8818 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/function_types.h | 1 + src/surf/network.c | 2 +- src/surf/network_constant.c | 2 +- src/surf/network_gtnets.c | 2 +- src/surf/network_vivaldi.c | 2 +- src/surf/surf_private.h | 2 +- src/surf/surf_routing.c | 4 ++-- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/xbt/function_types.h b/include/xbt/function_types.h index 0780a02679..d140c97767 100644 --- a/include/xbt/function_types.h +++ b/include/xbt/function_types.h @@ -28,6 +28,7 @@ typedef int (*int_f_cpvoid_cpvoid_t) (const void *, const void *); typedef int (*xbt_main_func_t) (int argc, char *argv[]); typedef double(*double_f_pvoid_t) (void *); +typedef double(*double_f_cpvoid_t) (const void *); SG_END_DECL() #endif /* XBT_FUNCTION_TYPE_H */ diff --git a/src/surf/network.c b/src/surf/network.c index 30792cfc24..3d448f58fb 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -774,7 +774,7 @@ static void surf_network_model_init_internal(void) 498000000, NULL, 0.000015, NULL, SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE, NULL), - (double_f_pvoid_t)net_get_link_latency); + net_get_link_latency); } diff --git a/src/surf/network_constant.c b/src/surf/network_constant.c index b76ff47863..bf73baff10 100644 --- a/src/surf/network_constant.c +++ b/src/surf/network_constant.c @@ -230,5 +230,5 @@ void surf_network_model_init_Constant(const char *filename) "Constant", surf_network_model); xbt_cfg_set_string(_surf_cfg_set, "routing", "none"); - routing_model_create(sizeof(double), NULL, (double_f_pvoid_t)netcste_get_link_latency); + routing_model_create(sizeof(double), NULL, netcste_get_link_latency); } diff --git a/src/surf/network_gtnets.c b/src/surf/network_gtnets.c index a33cb21789..42f77ee766 100644 --- a/src/surf/network_gtnets.c +++ b/src/surf/network_gtnets.c @@ -424,7 +424,7 @@ static void surf_network_model_init_internal(void) xbt_assert0(0, "Impossible to initialize GTNetS interface"); } - routing_model_create(sizeof(network_link_GTNETS_t), NULL); + routing_model_create(sizeof(network_link_GTNETS_t), NULL, NULL); } #ifdef HAVE_LATENCY_BOUND_TRACKING diff --git a/src/surf/network_vivaldi.c b/src/surf/network_vivaldi.c index 085b701c84..83c80a1731 100644 --- a/src/surf/network_vivaldi.c +++ b/src/surf/network_vivaldi.c @@ -292,5 +292,5 @@ void surf_network_model_init_Vivaldi(const char *filename) #endif xbt_cfg_set_string(_surf_cfg_set, "routing", "none"); - routing_model_create(sizeof(double), NULL, (double_f_pvoid_t)netviva_get_link_latency); + routing_model_create(sizeof(double), NULL, netviva_get_link_latency); } diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index fe5fbc443d..77d50344c0 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -197,7 +197,7 @@ struct s_routing_global { xbt_dynar_t last_route; }; -XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback, double_f_pvoid_t get_link_latency_fun); +XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback, double_f_cpvoid_t get_link_latency_fun); /** * Resource protected methods diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 6759694a24..eab5f6d397 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -25,7 +25,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf"); routing_global_t global_routing = NULL; routing_component_t current_routing = NULL; model_type_t current_routing_model = NULL; -static double_f_pvoid_t get_link_latency = NULL; +static double_f_cpvoid_t get_link_latency = NULL; /* Prototypes of each model */ static void *model_full_create(void); /* create structures for full routing model */ @@ -998,7 +998,7 @@ static e_surf_network_element_type_t get_network_element_type(const char * * Make a global routing structure and set all the parsing functions. */ -void routing_model_create(size_t size_of_links, void *loopback, double_f_pvoid_t get_link_latency_fun ) +void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_t get_link_latency_fun) { /* config the uniq global routing */ -- 2.20.1