cvsuser 02/11/22 08:00:54
Modified: . nci.c
Log:
Removed the warnings.
Revision Changes Path
1.5 +35 -21 parrot/nci.c
Index: nci.c
===================================================================
RCS file: /cvs/public/parrot/nci.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- nci.c 21 Nov 2002 16:51:48 -0000 1.4
+++ nci.c 22 Nov 2002 16:00:53 -0000 1.5
@@ -1,7 +1,7 @@
/* nci.c
* Copyright: 2001, 2002 Yet Another Society
* CVS Info
- * $Id: nci.c,v 1.4 2002/11/21 16:51:48 dan Exp $
+ * $Id: nci.c,v 1.5 2002/11/22 16:00:53 grunblatt Exp $
* Overview:
* Native Call Interface routines. The code needed to build a
* parrot to C call frame is in here
@@ -31,8 +31,10 @@
hackish, but that's just fine */
/* Return void, take nothing */
-static void pcf_v_v(struct Parrot_Interp *interpreter, PMC *self) {
- void (*pointer)();
+static void
+pcf_v_v(struct Parrot_Interp *interpreter, PMC *self)
+{
+ void (*pointer)(void);
pointer = self->cache.struct_val;
(void)(*pointer)();
interpreter->ctx.int_reg.registers[0] = 0;
@@ -44,8 +46,10 @@
}
/* Return int, take nothing */
-static void pcf_i_v(struct Parrot_Interp *interpreter, PMC *self) {
- int (*pointer)();
+static void
+pcf_i_v(struct Parrot_Interp *interpreter, PMC *self)
+{
+ int (*pointer)(void);
int return_data;
pointer = self->cache.struct_val;
return_data = (int)(*pointer)();
@@ -58,9 +62,11 @@
return;
}
-/* Return int, take nothing */
-static void pcf_i_i(struct Parrot_Interp *interpreter, PMC *self) {
- int (*pointer)();
+/* Return int, take int */
+static void
+pcf_i_i(struct Parrot_Interp *interpreter, PMC *self)
+{
+ int (*pointer)(INTVAL);
int return_data;
pointer = self->cache.struct_val;
return_data = (int)(*pointer)(INT_REG(5));
@@ -74,8 +80,10 @@
}
/* Return double, take nothing */
-static void pcf_d_v(struct Parrot_Interp *interpreter, PMC *self) {
- double (*pointer)();
+static void
+pcf_d_v(struct Parrot_Interp *interpreter, PMC *self)
+{
+ double (*pointer)(void);
double return_data;
pointer = self->cache.struct_val;
return_data = (double)(*pointer)();
@@ -89,12 +97,14 @@
}
/* Return double, take double */
-static void pcf_d_d(struct Parrot_Interp *interpreter, PMC *self) {
- double (*pointer)();
+static void
+pcf_d_d(struct Parrot_Interp *interpreter, PMC *self)
+{
+ double (*pointer)(FLOATVAL);
double return_data;
pointer = self->cache.struct_val;
- return_data = (double)(*pointer)(interpreter->ctx.num_reg.registers[5]);
+ return_data = (double)(*pointer)(NUM_REG(5));
interpreter->ctx.num_reg.registers[5] = return_data;
interpreter->ctx.int_reg.registers[0] = 0;
interpreter->ctx.int_reg.registers[1] = 0;
@@ -120,13 +130,17 @@
/* And in here is the platform-independent way. Which is to say
"here there be hacks" */
if (0 == string_length(signature)) return pcf_v_v;
- if (!string_compare(interpreter, signature, string_from_c_string(interpreter,
"i", 1)))
+ if (!string_compare(interpreter, signature,
+ string_from_c_string(interpreter, "i", 1)))
return pcf_i_v;
- if (!string_compare(interpreter, signature, string_from_c_string(interpreter,
"ii", 1)))
+ if (!string_compare(interpreter, signature,
+ string_from_c_string(interpreter, "ii", 1)))
return pcf_i_i;
- if (!string_compare(interpreter, signature, string_from_c_string(interpreter,
"d", 1)))
+ if (!string_compare(interpreter, signature,
+ string_from_c_string(interpreter, "d", 1)))
return pcf_d_v;
- if (!string_compare(interpreter, signature, string_from_c_string(interpreter,
"dd", 2)))
+ if (!string_compare(interpreter, signature,
+ string_from_c_string(interpreter, "dd", 2)))
return pcf_d_d;
return NULL;