IRIX64 6.2 cc -n32 issues 123 warnings (one per op code) complaining
that
"interpreter.c", line 219: warning(1048): cast between pointer-to-object and
pointer-to-function
BUILD_TABLE(foo);
^
This patch makes them go away.
- SWM
Index: build_interp_starter.pl
===================================================================
RCS file: /home/perlcvs/parrot/build_interp_starter.pl,v
retrieving revision 1.11
diff -u -u -r1.11 build_interp_starter.pl
--- build_interp_starter.pl 2001/09/19 20:05:06 1.11
+++ build_interp_starter.pl 2001/09/24 01:59:04
@@ -21,7 +21,7 @@
my $opcode_fingerprint = Parrot::Opcode::fingerprint();
for my $name (sort {$opcodes{$a}{CODE} <=> $opcodes{$b}{CODE}} keys %opcodes) {
- print INTERP "\tx[$opcodes{$name}{CODE}] = (void*)$name; \\\n";
+ print INTERP "\tx[$opcodes{$name}{CODE}] = $name; \\\n";
}
print INTERP "} while (0);\n";
@@ -61,8 +61,8 @@
print INTERP <<EOI;
#define DO_OP(w,x,y,z) do { \\
- x = (void *)z->opcode_funcs; \\
- y = (opcode_t* (*)())x[*w]; \\
+ x = z->opcode_funcs; \\
+ y = x[*w]; \\
w = (y)(w,z); \\
} while (0);
EOI
Index: interpreter.c
===================================================================
RCS file: /home/perlcvs/parrot/interpreter.c,v
retrieving revision 1.18
diff -u -u -r1.18 interpreter.c
--- interpreter.c 2001/09/19 20:05:06 1.18
+++ interpreter.c 2001/09/24 01:59:04
@@ -48,8 +48,8 @@
runops_notrace_core (struct Parrot_Interp *interpreter, opcode_t *code, IV code_size)
{
/* Move these out of the inner loop. No need to redeclare 'em each
time through */
- opcode_t *(*func)();
- void **temp;
+ opcode_t *(* func)();
+ opcode_t *(**temp)();
opcode_t *code_start;
code_start = code;
@@ -95,8 +95,8 @@
runops_trace_core (struct Parrot_Interp *interpreter, opcode_t *code, IV code_size) {
/* Move these out of the inner loop. No need to redeclare 'em each
time through */
- opcode_t *(*func)();
- void **temp;
+ opcode_t *( *func)();
+ opcode_t *(**temp)();
opcode_t *code_start;
code_start = code;
@@ -213,7 +213,7 @@
/* The default opcode function table would be a good thing here... */
{
- void **foo;
+ opcode_t *(**foo)();
foo = mem_sys_allocate(2048 * sizeof(void *));
BUILD_TABLE(foo);
Index: include/parrot/interpreter.h
===================================================================
RCS file: /home/perlcvs/parrot/include/parrot/interpreter.h,v
retrieving revision 1.3
diff -u -u -r1.3 interpreter.h
--- include/parrot/interpreter.h 2001/09/19 20:04:45 1.3
+++ include/parrot/interpreter.h 2001/09/24 01:59:04
@@ -30,9 +30,8 @@
/* variable area */
struct Arenas *arena_base; /* Pointer to this */
/* interpreter's arena */
- opcode_t *(*(*opcode_funcs)[2048])(); /* Opcode */
- /* function table */
- STRING_FUNCS *(*(*string_funcs)[64])(); /* String function table */
+ opcode_t *(**opcode_funcs)(); /* Opcode function table */
+ STRING_FUNCS *(**string_funcs)(); /* String function table */
IV flags; /* Various interpreter flags
that signal that runops
should do something */