From 41a0af5d6003337f4ca3b3aed6f5757293bddab5 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 18 Jul 2006 13:06:29 +0000 Subject: [PATCH] Another try at cleaning up the function types git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2614 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/surf/surfxml_parse.h | 30 +++++++++++++++--------------- include/xbt/function_types.h | 11 +++++------ include/xbt/graphxml_parse.h | 14 +++++++------- src/gras/Msg/msg_private.h | 2 +- src/gras/Msg/timer.c | 2 +- src/surf/surfxml_parse.c | 30 +++++++++++++++--------------- src/xbt/graphxml_parse.c | 14 +++++++------- 7 files changed, 51 insertions(+), 52 deletions(-) diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index f9faf084f6..4ea23b9b6c 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -12,25 +12,25 @@ #include "xbt/sysdep.h" /* to have FILE */ #include "xbt/function_types.h" /* Entry-point of the surfxml parser. */ -extern int_f_void_t surf_parse; +extern int_f_void_t *surf_parse; /* Hook for the different tags. They can be redefined at will whereas the versions without the _fun can't. */ -extern void_f_void_t STag_surfxml_platform_description_fun; -extern void_f_void_t ETag_surfxml_platform_description_fun; -extern void_f_void_t STag_surfxml_cpu_fun; -extern void_f_void_t ETag_surfxml_cpu_fun; -extern void_f_void_t STag_surfxml_network_link_fun; -extern void_f_void_t ETag_surfxml_network_link_fun; -extern void_f_void_t STag_surfxml_route_fun; -extern void_f_void_t ETag_surfxml_route_fun; -extern void_f_void_t STag_surfxml_route_element_fun; -extern void_f_void_t ETag_surfxml_route_element_fun; -extern void_f_void_t STag_surfxml_process_fun; -extern void_f_void_t ETag_surfxml_process_fun; -extern void_f_void_t STag_surfxml_argument_fun; -extern void_f_void_t ETag_surfxml_argument_fun; +extern void_f_void_t *STag_surfxml_platform_description_fun; +extern void_f_void_t *ETag_surfxml_platform_description_fun; +extern void_f_void_t *STag_surfxml_cpu_fun; +extern void_f_void_t *ETag_surfxml_cpu_fun; +extern void_f_void_t *STag_surfxml_network_link_fun; +extern void_f_void_t *ETag_surfxml_network_link_fun; +extern void_f_void_t *STag_surfxml_route_fun; +extern void_f_void_t *ETag_surfxml_route_fun; +extern void_f_void_t *STag_surfxml_route_element_fun; +extern void_f_void_t *ETag_surfxml_route_element_fun; +extern void_f_void_t *STag_surfxml_process_fun; +extern void_f_void_t *ETag_surfxml_process_fun; +extern void_f_void_t *STag_surfxml_argument_fun; +extern void_f_void_t *ETag_surfxml_argument_fun; void surf_parse_open(const char *file); void surf_parse_close(void); diff --git a/include/xbt/function_types.h b/include/xbt/function_types.h index a632b5af9c..7e476a7463 100644 --- a/include/xbt/function_types.h +++ b/include/xbt/function_types.h @@ -16,16 +16,15 @@ SG_BEGIN_DECL() - typedef void (void_f_ppvoid_t)(void**); - typedef void (void_f_pvoid_t) (void*); + typedef void (void_f_ppvoid_t)(void**); + typedef void (void_f_pvoid_t) (void*); typedef void* (pvoid_f_void_t)(void); typedef void* (pvoid_f_pvoid_t)(void*); -// typedef void (void_f_void_t) (void); + typedef void (void_f_void_t) (void); + + typedef int (int_f_void_t) (void); typedef int (int_f_pvoid_pvoid_t) (void*,void*); - - typedef void (*void_pf_void_t) (void); - typedef int (*int_pf_void_t) (void); SG_END_DECL() diff --git a/include/xbt/graphxml_parse.h b/include/xbt/graphxml_parse.h index 81a98fd288..2c26c35c18 100644 --- a/include/xbt/graphxml_parse.h +++ b/include/xbt/graphxml_parse.h @@ -13,16 +13,16 @@ #include "xbt/graphxml.h" /* Entry-point of the graphxml parser. */ -extern int_pf_void_t xbt_graph_parse; +extern int_f_void_t *xbt_graph_parse; /* Hook for the different tags. They can be redefined at will whereas the versions without the _fun can't. */ -extern void_pf_void_t STag_graphxml_graph_fun; -extern void_pf_void_t ETag_graphxml_graph_fun; -extern void_pf_void_t STag_graphxml_node_fun; -extern void_pf_void_t ETag_graphxml_node_fun; -extern void_pf_void_t STag_graphxml_edge_fun; -extern void_pf_void_t ETag_graphxml_edge_fun; +extern void_f_void_t *STag_graphxml_graph_fun; +extern void_f_void_t *ETag_graphxml_graph_fun; +extern void_f_void_t *STag_graphxml_node_fun; +extern void_f_void_t *ETag_graphxml_node_fun; +extern void_f_void_t *STag_graphxml_edge_fun; +extern void_f_void_t *ETag_graphxml_edge_fun; void xbt_graph_parse_open(const char *file); void xbt_graph_parse_close(void); diff --git a/src/gras/Msg/msg_private.h b/src/gras/Msg/msg_private.h index 54511b788a..cb421671f7 100644 --- a/src/gras/Msg/msg_private.h +++ b/src/gras/Msg/msg_private.h @@ -106,7 +106,7 @@ typedef struct s_gras_msg_cb_ctx s_gras_msg_cb_ctx_t; typedef struct { double expiry; double period; - void_f_void_t action; + void_f_void_t *action; int repeat; } s_gras_timer_t, *gras_timer_t; diff --git a/src/gras/Msg/timer.c b/src/gras/Msg/timer.c index 63b6ce0d65..616250284a 100644 --- a/src/gras/Msg/timer.c +++ b/src/gras/Msg/timer.c @@ -150,7 +150,7 @@ double gras_msg_timer_handle(void) { DEBUG2("Action %p expires in %f", timer->action, untilthis); if (untilthis <= 0.0) { - void_f_void_t action = timer->action; + void_f_void_t *action = timer->action; DEBUG5("[%.0f] Serve %s action %p (%f<%f)",gras_os_time(), timer->repeat ? "repetitive" : "delayed", timer->action, diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 4ec4445db3..785a41d24e 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -23,20 +23,20 @@ void nil_function(void) return; } -void_f_void_t STag_surfxml_platform_description_fun = nil_function; -void_f_void_t ETag_surfxml_platform_description_fun = nil_function; -void_f_void_t STag_surfxml_cpu_fun = nil_function; -void_f_void_t ETag_surfxml_cpu_fun = nil_function; -void_f_void_t STag_surfxml_network_link_fun = nil_function; -void_f_void_t ETag_surfxml_network_link_fun = nil_function; -void_f_void_t STag_surfxml_route_fun = nil_function; -void_f_void_t ETag_surfxml_route_fun = nil_function; -void_f_void_t STag_surfxml_route_element_fun = nil_function; -void_f_void_t ETag_surfxml_route_element_fun = nil_function; -void_f_void_t STag_surfxml_process_fun = nil_function; -void_f_void_t ETag_surfxml_process_fun = nil_function; -void_f_void_t STag_surfxml_argument_fun = nil_function; -void_f_void_t ETag_surfxml_argument_fun = nil_function; +void_f_void_t *STag_surfxml_platform_description_fun = nil_function; +void_f_void_t *ETag_surfxml_platform_description_fun = nil_function; +void_f_void_t *STag_surfxml_cpu_fun = nil_function; +void_f_void_t *ETag_surfxml_cpu_fun = nil_function; +void_f_void_t *STag_surfxml_network_link_fun = nil_function; +void_f_void_t *ETag_surfxml_network_link_fun = nil_function; +void_f_void_t *STag_surfxml_route_fun = nil_function; +void_f_void_t *ETag_surfxml_route_fun = nil_function; +void_f_void_t *STag_surfxml_route_element_fun = nil_function; +void_f_void_t *ETag_surfxml_route_element_fun = nil_function; +void_f_void_t *STag_surfxml_process_fun = nil_function; +void_f_void_t *ETag_surfxml_process_fun = nil_function; +void_f_void_t *STag_surfxml_argument_fun = nil_function; +void_f_void_t *ETag_surfxml_argument_fun = nil_function; YY_BUFFER_STATE surf_input_buffer; FILE *surf_file_to_parse; @@ -202,7 +202,7 @@ static int _surf_parse(void) return surf_parse_lex(); } -int_f_void_t surf_parse = _surf_parse; +int_f_void_t *surf_parse = _surf_parse; void surf_parse_get_double(double *value,const char *string) { diff --git a/src/xbt/graphxml_parse.c b/src/xbt/graphxml_parse.c index 1c9a31c332..98fe312d33 100644 --- a/src/xbt/graphxml_parse.c +++ b/src/xbt/graphxml_parse.c @@ -26,12 +26,12 @@ static void nil_function(void) return; } -void_pf_void_t STag_graphxml_graph_fun = nil_function; -void_pf_void_t ETag_graphxml_graph_fun = nil_function; -void_pf_void_t STag_graphxml_node_fun = nil_function; -void_pf_void_t ETag_graphxml_node_fun = nil_function; -void_pf_void_t STag_graphxml_edge_fun = nil_function; -void_pf_void_t ETag_graphxml_edge_fun = nil_function; +void_f_void_t *STag_graphxml_graph_fun = nil_function; +void_f_void_t *ETag_graphxml_graph_fun = nil_function; +void_f_void_t *STag_graphxml_node_fun = nil_function; +void_f_void_t *ETag_graphxml_node_fun = nil_function; +void_f_void_t *STag_graphxml_edge_fun = nil_function; +void_f_void_t *ETag_graphxml_edge_fun = nil_function; YY_BUFFER_STATE xbt_graph_input_buffer; FILE *xbt_graph_file_to_parse; @@ -115,7 +115,7 @@ static int _xbt_graph_parse(void) return xbt_graph_parse_lex(); } -int_pf_void_t xbt_graph_parse = _xbt_graph_parse; +int_f_void_t *xbt_graph_parse = _xbt_graph_parse; void xbt_graph_parse_get_double(double *value,const char *string) { -- 2.20.1