Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Another try at cleaning up the function types
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jul 2006 13:06:29 +0000 (13:06 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jul 2006 13:06:29 +0000 (13:06 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2614 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/surf/surfxml_parse.h
include/xbt/function_types.h
include/xbt/graphxml_parse.h
src/gras/Msg/msg_private.h
src/gras/Msg/timer.c
src/surf/surfxml_parse.c
src/xbt/graphxml_parse.c

index f9faf08..4ea23b9 100644 (file)
 #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);
index a632b5a..7e476a7 100644 (file)
 
 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()
 
index 81a98fd..2c26c35 100644 (file)
 #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);
index 54511b7..cb42167 100644 (file)
@@ -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;
 
index 63b6ce0..6162502 100644 (file)
@@ -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,
index 4ec4445..785a41d 100644 (file)
@@ -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)
 { 
index 1c9a31c..98fe312 100644 (file)
@@ -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)
 {