simon 01/09/10 14:47:27
Modified: . basic_opcodes.ops bytecode.c parrot.h test_main.c
Log:
Fix up format warnings, from Sam Tregar <[EMAIL PROTECTED]>.
(Modified to avoid conflict with Dan's changes.)
Revision Changes Path
1.6 +3 -3 parrot/basic_opcodes.ops
Index: basic_opcodes.ops
===================================================================
RCS file: /home/perlcvs/parrot/basic_opcodes.ops,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- basic_opcodes.ops 2001/09/10 21:26:08 1.5
+++ basic_opcodes.ops 2001/09/10 21:47:25 1.6
@@ -110,7 +110,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
@@ -202,7 +202,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
@@ -307,7 +307,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
1.4 +1 -1 parrot/bytecode.c
Index: bytecode.c
===================================================================
RCS file: /home/perlcvs/parrot/bytecode.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- bytecode.c 2001/09/10 09:50:39 1.3
+++ bytecode.c 2001/09/10 21:47:26 1.4
@@ -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);
}
}
1.3 +1 -0 parrot/parrot.h
Index: parrot.h
===================================================================
RCS file: /home/perlcvs/parrot/parrot.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- parrot.h 2001/09/07 15:23:40 1.2
+++ parrot.h 2001/09/10 21:47:26 1.3
@@ -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
1.3 +5 -5 parrot/test_main.c
Index: test_main.c
===================================================================
RCS file: /home/perlcvs/parrot/test_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- test_main.c 2001/09/10 10:05:23 1.2
+++ test_main.c 2001/09/10 21:47:26 1.3
@@ -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 */