[svn:parrot] r44487 - in trunk: src/nci tools/dev

plobsing at svn.parrot.org plobsing at svn.parrot.org
Fri Feb 26 00:37:34 UTC 2010


Author: plobsing
Date: Fri Feb 26 00:37:33 2010
New Revision: 44487
URL: https://trac.parrot.org/parrot/changeset/44487

Log:
make function prototypes default to (void) not ()

Modified:
   trunk/src/nci/extra_thunks.c
   trunk/tools/dev/nci_thunk_gen.pir

Modified: trunk/src/nci/extra_thunks.c
==============================================================================
--- trunk/src/nci/extra_thunks.c	Fri Feb 26 00:35:13 2010	(r44486)
+++ trunk/src/nci/extra_thunks.c	Fri Feb 26 00:37:33 2010	(r44487)
@@ -574,7 +574,7 @@
 static void
 pcf_v_(PARROT_INTERP, PMC *self)
 {
-    typedef void(* func_t)();
+    typedef void(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -1794,7 +1794,7 @@
 static void
 pcf_i_(PARROT_INTERP, PMC *self)
 {
-    typedef int(* func_t)();
+    typedef int(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -2213,7 +2213,7 @@
 static void
 pcf_l_(PARROT_INTERP, PMC *self)
 {
-    typedef long(* func_t)();
+    typedef long(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -2970,7 +2970,7 @@
 static void
 pcf_c_(PARROT_INTERP, PMC *self)
 {
-    typedef char(* func_t)();
+    typedef char(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -3008,7 +3008,7 @@
 static void
 pcf_d_(PARROT_INTERP, PMC *self)
 {
-    typedef double(* func_t)();
+    typedef double(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -3044,7 +3044,7 @@
 static void
 pcf_f_(PARROT_INTERP, PMC *self)
 {
-    typedef float(* func_t)();
+    typedef float(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -4675,7 +4675,7 @@
 static void
 pcf_p_(PARROT_INTERP, PMC *self)
 {
-    typedef void *(* func_t)();
+    typedef void *(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -5070,7 +5070,7 @@
 static void
 pcf_s_(PARROT_INTERP, PMC *self)
 {
-    typedef short(* func_t)();
+    typedef short(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);
@@ -5087,7 +5087,7 @@
 static void
 pcf_t_(PARROT_INTERP, PMC *self)
 {
-    typedef char *(* func_t)();
+    typedef char *(* func_t)(void);
     func_t fn_pointer;
     void *orig_func;
     PMC *ctx         = CURRENT_CONTEXT(interp);

Modified: trunk/tools/dev/nci_thunk_gen.pir
==============================================================================
--- trunk/tools/dev/nci_thunk_gen.pir	Fri Feb 26 00:35:13 2010	(r44486)
+++ trunk/tools/dev/nci_thunk_gen.pir	Fri Feb 26 00:37:33 2010	(r44487)
@@ -607,6 +607,9 @@
     .local string params_csig
     $P0 = 'map_from_sig_table'(params, 'as_proto')
     params_csig = join ', ', $P0
+    if params_csig goto end_default_params_csig_to_void
+        params_csig = 'void'
+    end_default_params_csig_to_void:
 
     .local string ret_tdecl
     ret_tdecl = ""


More information about the parrot-commits mailing list