On Wed, 3 Oct 2001, Simon Cozens wrote:

> On Wed, Oct 03, 2001 at 11:44:25AM -0400, Andy Dougherty wrote:
> > It's not a core platform, but Linux/Sparc (intvalsize=8) is still not
> > very happy:
> 
> OK; I'll have to check that out. The Sparc I have here has intvalsize=4
> by default.

Perhaps I'm too daring running bleadperl by default :-).

Anyway, the following bandaid results in the following happy output:

t/op/basic......ok, 1/5 skipped:  label constants unimplemented in assembler 
t/op/bitwise....ok                                                           
t/op/integer....ok                                                           
t/op/number.....ok                                                           
t/op/stacks.....ok, 3/9 skipped: various reasons                             
t/op/string.....ok, 1/10 skipped:  TODO: printing empty string reg segfaults 
t/op/time.......ok                                                           
t/op/trans......ok                                                           
All tests successful, 5 subtests skipped.
Files=8, Tests=99, 160 wallclock secs (149.65 cusr +  9.88 csys = 159.53 CPU)

Here's the patch.  It's a bandaid (but a pretty good one).  What we really
need to do is figure out the correct printf format string for printing out
an INTVAL.  Fortunately, perl5.7.x's Configure already does some of this
for us.

Not all the casts may be necessary.  I used a rather brute force approach
:-).

diff -r -u parrot/basic_opcodes.ops parrot-andy/basic_opcodes.ops
--- parrot/basic_opcodes.ops    Tue Oct  2 10:01:30 2001
+++ parrot-andy/basic_opcodes.ops       Wed Oct  3 11:40:25 2001
@@ -145,12 +145,12 @@
 
 /* PRINT Ix */
 AUTO_OP print_i {
-  printf("%li", INT_REG(P1));
+  printf("%li", (long) INT_REG(P1));
 }
 
 /* PRINT ic */
 AUTO_OP print_ic {
-  printf("%li", P1);
+  printf("%li", (long) P1);
 }
 
  
diff -r -u parrot/interpreter.c parrot-andy/interpreter.c
--- parrot/interpreter.c        Wed Oct  3 10:51:07 2001
+++ parrot-andy/interpreter.c   Wed Oct  3 11:36:44 2001
@@ -84,7 +84,7 @@
             fprintf(stderr, "; ARGS=(");
             for(i = 0; i < op_args[*pc]; i++) {
                 if (i) { fprintf(stderr, ", "); }
-                fprintf(stderr, "%ld", *(pc + i + 1));
+                fprintf(stderr, "%ld", (long) *(pc + i + 1));
             }
             fprintf(stderr, ")");
         }
@@ -147,7 +147,7 @@
     pc = core(interpreter);
 
     if (pc < code_start || pc >= code_end) {
-        fprintf(stderr, "Error: Control left bounds of byte-code block (now at 
location %d)!\n", pc - code_start);
+        fprintf(stderr, "Error: Control left bounds of byte-code block (now at 
+location %d)!\n", (int) (pc - code_start));
         exit(1);
     }
 }
diff -r -u parrot/packfile.c parrot-andy/packfile.c
--- parrot/packfile.c   Tue Oct  2 10:01:30 2001
+++ parrot-andy/packfile.c      Wed Oct  3 11:38:05 2001
@@ -1679,7 +1679,7 @@
             break;
 
         case PFC_INTEGER:
-            printf("    [ 'PFC_INTEGER', %ld ],\n", self->integer);
+            printf("    [ 'PFC_INTEGER', %ld ],\n", (long) self->integer);
             break;
 
         case PFC_NUMBER:
@@ -1689,9 +1689,9 @@
         case PFC_STRING:
             printf("    [ 'PFC_STRING', {\n");
             printf("        FLAGS    => 0x%04x,\n", self->string->flags);
-            printf("        ENCODING => %ld,\n",  self->string->encoding->which);
-            printf("        TYPE     => %ld,\n",  self->string->type);
-            printf("        SIZE     => %ld,\n",  self->string->bufused);
+            printf("        ENCODING => %ld,\n",  (long) 
+self->string->encoding->which);
+            printf("        TYPE     => %ld,\n",  (long) self->string->type);
+            printf("        SIZE     => %ld,\n",  (long) self->string->bufused);
             printf("        DATA     => '%s'\n",  self->string->bufstart); /* TODO: 
Not a good idea in general */
             printf("    } ],\n");
             break;
 


-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042

Reply via email to