> Patches should be sent to the perl6-internals mailing list, where I'll take a
> look at them and apply them to the CVS tree.
Ooo, ooo - me first. Since you turned on -Wall in the Makefile I thought
it would be nice if it compiled without warnings. Below is a patch that
does that on my system.
This is the output from "cvs -q diff -u". Is this is the best way to send
a multi-file patch from the CVS checkout?
-sam
Index: basic_opcodes.ops
===================================================================
RCS file: /home/perlcvs/parrot/basic_opcodes.ops,v
retrieving revision 1.4
diff -u -r1.4 basic_opcodes.ops
--- basic_opcodes.ops 2001/09/10 15:48:36 1.4
+++ basic_opcodes.ops 2001/09/10 21:28:39
@@ -60,7 +60,7 @@
// PRINT Ix
AUTO_OP print_i {
- printf("I reg %i is %i\n", P1, INT_REG(P1));
+ printf("I reg %li is %li\n", P1, INT_REG(P1));
}
// BRANCH CONSTANT
@@ -152,7 +152,7 @@
// PRINT Nx
AUTO_OP print_n {
- printf("N reg %i is %Lf\n", P1, NUM_REG(P1));
+ printf("N reg %li is %Lf\n", P1, NUM_REG(P1));
}
// INC Nx
@@ -257,7 +257,7 @@
// PRINT Sx
AUTO_OP print_s {
STRING *s = STR_REG(P1);
- printf("S reg %i is %.*s\n", P1, string_length(s), s->bufstart);
+ printf("S reg %li is %.*s\n", P1, (int) string_length(s), (char *) s->bufstart);
}
// LEN Ix, Sx
@@ -272,4 +272,4 @@
// NOOP
AUTO_OP noop {
-}
\ No newline at end of file
+}
Index: bytecode.c
===================================================================
RCS file: /home/perlcvs/parrot/bytecode.c,v
retrieving revision 1.3
diff -u -r1.3 bytecode.c
--- bytecode.c 2001/09/10 09:50:39 1.3
+++ bytecode.c 2001/09/10 21:28:39
@@ -93,7 +93,7 @@
}
num--;
if (len < 0 || (len > 0 && num == 0)) {
- printf("Bytecode error: string constant segment corrupted: %i, %i\n",
len, num);
+ printf("Bytecode error: string constant segment corrupted: %i, %i\n",
+(int) len, (int) num);
exit(1);
}
}
Index: parrot.h
===================================================================
RCS file: /home/perlcvs/parrot/parrot.h,v
retrieving revision 1.2
diff -u -r1.2 parrot.h
--- parrot.h 2001/09/07 15:23:40 1.2
+++ parrot.h 2001/09/10 21:28:39
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#include <string.h>
#define NUM_REGISTERS 32
#define PARROT_MAGIC 0x13155a1
Index: register.c
===================================================================
RCS file: /home/perlcvs/parrot/register.c,v
retrieving revision 1.2
diff -u -r1.2 register.c
--- register.c 2001/09/10 15:49:27 1.2
+++ register.c 2001/09/10 21:28:39
@@ -10,10 +10,10 @@
struct IRegChunk *chunk_base;
chunk_base = CHUNK_BASE(interpreter->int_reg);
- printf("Chunk base is %x for %x\n", chunk_base, interpreter->int_reg);
+ printf("Chunk base is %x for %x\n", (unsigned int) chunk_base, (unsigned int)
+interpreter->int_reg);
/* Do we have any slots left in the current chunk? */
if (chunk_base->free) {
- printf("Free was %i\n", chunk_base->free);
+ printf("Free was %i\n", (int) chunk_base->free);
interpreter->int_reg = &chunk_base->IReg[chunk_base->used++];
chunk_base->free--;
}
Index: test_main.c
===================================================================
RCS file: /home/perlcvs/parrot/test_main.c,v
retrieving revision 1.2
diff -u -r1.2 test_main.c
--- test_main.c 2001/09/10 10:05:23 1.2
+++ test_main.c 2001/09/10 21:28:40
@@ -35,19 +35,19 @@
int i;
time_t foo;
- printf("String %p has length %i: %.*s\n", s, string_length(s),
string_length(s), s->bufstart);
+ printf("String %p has length %i: %.*s\n", s, (int) string_length(s), (int)
+string_length(s), (char *) s->bufstart);
string_concat(s, t, 0);
- printf("String %p has length %i: %.*s\n", s, string_length(s),
string_length(s), s->bufstart);
+ printf("String %p has length %i: %.*s\n", s, (int) string_length(s), (int)
+string_length(s), (char *) s->bufstart);
string_chopn(s, 4);
- printf("String %p has length %i: %.*s\n", s, string_length(s),
string_length(s), s->bufstart);
+ printf("String %p has length %i: %.*s\n", s, (int) string_length(s), (int)
+string_length(s), (char *) s->bufstart);
string_chopn(s, 4);
- printf("String %p has length %i: %.*s\n", s, string_length(s),
string_length(s), s->bufstart);
+ printf("String %p has length %i: %.*s\n", s, (int) string_length(s), (int)
+string_length(s), (char *) s->bufstart);
foo = time(0);
for (i = 0; i < 100000000; i++) {
string_concat(s, t, 0);
string_chopn(s, 4);
}
- printf("10000000 concats and chops took %i seconds.\n", time(0)-foo);
+ printf("10000000 concats and chops took %li seconds.\n", time(0)-foo);
string_destroy(s);
}
/* Otherwise load in the program they gave and try that */