# New Ticket Created by  Steve Peters 
# Please include the string:  [perl #30962]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30962 >


While compiling parrot-current on Win32 last night, I got several warnings for 
unreference local variables.  I also got one warning in interpreter.c 
regarding a conversion from a double to a size_t with a possible loss of 
data.  The offending line is currently line 217

nb = 8;

I don't think that changing it to 

nb = (size_t)8;

should cause problems.

Attached is a patch created by diff -ur 

Regards

Steve Peters
[EMAIL PROTECTED]

diff -ur parrot.orig/src/interpreter.c parrot/src/interpreter.c
--- parrot.orig/src/interpreter.c       2004-08-05 22:27:05.000000000 
+0000
+++ parrot/src/interpreter.c    2004-08-05 22:29:05.000000000 +0000
@@ -217,7 +217,7 @@
         if (!pi->branches) {
             size_t nb = interpreter->code->cur_cs->base.size / 16;
             if (nb < 8)
-                nb = 8;
+                nb = (size_t)8;
             pi->branches = mem_sys_allocate( sizeof(Prederef_branch) * 
nb);
             pi->n_allocated = nb;
             pi->n_branches = 0;
@@ -440,8 +440,6 @@

     if (!interpreter->prederef.code) {
         size_t N = interpreter->code->cur_cs->base.size;
-        size_t i;
-        size_t n;
         void **temp = prederef_arena;
         opcode_t *pc = interpreter->code->cur_cs->base.data;

diff -ur parrot.orig/src/packfile.c parrot/src/packfile.c
--- parrot.orig/src/packfile.c  2004-08-05 22:27:05.000000000 +0000
+++ parrot/src/packfile.c       2004-08-05 22:30:08.000000000 +0000
@@ -377,7 +377,6 @@
 mark_const_subs(Parrot_Interp interpreter)
 {
     struct PackFile *self;
-    struct PackFile_ByteCode   * cur_cs;
     struct PackFile_Directory *dir;

     self = interpreter->code;
diff -ur parrot.orig/src/stacks.c parrot/src/stacks.c
--- parrot.orig/src/stacks.c    2004-08-05 22:27:05.000000000 +0000
+++ parrot/src/stacks.c 2004-08-05 22:30:39.000000000 +0000
@@ -59,7 +59,6 @@
            Stack_Chunk_t *chunk)
 {
     Stack_Entry_t *entry;
-    size_t i;

     for (; ; chunk = chunk->prev) {

diff -ur parrot.orig/src/string.c parrot/src/string.c
--- parrot.orig/src/string.c    2004-08-05 22:27:05.000000000 +0000
+++ parrot/src/string.c 2004-08-05 22:33:22.000000000 +0000
@@ -1353,10 +1353,6 @@
     INTVAL offset, INTVAL length, STRING **d, int replace_dest)
 {
     STRING *dest;
-    UINTVAL substart_off;       /* Offset from start of string to our
-                                 * piece */
-    UINTVAL subend_off;         /* Offset from start of string to the
-                                 * end of our piece */
     UINTVAL true_offset;
     UINTVAL true_length;

@@ -1575,7 +1571,6 @@
 string_chopn(Interp *interpreter, STRING *s, INTVAL n)
 {
     UINTVAL new_length;
-    struct string_iterator_t it;

     if (n < 0) {
         new_length = -n;

Reply via email to