From: mquinson Date: Thu, 4 Oct 2007 13:07:35 +0000 (+0000) Subject: Gcc is *very* permissive with pointers to functions. If we declare them as function... X-Git-Tag: v3.3~1008 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0446fc9e3f379b9aff5e0bb44cf06d06b9e663cc Gcc is *very* permissive with pointers to functions. If we declare them as function, it understands that we meant pointer to functions. If we try to call a pointer to function, it understand we want to dereference that pointer before the call. Visual C++ is not that cleaver (what a surprise). So, try to sanitize a bit the situation by doing the Right Thing without expecting the compiler to understand what we really meant in the middle of what we said. (sorry for the huge diff) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4783 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/gras/datadesc.h b/include/gras/datadesc.h index a3c27d2698..f19da0a69b 100644 --- a/include/gras/datadesc.h +++ b/include/gras/datadesc.h @@ -368,10 +368,10 @@ XBT_PUBLIC(gras_datadesc_type_t) XBT_PUBLIC(gras_datadesc_type_t) gras_datadesc_dynar(gras_datadesc_type_t elm_t, - void_f_pvoid_t *free_func); + void_f_pvoid_t free_func); XBT_PUBLIC(gras_datadesc_type_t) gras_datadesc_matrix(gras_datadesc_type_t elm_t, - void_f_pvoid_t * const free_f); + void_f_pvoid_t const free_f); /********************************* * Change stuff within datadescs * diff --git a/include/gras/module.h b/include/gras/module.h index 63f8195f96..3e45c9bddf 100644 --- a/include/gras/module.h +++ b/include/gras/module.h @@ -11,8 +11,8 @@ XBT_PUBLIC(void) gras_module_leave(const char *name); /* Functions module implementor should use */ XBT_PUBLIC(void) gras_module_add(const char *name, unsigned int data_size, int *ID, - void_f_void_t *init_f, void_f_void_t *exit_f, - void_f_pvoid_t *join_f, void_f_pvoid_t *leave_f) ; + void_f_void_t init_f, void_f_void_t exit_f, + void_f_pvoid_t join_f, void_f_pvoid_t leave_f) ; XBT_PUBLIC(void*)gras_moddata_by_id(unsigned int ID); diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index 8d19128c52..a219d2fed0 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -12,27 +12,27 @@ #include "surf/surfxml.h" #include "xbt/function_types.h" /* Entry-point of the surfxml parser. */ -XBT_PUBLIC_DATA(int_f_void_t *) surf_parse; +XBT_PUBLIC_DATA(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. */ -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_platform_description_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_platform_description_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_cpu_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_cpu_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_router_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_router_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_network_link_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_network_link_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_route_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_route_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_route_element_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_route_element_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_process_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_process_fun; -XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_argument_fun; -XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_argument_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_platform_description_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_platform_description_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_cpu_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_cpu_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_router_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_router_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_network_link_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_network_link_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_route_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_route_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_route_element_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_route_element_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_process_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_process_fun; +XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_argument_fun; +XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_argument_fun; XBT_PUBLIC(void) surf_parse_open(const char *file); XBT_PUBLIC(void) surf_parse_close(void); diff --git a/include/xbt/dict.h b/include/xbt/dict.h index dd4de16526..c7d4430a60 100644 --- a/include/xbt/dict.h +++ b/include/xbt/dict.h @@ -58,7 +58,7 @@ SG_BEGIN_DECL() * @{ */ - XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t *free_ctn); + XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t free_ctn); XBT_PUBLIC(void*) xbt_dict_get(xbt_dict_t dict,const char *key); XBT_PUBLIC(void*) xbt_dict_get_or_null(xbt_dict_t dict, const char *key); @@ -78,7 +78,7 @@ SG_BEGIN_DECL() XBT_PUBLIC(void) xbt_dict_set_ext(xbt_dict_t dict, const char *key, int key_len, void *data, - void_f_pvoid_t *free_ctn); + void_f_pvoid_t free_ctn); XBT_PUBLIC(void*) xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len); XBT_PUBLIC(void) xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len); @@ -157,7 +157,7 @@ xbt_multidict_set(xbt_dict_t mdict, XBT_PUBLIC(void) xbt_multidict_set_ext(xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens, - void *data,void_f_pvoid_t *free_ctn); + void *data,void_f_pvoid_t free_ctn); /*----[ xbt_multidict_get ]--------------------------------------------------*/ XBT_PUBLIC(void*) xbt_multidict_get (xbt_dict_t mdict, xbt_dynar_t keys); diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index d0e2df2466..5bb68dcc1b 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -63,9 +63,9 @@ SG_BEGIN_DECL() XBT_PUBLIC(xbt_dynar_t) xbt_dynar_new(const unsigned long elm_size, - void_f_pvoid_t * const free_f); + void_f_pvoid_t const free_f); XBT_PUBLIC(xbt_dynar_t) xbt_dynar_new_sync(const unsigned long elm_size, - void_f_pvoid_t * const free_f); + void_f_pvoid_t const free_f); XBT_PUBLIC(void) xbt_dynar_free(xbt_dynar_t *dynar); XBT_PUBLIC(void) xbt_dynar_free_voidp(void *dynar); XBT_PUBLIC(void) xbt_dynar_free_container(xbt_dynar_t *dynar); @@ -104,7 +104,7 @@ SG_BEGIN_DECL() XBT_PUBLIC(void) xbt_dynar_pop (xbt_dynar_t const dynar, void *const dst); XBT_PUBLIC(void) xbt_dynar_unshift (xbt_dynar_t const dynar, const void *src); XBT_PUBLIC(void) xbt_dynar_shift (xbt_dynar_t const dynar, void *const dst); - XBT_PUBLIC(void) xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t * const op); + XBT_PUBLIC(void) xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t const op); /** @} */ /** @defgroup XBT_dynar_ctn Direct manipulation to the dynars content diff --git a/include/xbt/function_types.h b/include/xbt/function_types.h index c12ca70e07..a5044bdaba 100644 --- a/include/xbt/function_types.h +++ b/include/xbt/function_types.h @@ -16,20 +16,18 @@ SG_BEGIN_DECL() - 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_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 int (int_f_void_t) (void); + typedef int (*int_f_void_t) (void); - typedef int (int_f_pvoid_pvoid_t) (void*,void*); + typedef int (*int_f_pvoid_pvoid_t) (void*,void*); typedef int (*xbt_main_func_t)(int argc, char *argv[]); - typedef void* (*pvoid_pf_void_t)(void); - typedef void (*void_fp_pvoid_t)(void*); SG_END_DECL() #endif /* XBT_FUNCTION_TYPE_H */ diff --git a/include/xbt/graph.h b/include/xbt/graph.h index 534472df26..399bc210d1 100644 --- a/include/xbt/graph.h +++ b/include/xbt/graph.h @@ -39,13 +39,13 @@ XBT_PUBLIC(double) xbt_graph_edge_get_length(xbt_edge_t e); XBT_PUBLIC(double*) xbt_graph_get_length_matrix(xbt_graph_t g); XBT_PUBLIC(void) xbt_graph_free_node(xbt_graph_t g, xbt_node_t n, - void_f_pvoid_t *node_free_function , void_f_pvoid_t *edge_free_function); + void_f_pvoid_t node_free_function , void_f_pvoid_t edge_free_function); XBT_PUBLIC(void) xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e, - void_f_pvoid_t *free_function); + void_f_pvoid_t free_function); XBT_PUBLIC(void) xbt_graph_free_graph(xbt_graph_t g, - void_f_pvoid_t *node_free_function, - void_f_pvoid_t *edge_free_function, - void_f_pvoid_t *graph_free_function); + void_f_pvoid_t node_free_function, + void_f_pvoid_t edge_free_function, + void_f_pvoid_t graph_free_function); XBT_PUBLIC(int) __xbt_find_in_dynar(xbt_dynar_t dynar, void *p); diff --git a/include/xbt/graphxml_parse.h b/include/xbt/graphxml_parse.h index 6dc6123ee6..bce68a7102 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_f_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_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; +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; XBT_PUBLIC(void) xbt_graph_parse_open(const char *file); XBT_PUBLIC(void) xbt_graph_parse_close(void); diff --git a/include/xbt/heap.h b/include/xbt/heap.h index 8a21d6cf9b..99b4d7b948 100644 --- a/include/xbt/heap.h +++ b/include/xbt/heap.h @@ -19,7 +19,7 @@ /* @brief heap datatype */ typedef struct xbt_heap *xbt_heap_t; -XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int num, void_f_pvoid_t * const free_func); +XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int num, void_f_pvoid_t const free_func); XBT_PUBLIC(void) xbt_heap_free(xbt_heap_t H); XBT_PUBLIC(int) xbt_heap_size(xbt_heap_t H); diff --git a/include/xbt/matrix.h b/include/xbt/matrix.h index d750c1e0e0..9a4742ab50 100644 --- a/include/xbt/matrix.h +++ b/include/xbt/matrix.h @@ -20,7 +20,7 @@ typedef struct { unsigned long elmsize; char *data; - void_f_pvoid_t *free_f; + void_f_pvoid_t free_f; } s_xbt_matrix_t, *xbt_matrix_t; @@ -35,11 +35,11 @@ typedef struct { XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new(int lines, int rows, const unsigned long elmsize, - void_f_pvoid_t * const free_f); + void_f_pvoid_t const free_f); XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new_sub(xbt_matrix_t from, int lsize, int rsize, int lpos, int rpos, - pvoid_f_pvoid_t *const cpy_f); + pvoid_f_pvoid_t const cpy_f); XBT_PUBLIC(void) xbt_matrix_free(xbt_matrix_t matrix); XBT_PUBLIC(void) xbt_matrix_free_voidp(void *d); @@ -48,7 +48,7 @@ XBT_PUBLIC(void) xbt_matrix_copy_values(xbt_matrix_t dest, xbt_matrix_t src, int lsize, int rsize, int lpos_dst,int rpos_dst, int lpos_src,int rpos_src, - pvoid_f_pvoid_t *const cpy_f); + pvoid_f_pvoid_t const cpy_f); XBT_PUBLIC(void) xbt_matrix_dump(xbt_matrix_t matrix, const char *name, int coords, void_f_pvoid_t display_fun); diff --git a/include/xbt/set.h b/include/xbt/set.h index 8f7b0cfc1f..0d79c101c5 100644 --- a/include/xbt/set.h +++ b/include/xbt/set.h @@ -77,7 +77,7 @@ XBT_PUBLIC(void) xbt_set_free(xbt_set_t *set); * @{ */ -XBT_PUBLIC(void) xbt_set_add (xbt_set_t set, xbt_set_elm_t elm, void_f_pvoid_t *free_func); +XBT_PUBLIC(void) xbt_set_add (xbt_set_t set, xbt_set_elm_t elm, void_f_pvoid_t free_func); XBT_PUBLIC(void) xbt_set_remove (xbt_set_t set, xbt_set_elm_t elm); XBT_PUBLIC(void) xbt_set_remove_by_name (xbt_set_t set, const char *key); XBT_PUBLIC(void) xbt_set_remove_by_name_ext (xbt_set_t set, const char *key, int key_len); diff --git a/include/xbt/synchro.h b/include/xbt/synchro.h index 265f5b8a66..333df9562f 100644 --- a/include/xbt/synchro.h +++ b/include/xbt/synchro.h @@ -32,7 +32,7 @@ SG_BEGIN_DECL() /** \brief Thread data type (opaque structure) */ typedef struct s_xbt_thread_ *xbt_thread_t; - XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_fp_pvoid_t start_routine,void* param); + XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_f_pvoid_t start_routine,void* param); XBT_PUBLIC(void) xbt_thread_exit(); XBT_PUBLIC(xbt_thread_t) xbt_thread_self(void); XBT_PUBLIC(const char*) xbt_thread_name(xbt_thread_t t); diff --git a/include/xbt/virtu.h b/include/xbt/virtu.h index e5e12c4b4d..d1a0fecc68 100644 --- a/include/xbt/virtu.h +++ b/include/xbt/virtu.h @@ -18,7 +18,7 @@ SG_BEGIN_DECL() /* Get the PID of the current process */ - XBT_PUBLIC_DATA(int_f_void_t*) xbt_getpid; + XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid; SG_END_DECL() diff --git a/src/gras/DataDesc/ddt_create.c b/src/gras/DataDesc/ddt_create.c index ee432e195b..446a3a9487 100644 --- a/src/gras/DataDesc/ddt_create.c +++ b/src/gras/DataDesc/ddt_create.c @@ -643,7 +643,7 @@ static void gras_datadesc_dynar_cb(gras_datadesc_type_t typedesc, gras_cbps_t va */ gras_datadesc_type_t gras_datadesc_dynar(gras_datadesc_type_t elm_t, - void_f_pvoid_t *free_func) { + void_f_pvoid_t free_func) { char *buffname; gras_datadesc_type_t res; @@ -704,7 +704,7 @@ static void gras_datadesc_matrix_cb(gras_datadesc_type_t typedesc, gras_cbps_t v } gras_datadesc_type_t gras_datadesc_matrix(gras_datadesc_type_t elm_t, - void_f_pvoid_t * const free_f) { + void_f_pvoid_t const free_f) { char *buffname; gras_datadesc_type_t res; diff --git a/src/gras/DataDesc/ddt_parse.c b/src/gras/DataDesc/ddt_parse.c index e06a297001..3d5dd399ee 100644 --- a/src/gras/DataDesc/ddt_parse.c +++ b/src/gras/DataDesc/ddt_parse.c @@ -198,7 +198,7 @@ static void change_to_matrix_of(xbt_dynar_t dynar,gras_datadesc_type_t subtype) XBT_OUT; } -static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t* free_f) { +static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t free_f) { s_identifier_t former,ref; memset(&ref,0,sizeof(ref)); @@ -474,10 +474,10 @@ static void parse_statement(char *definition, if (!storage) PARSE_ERROR1("value for free_f annotation of field %s is not a known constant",identifier.name); if (identifier.tm.is_matrix == -1) { - add_free_f(identifiers,*(void_f_pvoid_t**)storage); + add_free_f(identifiers,*(void_f_pvoid_t*)storage); identifier.tm.is_matrix = 0; } else if (identifier.tm.is_dynar == -1) { - add_free_f(identifiers,*(void_f_pvoid_t**)storage); + add_free_f(identifiers,*(void_f_pvoid_t*)storage); identifier.tm.is_dynar = 0; } else { PARSE_ERROR1("free_f annotation only accepted for dynars and matrices which subtype is already declared (field %s)", diff --git a/src/gras/Msg/msg_private.h b/src/gras/Msg/msg_private.h index 07c142529f..0bc3c5cc8d 100644 --- a/src/gras/Msg/msg_private.h +++ b/src/gras/Msg/msg_private.h @@ -115,7 +115,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 616250284a..0c6aa5b755 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, @@ -165,7 +165,7 @@ double gras_msg_timer_handle(void) { DEBUG2("[%.0f] Remove %p now that it's done", gras_os_time(), timer->action); xbt_dynar_cursor_rm(pd->timers, &cursor); } - action(); + (*action)(); return 0.0; } else if (untilthis < untilnext || untilnext == -1) { untilnext = untilthis; diff --git a/src/gras/Virtu/gras_module.c b/src/gras/Virtu/gras_module.c index 7f426c3160..8969f5eac1 100644 --- a/src/gras/Virtu/gras_module.c +++ b/src/gras/Virtu/gras_module.c @@ -75,10 +75,10 @@ typedef struct s_gras_module { loading/unloading */ int *p_id; /* where the module stores the libdata ID (a global somewhere), to tweak it on need */ - void_f_void_t *init_f; /* First time the module is referenced. */ - void_f_void_t *exit_f; /* When last process referencing it stops doing so. */ - void_f_pvoid_t *join_f; /* Called by each process in initialization phase (init_f called once for all processes) */ - void_f_pvoid_t *leave_f; /* Called by each process in finalization phase. Should free moddata passed */ + void_f_void_t init_f; /* First time the module is referenced. */ + void_f_void_t exit_f; /* When last process referencing it stops doing so. */ + void_f_pvoid_t join_f; /* Called by each process in initialization phase (init_f called once for all processes) */ + void_f_pvoid_t leave_f; /* Called by each process in finalization phase. Should free moddata passed */ } s_gras_module_t, *gras_module_t; static xbt_set_t _gras_modules = NULL; /* content: s_gras_module_t */ @@ -106,8 +106,8 @@ static void gras_module_freep(void *p) { */ void gras_module_add(const char *name, unsigned int datasize, int *ID, - void_f_void_t *init_f, void_f_void_t *exit_f, - void_f_pvoid_t *join_f, void_f_pvoid_t *leave_f) { + void_f_void_t init_f, void_f_void_t exit_f, + void_f_pvoid_t join_f, void_f_pvoid_t leave_f) { gras_module_t mod=NULL; xbt_ex_t e; volatile int found = 0; diff --git a/src/gras/Virtu/process.c b/src/gras/Virtu/process.c index 8daf4b7778..b87a118e42 100644 --- a/src/gras/Virtu/process.c +++ b/src/gras/Virtu/process.c @@ -23,8 +23,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_virtu_process,gras_virtu,"Process manipulat /* Functions to handle gras_procdata_t->libdata cells*/ typedef struct { char *name; - pvoid_f_void_t *constructor; - void_f_pvoid_t *destructor; + pvoid_f_void_t constructor; + void_f_pvoid_t destructor; } s_gras_procdata_fabric_t, *gras_procdata_fabric_t; static xbt_dynar_t _gras_procdata_fabrics = NULL; /* content: s_gras_procdata_fabric_t */ @@ -144,7 +144,7 @@ gras_procdata_init() { THROW1(unknown_error,0,"MayDay: two modules use '%s' as libdata name", fab.name); /* Add the data in place, after some more sanity checking */ - elem = (fab.constructor)(); + elem = (*fab.constructor)(); if (elem->name_len && elem->name_len != strlen(elem->name)) { elem->name_len = strlen(elem->name); WARN1("Module '%s' constructor is borken: it does not set elem->name_len", diff --git a/src/include/simix/simix.h b/src/include/simix/simix.h index 616db0ad5f..2b7502991e 100644 --- a/src/include/simix/simix.h +++ b/src/include/simix/simix.h @@ -45,15 +45,15 @@ XBT_PUBLIC(void) __SIMIX_main(void); * int argc, char **argv: parameters passed to code * * */ -typedef void *(smx_creation_func_t)(/*name*/ const char *, +typedef void *(*smx_creation_func_t)(/*name*/ const char *, /*code*/ xbt_main_func_t, /*userdata*/ void *, /*hostname*/ char *, /* argc */ int, /* argv */ char **); -XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t *function); -XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t *function); -XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_f_pvoid_t *function); +XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function); +XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t function); +XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_f_pvoid_t function); /************************** Host handling ***********************************/ diff --git a/src/simix/private.h b/src/simix/private.h index dedb6bad4b..6938efd466 100644 --- a/src/simix/private.h +++ b/src/simix/private.h @@ -38,9 +38,9 @@ typedef struct SIMIX_Global { smx_process_t current_process; xbt_dict_t registered_functions; - smx_creation_func_t *create_process_function; - void_f_pvoid_t *kill_process_function; - void_f_pvoid_t *cleanup_process_function; + smx_creation_func_t create_process_function; + void_f_pvoid_t kill_process_function; + void_f_pvoid_t cleanup_process_function; } s_SIMIX_Global_t, *SIMIX_Global_t; extern SIMIX_Global_t simix_global; diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index 61c03d7534..3771300191 100644 --- a/src/simix/smx_deployment.c +++ b/src/simix/smx_deployment.c @@ -77,7 +77,7 @@ static void parse_process_finalize(void) if (simix_global->create_process_function) process = - simix_global->create_process_function(parse_argv[0], parse_code, + (*simix_global->create_process_function)(parse_argv[0], parse_code, NULL, parse_host, parse_argc, parse_argv); else diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index e381b94e03..51290f0cb3 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -456,7 +456,7 @@ int SIMIX_timer_get(void **function, void **arg) * \param function Create process function * */ -void SIMIX_function_register_process_create(smx_creation_func_t * function) +void SIMIX_function_register_process_create(smx_creation_func_t function) { xbt_assert0((simix_global->create_process_function == NULL), "Data already set"); @@ -471,7 +471,7 @@ void SIMIX_function_register_process_create(smx_creation_func_t * function) * \param function Kill process function * */ -void SIMIX_function_register_process_kill(void_f_pvoid_t * function) +void SIMIX_function_register_process_kill(void_f_pvoid_t function) { xbt_assert0((simix_global->kill_process_function == NULL), "Data already set"); @@ -486,7 +486,7 @@ void SIMIX_function_register_process_kill(void_f_pvoid_t * function) * \param function cleanup process function * */ -void SIMIX_function_register_process_cleanup(void_f_pvoid_t * function) +void SIMIX_function_register_process_cleanup(void_f_pvoid_t function) { simix_global->cleanup_process_function = function; } diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 54a02957b6..863a15b68a 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -24,22 +24,22 @@ 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_router_fun = nil_function; -void_f_void_t *ETag_surfxml_router_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_router_fun = nil_function; +void_f_void_t ETag_surfxml_router_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; @@ -106,82 +106,82 @@ void STag_surfxml_platform_description(void) "Last, do not forget to also update your values for " "the calls to MSG_task_create (if any)."); - STag_surfxml_platform_description_fun(); + (*STag_surfxml_platform_description_fun)(); } void ETag_surfxml_platform_description(void) { - ETag_surfxml_platform_description_fun(); + (*ETag_surfxml_platform_description_fun)(); } void STag_surfxml_cpu(void) { - STag_surfxml_cpu_fun(); + (*STag_surfxml_cpu_fun)(); } void ETag_surfxml_cpu(void) { - ETag_surfxml_cpu_fun(); + (*ETag_surfxml_cpu_fun)(); } void STag_surfxml_router(void) { - STag_surfxml_router_fun(); + (*STag_surfxml_router_fun)(); } void ETag_surfxml_router(void) { - ETag_surfxml_router_fun(); + (*ETag_surfxml_router_fun)(); } void STag_surfxml_network_link(void) { - STag_surfxml_network_link_fun(); + (*STag_surfxml_network_link_fun)(); } void ETag_surfxml_network_link(void) { - ETag_surfxml_network_link_fun(); + (*ETag_surfxml_network_link_fun)(); } void STag_surfxml_route(void) { - STag_surfxml_route_fun(); + (*STag_surfxml_route_fun)(); } void ETag_surfxml_route(void) { - ETag_surfxml_route_fun(); + (*ETag_surfxml_route_fun)(); } void STag_surfxml_route_element(void) { - STag_surfxml_route_element_fun(); + (*STag_surfxml_route_element_fun)(); } void ETag_surfxml_route_element(void) { - ETag_surfxml_route_element_fun(); + (*ETag_surfxml_route_element_fun)(); } void STag_surfxml_process(void) { - STag_surfxml_process_fun(); + (*STag_surfxml_process_fun)(); } void ETag_surfxml_process(void) { - ETag_surfxml_process_fun(); + (*ETag_surfxml_process_fun)(); } void STag_surfxml_argument(void) { - STag_surfxml_argument_fun(); + (*STag_surfxml_argument_fun)(); } void ETag_surfxml_argument(void) { - ETag_surfxml_argument_fun(); + (*ETag_surfxml_argument_fun)(); } void surf_parse_open(const char *file) @@ -226,7 +226,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/context_private.h b/src/xbt/context_private.h index 96a48611dd..ebaba606a9 100644 --- a/src/xbt/context_private.h +++ b/src/xbt/context_private.h @@ -57,9 +57,9 @@ typedef struct s_xbt_context { char **argv; /* Init/exit functions */ - void_f_pvoid_t *startup_func; + void_f_pvoid_t startup_func; void *startup_arg; - void_f_pvoid_t *cleanup_func; + void_f_pvoid_t cleanup_func; void *cleanup_arg; int iwannadie; /* Set to true by the context when it wants to commit suicide */ diff --git a/src/xbt/dict.c b/src/xbt/dict.c index 85748d1c6b..36e91515a5 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -165,11 +165,11 @@ static unsigned int xbt_dict_hash(const char *str) { * Set the \a data in the structure under the \a key, which can be any kind * of data, as long as its length is provided in \a key_len. */ -void xbt_dict_set_ext(xbt_dict_t dict, +void xbt_dict_set_ext(xbt_dict_t dict, const char *key, int key_len, void *data, - void_f_pvoid_t *free_ctn) { + void_f_pvoid_t free_ctn) { unsigned int hash_code; xbt_dictelm_t current, previous = NULL; @@ -217,10 +217,10 @@ void xbt_dict_set_ext(xbt_dict_t dict, * set the \a data in the structure under the \a key, which is a * null terminated string. */ -void xbt_dict_set(xbt_dict_t dict, +void xbt_dict_set(xbt_dict_t dict, const char *key, void *data, - void_f_pvoid_t *free_ctn) { + void_f_pvoid_t free_ctn) { xbt_assert(dict); @@ -438,7 +438,7 @@ void xbt_dict_add_element(xbt_dict_t dict, xbt_dictelm_t element) { */ void xbt_dict_dump(xbt_dict_t dict, - void_f_pvoid_t *output) { + void_f_pvoid_t output) { int i; xbt_dictelm_t element; printf("Dict %p:\n", dict); @@ -448,7 +448,7 @@ void xbt_dict_dump(xbt_dict_t dict, while (element != NULL) { printf("%s -> ", element->key); if (output != NULL) { - output(element->content); + (*output)(element->content); } printf("\n"); element = element->next; diff --git a/src/xbt/dict_multi.c b/src/xbt/dict_multi.c index 2ee799cd32..a80a226ec8 100644 --- a/src/xbt/dict_multi.c +++ b/src/xbt/dict_multi.c @@ -30,7 +30,7 @@ static void _free_dict(void*d) { void xbt_multidict_set_ext(xbt_dict_t mdict, xbt_dynar_t keys, xbt_dynar_t lens, - void *data, void_f_pvoid_t *free_ctn) { + void *data, void_f_pvoid_t free_ctn) { xbt_ex_t e; xbt_dict_t thislevel,nextlevel=NULL; @@ -85,7 +85,7 @@ xbt_multidict_set_ext(xbt_dict_t mdict, void xbt_multidict_set(xbt_dict_t mdict, xbt_dynar_t keys, - void *data, void_f_pvoid_t *free_ctn) { + void *data, void_f_pvoid_t free_ctn) { xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int),NULL); int i; xbt_ex_t e; diff --git a/src/xbt/dict_private.h b/src/xbt/dict_private.h index 7869357aeb..70e62fa966 100644 --- a/src/xbt/dict_private.h +++ b/src/xbt/dict_private.h @@ -24,7 +24,7 @@ typedef struct xbt_dictelm_ { char *key; int key_len; void *content; - void_f_pvoid_t *free_f; + void_f_pvoid_t free_f; xbt_dictelm_t next; } s_xbt_dictelm_t; diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 96be789aed..6abfd76d23 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -54,7 +54,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn,xbt,"Dynamic arrays"); "dynar %p is empty", dynar) static void _dynar_map(const xbt_dynar_t dynar, - void_f_pvoid_t * const op); + void_f_pvoid_t const op); static XBT_INLINE void _xbt_clear_mem(void * const ptr, @@ -182,7 +182,7 @@ xbt_dynar_dump(xbt_dynar_t dynar) { */ xbt_dynar_t xbt_dynar_new(const unsigned long elmsize, - void_f_pvoid_t * const free_f) { + void_f_pvoid_t const free_f) { xbt_dynar_t dynar = xbt_new0(s_xbt_dynar_t,1); @@ -203,7 +203,7 @@ xbt_dynar_new(const unsigned long elmsize, */ xbt_dynar_t xbt_dynar_new_sync(const unsigned long elmsize, - void_f_pvoid_t * const free_f) { + void_f_pvoid_t const free_f) { xbt_dynar_t res = xbt_dynar_new(elmsize,free_f); res->mutex = xbt_mutex_init(); return res; @@ -617,7 +617,7 @@ xbt_dynar_shift(xbt_dynar_t const dynar, } static void _dynar_map(const xbt_dynar_t dynar, - void_f_pvoid_t * const op) { + void_f_pvoid_t const op) { char elm[SIZEOF_MAX]; const unsigned long used = dynar->used; unsigned long i = 0; @@ -639,7 +639,7 @@ static void _dynar_map(const xbt_dynar_t dynar, */ void xbt_dynar_map(const xbt_dynar_t dynar, - void_f_pvoid_t * const op) { + void_f_pvoid_t const op) { _dynar_lock(dynar); _sanity_check_dynar(dynar); diff --git a/src/xbt/dynar_private.h b/src/xbt/dynar_private.h index 46ad623045..85edb74c0a 100644 --- a/src/xbt/dynar_private.h +++ b/src/xbt/dynar_private.h @@ -16,7 +16,7 @@ typedef struct xbt_dynar_s { unsigned long used; unsigned long elmsize; void *data; - void_f_pvoid_t *free_f; + void_f_pvoid_t free_f; xbt_mutex_t mutex; } s_xbt_dynar_t; diff --git a/src/xbt/graph.c b/src/xbt/graph.c index b106f505bb..1237288d7c 100644 --- a/src/xbt/graph.c +++ b/src/xbt/graph.c @@ -127,9 +127,9 @@ void xbt_graph_edge_set_data(xbt_edge_t edge, void *data) * Free the graph structure. */ void xbt_graph_free_graph(xbt_graph_t g, - void_f_pvoid_t * node_free_function, - void_f_pvoid_t * edge_free_function, - void_f_pvoid_t * graph_free_function) + void_f_pvoid_t node_free_function, + void_f_pvoid_t edge_free_function, + void_f_pvoid_t graph_free_function) { int cursor = 0; xbt_node_t node = NULL; @@ -155,7 +155,8 @@ void xbt_graph_free_graph(xbt_graph_t g, xbt_dynar_foreach(g->edges, cursor, edge) free(edge); xbt_dynar_free(&(g->edges)); - if(graph_free_function) (*graph_free_function)(g->data); + if(graph_free_function) + (*graph_free_function)(g->data); free(g); return; @@ -164,8 +165,8 @@ void xbt_graph_free_graph(xbt_graph_t g, /** @brief remove the given node from the given graph */ void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n, - void_f_pvoid_t * node_free_function, - void_f_pvoid_t * edge_free_function) + void_f_pvoid_t node_free_function, + void_f_pvoid_t edge_free_function) { unsigned long nbr; int i; @@ -185,7 +186,7 @@ void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n, } if ((node_free_function) && (n->data)) - node_free_function(n->data); + (*node_free_function)(n->data); cursor = 0; xbt_dynar_foreach(g->nodes, cursor, node) @@ -202,7 +203,7 @@ void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n, /** @brief remove the given edge from the given graph */ void xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e, - void_f_pvoid_t *free_function) + void_f_pvoid_t free_function) { int idx; int cursor = 0; @@ -598,10 +599,10 @@ static void __parse_edge(void) /** @brief Import a graph from a file following the GraphXML format */ xbt_graph_t xbt_graph_read(const char *filename, - void *(node_label_and_data) (xbt_node_t, + void *(*node_label_and_data) (xbt_node_t, const char *, const char *), - void *(edge_label_and_data) (xbt_edge_t, + void *(*edge_label_and_data) (xbt_edge_t, const char *, const char *)) { diff --git a/src/xbt/graphxml_parse.c b/src/xbt/graphxml_parse.c index 98fe312d33..b03c09757a 100644 --- a/src/xbt/graphxml_parse.c +++ b/src/xbt/graphxml_parse.c @@ -26,12 +26,12 @@ static void nil_function(void) return; } -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; +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; @@ -48,34 +48,34 @@ void xbt_graph_parse_reset_parser(void) void STag_graphxml_graph(void) { - STag_graphxml_graph_fun(); + (*STag_graphxml_graph_fun)(); } void ETag_graphxml_graph(void) { - ETag_graphxml_graph_fun(); + (*ETag_graphxml_graph_fun)(); } void STag_graphxml_node(void) { - STag_graphxml_node_fun(); + (*STag_graphxml_node_fun)(); } void ETag_graphxml_node(void) { - ETag_graphxml_node_fun(); + (*ETag_graphxml_node_fun)(); } void STag_graphxml_edge(void) { - STag_graphxml_edge_fun(); + (*STag_graphxml_edge_fun)(); } void ETag_graphxml_edge(void) { - ETag_graphxml_edge_fun(); + (*ETag_graphxml_edge_fun)(); } @@ -115,7 +115,7 @@ static int _xbt_graph_parse(void) return xbt_graph_parse_lex(); } -int_f_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) { diff --git a/src/xbt/heap.c b/src/xbt/heap.c index 19db0112e1..747b2e3521 100644 --- a/src/xbt/heap.c +++ b/src/xbt/heap.c @@ -26,7 +26,7 @@ * * Creates a new heap. */ -xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t * const free_func) +xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t const free_func) { xbt_heap_t H = xbt_new0(struct xbt_heap, 1); H->size = init_size; @@ -45,7 +45,7 @@ void xbt_heap_free(xbt_heap_t H) int i; if (H->free) for (i = 0; i < H->count; i++) - H->free(H->items[i].content); + (*H->free)(H->items[i].content); free(H->items); free(H); return; diff --git a/src/xbt/heap_private.h b/src/xbt/heap_private.h index 72389dc602..026cbb44d5 100644 --- a/src/xbt/heap_private.h +++ b/src/xbt/heap_private.h @@ -20,7 +20,7 @@ typedef struct xbt_heap { int size; int count; xbt_heapItem_t items; - void_f_pvoid_t *free; + void_f_pvoid_t free; } s_xbt_heap_t; #define PARENT(i) i/2 diff --git a/src/xbt/mallocator_private.h b/src/xbt/mallocator_private.h index bd5aeddcfa..35b96d46d1 100644 --- a/src/xbt/mallocator_private.h +++ b/src/xbt/mallocator_private.h @@ -5,9 +5,9 @@ typedef struct s_xbt_mallocator { int current_size; /* number of objects currently stored */ void **objects; /* objects stored by the mallocator and available for the user */ int max_size; /* maximum number of objects */ - pvoid_f_void_t *new_f; /* function to call when we are running out of objects */ - void_f_pvoid_t *free_f; /* function to call when we have got too many objects */ - void_f_pvoid_t *reset_f; /* function to call when an object is released by the user */ + pvoid_f_void_t new_f; /* function to call when we are running out of objects */ + void_f_pvoid_t free_f; /* function to call when we have got too many objects */ + void_f_pvoid_t reset_f; /* function to call when an object is released by the user */ } s_xbt_mallocator_t; #endif diff --git a/src/xbt/set.c b/src/xbt/set.c index 6578127d83..4230a6cd8e 100644 --- a/src/xbt/set.c +++ b/src/xbt/set.c @@ -78,7 +78,7 @@ static int _xbt_set_get_id(xbt_set_t set) { */ void xbt_set_add (xbt_set_t set, xbt_set_elm_t elm, - void_f_pvoid_t *free_func) { + void_f_pvoid_t free_func) { int found = 1; xbt_set_elm_t found_in_dict = NULL; diff --git a/src/xbt/xbt_matrix.c b/src/xbt/xbt_matrix.c index ff2c3c8246..b644d3be27 100644 --- a/src/xbt/xbt_matrix.c +++ b/src/xbt/xbt_matrix.c @@ -17,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_matrix,xbt,"2D data storage"); /** \brief constructor */ xbt_matrix_t xbt_matrix_new(int lines, int rows, const unsigned long elmsize, - void_f_pvoid_t * const free_f) { + void_f_pvoid_t const free_f) { xbt_matrix_t res=xbt_new(s_xbt_matrix_t, 1); res->lines = lines; res->rows = rows; @@ -31,7 +31,7 @@ xbt_matrix_t xbt_matrix_new(int lines, int rows, xbt_matrix_t xbt_matrix_new_sub(xbt_matrix_t from, int lsize, int rsize, int lpos, int rpos, - pvoid_f_pvoid_t *const cpy_f) { + pvoid_f_pvoid_t const cpy_f) { xbt_matrix_t res=xbt_matrix_new(lsize,rsize, from->elmsize, from->free_f); @@ -73,7 +73,7 @@ void xbt_matrix_dump(xbt_matrix_t matrix, const char*name, int coords, fprintf(stderr," (%d,%d)=",i,j); else fprintf(stderr," "); - display_fun(xbt_matrix_get_ptr(matrix,i,j)); + (*display_fun)(xbt_matrix_get_ptr(matrix,i,j)); } fprintf(stderr,"\n"); } @@ -97,7 +97,7 @@ void xbt_matrix_copy_values(xbt_matrix_t dst, xbt_matrix_t src, int lsize, int rsize, int lpos_dst,int rpos_dst, int lpos_src,int rpos_src, - pvoid_f_pvoid_t *const cpy_f) { + pvoid_f_pvoid_t const cpy_f) { int i,j; DEBUG10("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)", @@ -119,7 +119,7 @@ void xbt_matrix_copy_values(xbt_matrix_t dst, xbt_matrix_t src, for (i=0;istart_routine(t->param); + return (*t->start_routine)(t->param); } xbt_os_thread_t xbt_os_thread_create(const char*name, pvoid_f_pvoid_t start_routine, @@ -294,7 +294,7 @@ typedef struct xbt_os_thread_ { char *name; HANDLE handle; /* the win thread handle */ unsigned long id; /* the win thread id */ - pvoid_f_pvoid_t *start_routine; + pvoid_f_pvoid_t start_routine; void* param; } s_xbt_os_thread_t ; diff --git a/src/xbt/xbt_rl_synchro.c b/src/xbt/xbt_rl_synchro.c index 3aaca7d125..ad230a7486 100644 --- a/src/xbt/xbt_rl_synchro.c +++ b/src/xbt/xbt_rl_synchro.c @@ -24,7 +24,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync_rl,xbt,"Synchronization mechanism (RL)" typedef struct s_xbt_thread_ { xbt_os_thread_t os_thread; - void_f_pvoid_t *code; + void_f_pvoid_t code; void *userparam; }s_xbt_thread_t; @@ -36,7 +36,7 @@ static void *xbt_thread_create_wrapper(void *p) { } -xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t* code, void* param) { +xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t code, void* param) { xbt_thread_t res = xbt_new0(s_xbt_thread_t,1); res->userparam = param; diff --git a/src/xbt/xbt_sg_synchro.c b/src/xbt/xbt_sg_synchro.c index cf4c3b3125..09e89619eb 100644 --- a/src/xbt/xbt_sg_synchro.c +++ b/src/xbt/xbt_sg_synchro.c @@ -23,7 +23,7 @@ typedef struct s_xbt_thread_ { char *name; smx_process_t s_process; - void_f_pvoid_t *code; + void_f_pvoid_t code; void *userparam; void *father_data; } s_xbt_thread_t; @@ -35,7 +35,7 @@ static int xbt_thread_create_wrapper(int argc, char *argv[]) { return 0; } -xbt_thread_t xbt_thread_create(const char*name,void_fp_pvoid_t code, void* param) { +xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t code, void* param) { xbt_thread_t res = xbt_new0(s_xbt_thread_t,1); res->name = xbt_strdup(name); res->userparam = param; diff --git a/src/xbt/xbt_virtu.c b/src/xbt/xbt_virtu.c index 0e05bd34d6..bed1aca7d8 100644 --- a/src/xbt/xbt_virtu.c +++ b/src/xbt/xbt_virtu.c @@ -15,5 +15,5 @@ static int xbt_fake_pid(void) { return 0; } -int_f_void_t *xbt_getpid=&xbt_fake_pid; +int_f_void_t xbt_getpid=xbt_fake_pid;