Change 29962 by [EMAIL PROTECTED] on 2007/01/24 22:51:14

        Integrate:
        [ 27962]
        Subject: Re: [PATCH] cleanup 212 warnings emitted by gcc-4.2
        From: Marcus Holland-Moritz <[EMAIL PROTECTED]>
        Date: Mon, 24 Apr 2006 23:20:38 +0200
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.8/perl/deb.c#20 integrate
... //depot/maint-5.8/perl/doio.c#91 integrate
... //depot/maint-5.8/perl/doop.c#48 integrate
... //depot/maint-5.8/perl/dump.c#67 integrate
... //depot/maint-5.8/perl/gv.c#89 integrate
... //depot/maint-5.8/perl/handy.h#45 integrate
... //depot/maint-5.8/perl/mg.c#133 integrate
... //depot/maint-5.8/perl/op.c#175 integrate
... //depot/maint-5.8/perl/patchlevel.h#184 integrate
... //depot/maint-5.8/perl/perl.c#192 integrate
... //depot/maint-5.8/perl/perlio.c#89 integrate
... //depot/maint-5.8/perl/pp.c#125 integrate
... //depot/maint-5.8/perl/pp_ctl.c#155 integrate
... //depot/maint-5.8/perl/pp_hot.c#120 integrate
... //depot/maint-5.8/perl/pp_sys.c#128 integrate
... //depot/maint-5.8/perl/regcomp.c#87 integrate
... //depot/maint-5.8/perl/regexec.c#76 integrate
... //depot/maint-5.8/perl/scope.h#23 integrate
... //depot/maint-5.8/perl/sv.c#313 integrate
... //depot/maint-5.8/perl/toke.c#145 integrate
... //depot/maint-5.8/perl/util.c#127 integrate

Differences ...

==== //depot/maint-5.8/perl/deb.c#20 (text) ====
Index: perl/deb.c
--- perl/deb.c#19~29897~        2007-01-20 10:14:46.000000000 -0800
+++ perl/deb.c  2007-01-24 14:51:14.000000000 -0800
@@ -205,8 +205,8 @@
     si_ix=0;
     for (;;)
     {
-        const int si_name_ix = si->si_type+1; /* -1 is a valid index */
-        const char * const si_name = (si_name_ix>= sizeof(si_names)) ? "????" 
: si_names[si_name_ix];
+        const size_t si_name_ix = si->si_type+1; /* -1 is a valid index */
+        const char * const si_name = (si_name_ix >= sizeof(si_names)) ? "????" 
: si_names[si_name_ix];
        I32 ix;
        PerlIO_printf(Perl_debug_log, "STACK %"IVdf": %s\n",
                                                (IV)si_ix, si_name);

==== //depot/maint-5.8/perl/doio.c#91 (text) ====
Index: perl/doio.c
--- perl/doio.c#90~29925~       2007-01-22 14:10:59.000000000 -0800
+++ perl/doio.c 2007-01-24 14:51:14.000000000 -0800
@@ -2250,7 +2250,7 @@
     SETERRNO(0,0);
     if (shmctl(id, IPC_STAT, &shmds) == -1)
        return -1;
-    if (mpos < 0 || msize < 0 || mpos + msize > shmds.shm_segsz) {
+    if (mpos < 0 || msize < 0 || (size_t)mpos + msize > shmds.shm_segsz) {
        SETERRNO(EFAULT,SS_ACCVIO);             /* can't do as caller requested 
*/
        return -1;
     }
@@ -2263,7 +2263,7 @@
        if (! SvOK(mstr))
            sv_setpvn(mstr, "", 0);
        SvPV_force_nolen(mstr);
-       mbuf = SvGROW(mstr, msize+1);
+       mbuf = SvGROW(mstr, (STRLEN)msize+1);
 
        Copy(shm + mpos, mbuf, msize, char);
        SvCUR_set(mstr, msize);

==== //depot/maint-5.8/perl/doop.c#48 (text) ====
Index: perl/doop.c
--- perl/doop.c#47~29958~       2007-01-24 11:49:21.000000000 -0800
+++ perl/doop.c 2007-01-24 14:51:14.000000000 -0800
@@ -211,7 +211,7 @@
                    else {
                        matches++;
                        if (!del) {
-                           ch = (rlen == 0) ? comp :
+                           ch = (rlen == 0) ? (I32)comp :
                                (comp - 0x100 < rlen) ?
                                tbl[comp+1] : tbl[0x100+rlen];
                            if ((UV)ch != pch) {
@@ -714,7 +714,7 @@
 UV
 Perl_do_vecget(pTHX_ SV *sv, I32 offset, I32 size)
 {
-    STRLEN srclen, len;
+    STRLEN srclen, len, uoffset;
     const unsigned char *s = (const unsigned char *) SvPV_const(sv, srclen);
     UV retnum = 0;
 
@@ -726,118 +726,118 @@
     if (SvUTF8(sv))
        (void) Perl_sv_utf8_downgrade(aTHX_ sv, TRUE);
 
-    offset *= size;    /* turn into bit offset */
-    len = (offset + size + 7) / 8;     /* required number of bytes */
+    uoffset = offset*size;     /* turn into bit offset */
+    len = (uoffset + size + 7) / 8;    /* required number of bytes */
     if (len > srclen) {
        if (size <= 8)
            retnum = 0;
        else {
-           offset >>= 3;       /* turn into byte offset */
+           uoffset >>= 3;      /* turn into byte offset */
            if (size == 16) {
-               if ((STRLEN)offset >= srclen)
+               if (uoffset >= srclen)
                    retnum = 0;
                else
-                   retnum = (UV) s[offset] <<  8;
+                   retnum = (UV) s[uoffset] <<  8;
            }
            else if (size == 32) {
-               if ((STRLEN)offset >= srclen)
+               if (uoffset >= srclen)
                    retnum = 0;
-               else if ((STRLEN)(offset + 1) >= srclen)
+               else if (uoffset + 1 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 24);
-               else if ((STRLEN)(offset + 2) >= srclen)
+                       ((UV) s[uoffset    ] << 24);
+               else if (uoffset + 2 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 24) +
-                       ((UV) s[offset + 1] << 16);
+                       ((UV) s[uoffset    ] << 24) +
+                       ((UV) s[uoffset + 1] << 16);
                else
                    retnum =
-                       ((UV) s[offset    ] << 24) +
-                       ((UV) s[offset + 1] << 16) +
-                       (     s[offset + 2] <<  8);
+                       ((UV) s[uoffset    ] << 24) +
+                       ((UV) s[uoffset + 1] << 16) +
+                       (     s[uoffset + 2] <<  8);
            }
 #ifdef UV_IS_QUAD
            else if (size == 64) {
                if (ckWARN(WARN_PORTABLE))
                    Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
                                "Bit vector size > 32 non-portable");
-               if (offset >= srclen)
+               if (uoffset >= srclen)
                    retnum = 0;
-               else if (offset + 1 >= srclen)
+               else if (uoffset + 1 >= srclen)
                    retnum =
-                       (UV) s[offset     ] << 56;
-               else if (offset + 2 >= srclen)
+                       (UV) s[uoffset     ] << 56;
+               else if (uoffset + 2 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48);
-               else if (offset + 3 >= srclen)
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48);
+               else if (uoffset + 3 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48) +
-                       ((UV) s[offset + 2] << 40);
-               else if (offset + 4 >= srclen)
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48) +
+                       ((UV) s[uoffset + 2] << 40);
+               else if (uoffset + 4 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48) +
-                       ((UV) s[offset + 2] << 40) +
-                       ((UV) s[offset + 3] << 32);
-               else if (offset + 5 >= srclen)
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48) +
+                       ((UV) s[uoffset + 2] << 40) +
+                       ((UV) s[uoffset + 3] << 32);
+               else if (uoffset + 5 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48) +
-                       ((UV) s[offset + 2] << 40) +
-                       ((UV) s[offset + 3] << 32) +
-                       (     s[offset + 4] << 24);
-               else if (offset + 6 >= srclen)
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48) +
+                       ((UV) s[uoffset + 2] << 40) +
+                       ((UV) s[uoffset + 3] << 32) +
+                       (     s[uoffset + 4] << 24);
+               else if (uoffset + 6 >= srclen)
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48) +
-                       ((UV) s[offset + 2] << 40) +
-                       ((UV) s[offset + 3] << 32) +
-                       ((UV) s[offset + 4] << 24) +
-                       ((UV) s[offset + 5] << 16);
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48) +
+                       ((UV) s[uoffset + 2] << 40) +
+                       ((UV) s[uoffset + 3] << 32) +
+                       ((UV) s[uoffset + 4] << 24) +
+                       ((UV) s[uoffset + 5] << 16);
                else
                    retnum =
-                       ((UV) s[offset    ] << 56) +
-                       ((UV) s[offset + 1] << 48) +
-                       ((UV) s[offset + 2] << 40) +
-                       ((UV) s[offset + 3] << 32) +
-                       ((UV) s[offset + 4] << 24) +
-                       ((UV) s[offset + 5] << 16) +
-                       (     s[offset + 6] <<  8);
+                       ((UV) s[uoffset    ] << 56) +
+                       ((UV) s[uoffset + 1] << 48) +
+                       ((UV) s[uoffset + 2] << 40) +
+                       ((UV) s[uoffset + 3] << 32) +
+                       ((UV) s[uoffset + 4] << 24) +
+                       ((UV) s[uoffset + 5] << 16) +
+                       (     s[uoffset + 6] <<  8);
            }
 #endif
        }
     }
     else if (size < 8)
-       retnum = (s[offset >> 3] >> (offset & 7)) & ((1 << size) - 1);
+       retnum = (s[uoffset >> 3] >> (uoffset & 7)) & ((1 << size) - 1);
     else {
-       offset >>= 3;   /* turn into byte offset */
+       uoffset >>= 3;  /* turn into byte offset */
        if (size == 8)
-           retnum = s[offset];
+           retnum = s[uoffset];
        else if (size == 16)
            retnum =
-               ((UV) s[offset] <<      8) +
-                     s[offset + 1];
+               ((UV) s[uoffset] <<      8) +
+                     s[uoffset + 1];
        else if (size == 32)
            retnum =
-               ((UV) s[offset    ] << 24) +
-               ((UV) s[offset + 1] << 16) +
-               (     s[offset + 2] <<  8) +
-                     s[offset + 3];
+               ((UV) s[uoffset    ] << 24) +
+               ((UV) s[uoffset + 1] << 16) +
+               (     s[uoffset + 2] <<  8) +
+                     s[uoffset + 3];
 #ifdef UV_IS_QUAD
        else if (size == 64) {
            if (ckWARN(WARN_PORTABLE))
                Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
                            "Bit vector size > 32 non-portable");
            retnum =
-               ((UV) s[offset    ] << 56) +
-               ((UV) s[offset + 1] << 48) +
-               ((UV) s[offset + 2] << 40) +
-               ((UV) s[offset + 3] << 32) +
-               ((UV) s[offset + 4] << 24) +
-               ((UV) s[offset + 5] << 16) +
-               (     s[offset + 6] <<  8) +
-                     s[offset + 7];
+               ((UV) s[uoffset    ] << 56) +
+               ((UV) s[uoffset + 1] << 48) +
+               ((UV) s[uoffset + 2] << 40) +
+               ((UV) s[uoffset + 3] << 32) +
+               ((UV) s[uoffset + 4] << 24) +
+               ((UV) s[uoffset + 5] << 16) +
+               (     s[uoffset + 6] <<  8) +
+                     s[uoffset + 7];
        }
 #endif
     }
@@ -1153,13 +1153,13 @@
     STRLEN rightlen;
     register const char *lc;
     register const char *rc;
-    register I32 len;
-    I32 lensave;
+    register STRLEN len;
+    STRLEN lensave;
     const char *lsave;
     const char *rsave;
     bool left_utf;
     bool right_utf;
-    I32 needlen = 0;
+    STRLEN needlen = 0;
 
 
     if (sv != left || (optype != OP_BIT_AND && !SvOK(sv) && !SvGMAGICAL(sv)))
@@ -1199,16 +1199,16 @@
     }
     else if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
        dc = SvPV_force_nomg_nolen(sv);
-       if (SvLEN(sv) < (STRLEN)(len + 1)) {
-           dc = SvGROW(sv, (STRLEN)(len + 1));
+       if (SvLEN(sv) < len + 1) {
+           dc = SvGROW(sv, len + 1);
            (void)memzero(dc + SvCUR(sv), len - SvCUR(sv) + 1);
        }
        if (optype != OP_BIT_AND && (left_utf || right_utf))
            dc = SvGROW(sv, leftlen + rightlen + 1);
     }
     else {
-       needlen = ((optype == OP_BIT_AND)
-                   ? len : (leftlen > rightlen ? leftlen : rightlen));
+       needlen = optype == OP_BIT_AND
+                   ? len : (leftlen > rightlen ? leftlen : rightlen);
        Newxz(dc, needlen + 1, char);
        sv_usepvn_flags(sv, dc, needlen, SV_HAS_TRAILING_NUL);
        dc = SvPVX(sv);         /* sv_usepvn() calls Renew() */
@@ -1288,11 +1288,11 @@
     else
 #ifdef LIBERAL
     if (len >= sizeof(long)*4 &&
-       !((long)dc % sizeof(long)) &&
-       !((long)lc % sizeof(long)) &&
-       !((long)rc % sizeof(long)))     /* It's almost always aligned... */
+       !((unsigned long)dc % sizeof(long)) &&
+       !((unsigned long)lc % sizeof(long)) &&
+       !((unsigned long)rc % sizeof(long)))    /* It's almost always 
aligned... */
     {
-       const I32 remainder = len % (sizeof(long)*4);
+       const STRLEN remainder = len % (sizeof(long)*4);
        len /= (sizeof(long)*4);
 
        dl = (long*)dc;
@@ -1348,7 +1348,7 @@
                *dc++ = *lc++ | *rc++;
          mop_up:
            len = lensave;
-           if (rightlen > (STRLEN)len)
+           if (rightlen > len)
                sv_catpvn(sv, rsave + len, rightlen - len);
            else if (leftlen > (STRLEN)len)
                sv_catpvn(sv, lsave + len, leftlen - len);

==== //depot/maint-5.8/perl/dump.c#67 (text) ====
Index: perl/dump.c
--- perl/dump.c#66~29955~       2007-01-24 10:58:36.000000000 -0800
+++ perl/dump.c 2007-01-24 14:51:14.000000000 -0800
@@ -1255,7 +1255,7 @@
        if (HvARRAY(sv) && HvKEYS(sv)) {
            /* Show distribution of HEs in the ARRAY */
            int freq[200];
-#define FREQ_MAX (sizeof freq / sizeof freq[0] - 1)
+#define FREQ_MAX ((int)(sizeof freq / sizeof freq[0] - 1))
            int i;
            int max = 0;
            U32 pow2 = 2, keys = HvKEYS(sv);

==== //depot/maint-5.8/perl/gv.c#89 (text) ====
Index: perl/gv.c
--- perl/gv.c#88~29958~ 2007-01-24 11:49:21.000000000 -0800
+++ perl/gv.c   2007-01-24 14:51:14.000000000 -0800
@@ -805,7 +805,7 @@
                char smallbuf[128];
                char *tmpbuf;
 
-               if (len + 3 < sizeof (smallbuf))
+               if (len + 3 < (I32)sizeof (smallbuf))
                    tmpbuf = smallbuf;
                else
                    Newx(tmpbuf, len+3, char);

==== //depot/maint-5.8/perl/handy.h#45 (text) ====
Index: perl/handy.h
--- perl/handy.h#44~29928~      2007-01-22 15:12:43.000000000 -0800
+++ perl/handy.h        2007-01-24 14:51:14.000000000 -0800
@@ -644,7 +644,7 @@
 #ifdef PERL_MALLOC_WRAP
 #define MEM_WRAP_CHECK(n,t) MEM_WRAP_CHECK_1(n,t,PL_memory_wrap)
 #define MEM_WRAP_CHECK_1(n,t,a) \
-       (void)(sizeof(t) > 1 && (n) > ((MEM_SIZE)~0)/sizeof(t) && 
(Perl_croak_nocontext(a),0))
+       (void)(sizeof(t) > 1 && (MEM_SIZE)(n) > ((MEM_SIZE)~0)/sizeof(t) && 
(Perl_croak_nocontext(a),0))
 #define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),
 
 #define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > (MEM_SIZE)~0 - 2 * 
PERL_STRLEN_ROUNDUP_QUANTUM) ? 
(Perl_croak_nocontext(PL_memory_wrap),0):0),((n-1+PERL_STRLEN_ROUNDUP_QUANTUM)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1)))

==== //depot/maint-5.8/perl/mg.c#133 (text) ====
Index: perl/mg.c
--- perl/mg.c#132~29947~        2007-01-24 05:54:09.000000000 -0800
+++ perl/mg.c   2007-01-24 14:51:14.000000000 -0800
@@ -1110,7 +1110,7 @@
                s = delimcpy(tmpbuf, tmpbuf + sizeof tmpbuf,
                             (char *) s, (char *) strend, ':', &i);
                s++;
-               if (i >= sizeof tmpbuf   /* too long -- assume the worst */
+               if (i >= (I32)sizeof tmpbuf   /* too long -- assume the worst */
                      || *tmpbuf != '/'
                      || (PerlLIO_stat(tmpbuf, &st) == 0 && (st.st_mode & 2)) ) 
{
                    MgTAINTEDDIR_on(mg);

==== //depot/maint-5.8/perl/op.c#175 (text) ====
Index: perl/op.c
--- perl/op.c#174~29959~        2007-01-24 12:33:04.000000000 -0800
+++ perl/op.c   2007-01-24 14:51:14.000000000 -0800
@@ -6860,7 +6860,7 @@
            if ((!SvFAKE(sv = *svp) || !SvREADONLY(sv)) && !IS_PADCONST(sv)) {
                key = SvPV_const(sv, keylen);
                lexname = newSVpvn_share(key,
-                                        SvUTF8(sv) ? -(I32)keylen : keylen,
+                                        SvUTF8(sv) ? -(I32)keylen : 
(I32)keylen,
                                         0);
                SvREFCNT_dec(sv);
                *svp = lexname;
@@ -6880,7 +6880,7 @@
                break;
            key = SvPV_const(*svp, keylen);
            indsvp = hv_fetch(GvHV(*fields), key,
-                             SvUTF8(*svp) ? -(I32)keylen : keylen, FALSE);
+                             SvUTF8(*svp) ? -(I32)keylen : (I32)keylen, FALSE);
            if (!indsvp) {
                Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" "
                           "in variable %s of type %s",
@@ -6948,7 +6948,8 @@
                svp = cSVOPx_svp(key_op);
                key = SvPV_const(*svp, keylen);
                indsvp = hv_fetch(GvHV(*fields), key,
-                                 SvUTF8(*svp) ? -(I32)keylen : keylen, FALSE);
+                                 SvUTF8(*svp) ? -(I32)keylen : (I32)keylen,
+                                 FALSE);
                if (!indsvp) {
                    Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" "
                               "in variable %s of type %s",

==== //depot/maint-5.8/perl/patchlevel.h#184 (text) ====
Index: perl/patchlevel.h
--- perl/patchlevel.h#183~29918~        2007-01-22 09:29:45.000000000 -0800
+++ perl/patchlevel.h   2007-01-24 14:51:14.000000000 -0800
@@ -129,7 +129,7 @@
 
 /* Initial space prevents this variable from being inserted in config.sh  */
 #  define      LOCAL_PATCH_COUNT       \
-       (sizeof(local_patches)/sizeof(local_patches[0])-2)
+       ((int)(sizeof(local_patches)/sizeof(local_patches[0])-2))
 
 /* the old terms of reference, add them only when explicitly included */
 #define PATCHLEVEL             PERL_VERSION

==== //depot/maint-5.8/perl/perl.c#192 (text) ====
Index: perl/perl.c
--- perl/perl.c#191~29943~      2007-01-24 04:06:54.000000000 -0800
+++ perl/perl.c 2007-01-24 14:51:14.000000000 -0800
@@ -3388,7 +3388,7 @@
            PerlIO_printf(PerlIO_stdout(),
                          "\n(with %d registered patch%s, "
                          "see perl -V for more detail)",
-                         (int)LOCAL_PATCH_COUNT,
+                         LOCAL_PATCH_COUNT,
                          (LOCAL_PATCH_COUNT!=1) ? "es" : "");
 #endif
 

==== //depot/maint-5.8/perl/perlio.c#89 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#88~29958~     2007-01-24 11:49:21.000000000 -0800
+++ perl/perlio.c       2007-01-24 14:51:14.000000000 -0800
@@ -2091,7 +2091,7 @@
            SSize_t avail = PerlIO_get_cnt(f);
            SSize_t take = 0;
            if (avail > 0)
-               take = ((SSize_t)count < avail) ? count : avail;
+               take = ((SSize_t)count < avail) ? (SSize_t)count : avail;
            if (take > 0) {
                STDCHAR *ptr = PerlIO_get_ptr(f);
                Copy(ptr, buf, take, STDCHAR);

==== //depot/maint-5.8/perl/pp.c#125 (text) ====
Index: perl/pp.c
--- perl/pp.c#124~29959~        2007-01-24 12:33:04.000000000 -0800
+++ perl/pp.c   2007-01-24 14:51:14.000000000 -0800
@@ -2510,7 +2510,7 @@
            for ( ; anum && (unsigned long)tmps % sizeof(long); anum--, tmps++)
                *tmps = ~*tmps;
            tmpl = (long*)tmps;
-           for ( ; anum >= sizeof(long); anum -= sizeof(long), tmpl++)
+           for ( ; anum >= (I32)sizeof(long); anum -= (I32)sizeof(long), 
tmpl++)
                *tmpl = ~*tmpl;
            tmps = (U8*)tmpl;
        }
@@ -4508,7 +4508,7 @@
     register SV *dstr;
     register const char *m;
     I32 iters = 0;
-    const STRLEN slen = do_utf8 ? utf8_length((U8*)s, (U8*)strend) : (strend - 
s);
+    const STRLEN slen = do_utf8 ? utf8_length((U8*)s, (U8*)strend) : 
(STRLEN)(strend - s);
     I32 maxiters = slen + 10;
     const char *orig;
     const I32 origlimit = limit;

==== //depot/maint-5.8/perl/pp_ctl.c#155 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#154~29959~    2007-01-24 12:33:04.000000000 -0800
+++ perl/pp_ctl.c       2007-01-24 14:51:14.000000000 -0800
@@ -3937,6 +3937,10 @@
     const char *got_p;
     const char *prune_from = NULL;
     bool read_from_cache = FALSE;
+    STRLEN umaxlen;
+
+    assert(maxlen >= 0);
+    umaxlen = maxlen;
 
     /* I was having segfault trouble under Linux 2.2.5 after a
        parse error occured.  (Had to hack around it with a test
@@ -3950,13 +3954,13 @@
            const char *cache_p = SvPV(cache, cache_len);
            STRLEN take = 0;
 
-           if (maxlen) {
+           if (umaxlen) {
                /* Running in block mode and we have some cached data already.
                 */
-               if (cache_len >= maxlen) {
+               if (cache_len >= umaxlen) {
                    /* In fact, so much data we don't even need to call
                       filter_read.  */
-                   take = maxlen;
+                   take = umaxlen;
                }
            } else {
                const char *const first_nl = memchr(cache_p, '\n', cache_len);
@@ -3972,8 +3976,8 @@
            }
 
            sv_catsv(buf_sv, cache);
-           if (maxlen) {
-               maxlen -= cache_len;
+           if (umaxlen) {
+               umaxlen -= cache_len;
            }
            SvOK_off(cache);
            read_from_cache = TRUE;
@@ -4026,9 +4030,9 @@
 
     if(SvOK(upstream)) {
        got_p = SvPV(upstream, got_len);
-       if (maxlen) {
-           if (got_len > maxlen) {
-               prune_from = got_p + maxlen;
+       if (umaxlen) {
+           if (got_len > umaxlen) {
+               prune_from = got_p + umaxlen;
            }
        } else {
            const char *const first_nl = memchr(got_p, '\n', got_len);
@@ -4044,7 +4048,7 @@
        SV *cache = (SV *)IoFMT_GV(datasv);
 
        if (!cache) {
-           IoFMT_GV(datasv) = (GV*) (cache = newSV(got_len - maxlen));
+           IoFMT_GV(datasv) = (GV*) (cache = newSV(got_len - umaxlen));
        } else if (SvOK(cache)) {
            /* Cache should be empty.  */
            assert(!SvCUR(cache));

==== //depot/maint-5.8/perl/pp_hot.c#120 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#119~29958~    2007-01-24 11:49:21.000000000 -0800
+++ perl/pp_hot.c       2007-01-24 14:51:14.000000000 -0800
@@ -1824,7 +1824,7 @@
                    STRLEN keylen;
                    const char * const key = SvPV_const(keysv, keylen);
                    SAVEDELETE(hv, savepvn(key,keylen),
-                              SvUTF8(keysv) ? -(I32)keylen : keylen);
+                              SvUTF8(keysv) ? -(I32)keylen : (I32)keylen);
                } else
                    save_helem(hv, keysv, svp);
             }

==== //depot/maint-5.8/perl/pp_sys.c#128 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#127~29949~    2007-01-24 07:28:38.000000000 -0800
+++ perl/pp_sys.c       2007-01-24 14:51:14.000000000 -0800
@@ -4028,7 +4028,8 @@
            SP = ORIGMARK;
            if (did_pipes) {
                int errkid;
-               int n = 0, n1;
+               unsigned n = 0;
+               SSize_t n1;
 
                while (n < sizeof(int)) {
                    n1 = PerlLIO_read(pp[0],

==== //depot/maint-5.8/perl/regcomp.c#87 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#86~29958~    2007-01-24 11:49:21.000000000 -0800
+++ perl/regcomp.c      2007-01-24 14:51:14.000000000 -0800
@@ -4777,7 +4777,7 @@
        }
 
        if (o->flags & ANYOF_CLASS)
-           for (i = 0; i < sizeof(anyofs)/sizeof(char*); i++)
+           for (i = 0; i < (int)(sizeof(anyofs)/sizeof(char*)); i++)
                if (ANYOF_CLASS_TEST(o,i))
                    sv_catpv(sv, anyofs[i]);
 

==== //depot/maint-5.8/perl/regexec.c#76 (text) ====
Index: perl/regexec.c
--- perl/regexec.c#75~29958~    2007-01-24 11:49:21.000000000 -0800
+++ perl/regexec.c      2007-01-24 14:51:14.000000000 -0800
@@ -246,7 +246,7 @@
        );
     }
     DEBUG_r(
-       if ((I32)(*PL_reglastparen + 1) <= PL_regnpar) {
+       if (*PL_reglastparen + 1 <= PL_regnpar) {
            PerlIO_printf(Perl_debug_log,
                          "     restoring \\%"IVdf"..\\%"IVdf" to undef\n",
                          (IV)(*PL_reglastparen + 1), (IV)PL_regnpar);
@@ -263,7 +263,7 @@
      * building DynaLoader will fail:
      * "Error: '*' not in typemap in DynaLoader.xs, line 164"
      * --jhi */
-    for (i = *PL_reglastparen + 1; i <= PL_regnpar; i++) {
+    for (i = *PL_reglastparen + 1; (U32)i <= PL_regnpar; i++) {
        if (i > PL_regsize)
            PL_regstartp[i] = -1;
        PL_regendp[i] = -1;
@@ -410,7 +410,7 @@
                         sv_uni_display(dsv, sv, 60, UNI_DISPLAY_REGEX) :
                         strpos;
         const int   len = PL_reg_match_utf8 ?
-                        strlen(s) : strend - strpos;
+                        (int)strlen(s) : strend - strpos;
         if (!PL_colorset)
              reginitcolors();
         if (PL_reg_match_utf8)
@@ -1173,7 +1173,7 @@
                LOAD_UTF8_CHARCLASS_ALNUM();
                while (s + (uskip = UTF8SKIP(s)) <= strend) {
                    if (tmp == !(OP(c) == BOUND ?
-                                swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
+                                (bool)swash_fetch(PL_utf8_alnum, (U8*)s, 
do_utf8) :
                                 isALNUM_LC_utf8((U8*)s)))
                    {
                        tmp = !tmp;
@@ -1215,7 +1215,7 @@
                LOAD_UTF8_CHARCLASS_ALNUM();
                while (s + (uskip = UTF8SKIP(s)) <= strend) {
                    if (tmp == !(OP(c) == NBOUND ?
-                                swash_fetch(PL_utf8_alnum, (U8*)s, do_utf8) :
+                                (bool)swash_fetch(PL_utf8_alnum, (U8*)s, 
do_utf8) :
                                 isALNUM_LC_utf8((U8*)s)))
                        tmp = !tmp;
                    else if ((norun || regtry(prog, s)))
@@ -1720,10 +1720,10 @@
            ? pv_uni_display(dsv0, (U8*)prog->precomp, prog->prelen, 60,
                          UNI_DISPLAY_REGEX)
            : prog->precomp;
-       const int len0 = UTF ? SvCUR(dsv0) : prog->prelen;
+       const int len0 = UTF ? (int)SvCUR(dsv0) : prog->prelen;
        const char * const s1 = do_utf8 ? sv_uni_display(dsv1, sv, 60,
                                               UNI_DISPLAY_REGEX) : startpos;
-       const int len1 = do_utf8 ? SvCUR(dsv1) : strend - startpos;
+       const int len1 = do_utf8 ? (int)SvCUR(dsv1) : strend - startpos;
         if (!PL_colorset)
             reginitcolors();
         PerlIO_printf(Perl_debug_log,
@@ -1941,7 +1941,7 @@
            len0 = UTF ? SvCUR(dsv0) : SvCUR(prop);
            s1 = UTF ?
              sv_uni_display(dsv1, sv, 60, UNI_DISPLAY_REGEX) : s;
-           len1 = UTF ? SvCUR(dsv1) : strend - s;
+           len1 = UTF ? (int)SvCUR(dsv1) : strend - s;
            PerlIO_printf(Perl_debug_log,
                          "Matching stclass \"%*.*s\" against \"%*.*s\"\n",
                          len0, len0, s0,
@@ -2362,17 +2362,17 @@
                pv_uni_display(dsv0, (U8*)(locinput - pref_len),
                               pref0_len, 60, UNI_DISPLAY_REGEX) :
                locinput - pref_len;
-             const int len0 = do_utf8 ? strlen(s0) : pref0_len;
+             const int len0 = do_utf8 ? (int)strlen(s0) : pref0_len;
              const char * const s1 = do_utf8 && OP(scan) != CANY ?
                pv_uni_display(dsv1, (U8*)(locinput - pref_len + pref0_len),
                               pref_len - pref0_len, 60, UNI_DISPLAY_REGEX) :
                locinput - pref_len + pref0_len;
-             const int len1 = do_utf8 ? strlen(s1) : pref_len - pref0_len;
+             const int len1 = do_utf8 ? (int)strlen(s1) : pref_len - pref0_len;
              const char * const s2 = do_utf8 && OP(scan) != CANY ?
                pv_uni_display(dsv2, (U8*)locinput,
                               PL_regeol - locinput, 60, UNI_DISPLAY_REGEX) :
                locinput;
-             const int len2 = do_utf8 ? strlen(s2) : l;
+             const int len2 = do_utf8 ? (int)strlen(s2) : l;
              PerlIO_printf(Perl_debug_log,
                            "%4"IVdf" 
<%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3"IVdf":%*s%s\n",
                            (IV)(locinput - PL_bostr),
@@ -2612,7 +2612,7 @@
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_ALNUM();
                if (!(OP(scan) == ALNUM
-                     ? swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
+                     ? (bool)swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
                      : isALNUM_LC_utf8((U8*)locinput)))
                {
                    sayNO;
@@ -2635,7 +2635,7 @@
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_ALNUM();
                if (OP(scan) == NALNUM
-                   ? swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_alnum, (U8*)locinput, do_utf8)
                    : isALNUM_LC_utf8((U8*)locinput))
                {
                    sayNO;
@@ -2700,7 +2700,7 @@
                if (UTF8_IS_CONTINUED(nextchr)) {
                    LOAD_UTF8_CHARCLASS_SPACE();
                    if (!(OP(scan) == SPACE
-                         ? swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
+                         ? (bool)swash_fetch(PL_utf8_space, (U8*)locinput, 
do_utf8)
                          : isSPACE_LC_utf8((U8*)locinput)))
                    {
                        sayNO;
@@ -2730,7 +2730,7 @@
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_SPACE();
                if (OP(scan) == NSPACE
-                   ? swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_space, (U8*)locinput, do_utf8)
                    : isSPACE_LC_utf8((U8*)locinput))
                {
                    sayNO;
@@ -2753,7 +2753,7 @@
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_DIGIT();
                if (!(OP(scan) == DIGIT
-                     ? swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
+                     ? (bool)swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
                      : isDIGIT_LC_utf8((U8*)locinput)))
                {
                    sayNO;
@@ -2776,7 +2776,7 @@
            if (do_utf8) {
                LOAD_UTF8_CHARCLASS_DIGIT();
                if (OP(scan) == NDIGIT
-                   ? swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
+                   ? (bool)swash_fetch(PL_utf8_digit, (U8*)locinput, do_utf8)
                    : isDIGIT_LC_utf8((U8*)locinput))
                {
                    sayNO;

==== //depot/maint-5.8/perl/scope.h#23 (text) ====
Index: perl/scope.h
--- perl/scope.h#22~29953~      2007-01-24 09:01:34.000000000 -0800
+++ perl/scope.h        2007-01-24 14:51:14.000000000 -0800
@@ -61,8 +61,8 @@
 #define SCOPE_SAVES_SIGNAL_MASK 0
 #endif
 
-#define SSCHECK(need) if (PL_savestack_ix + (need) > PL_savestack_max) 
savestack_grow()
-#define SSGROW(need) if (PL_savestack_ix + (need) > PL_savestack_max) 
savestack_grow_cnt(need)
+#define SSCHECK(need) if (PL_savestack_ix + (I32)(need) > PL_savestack_max) 
savestack_grow()
+#define SSGROW(need) if (PL_savestack_ix + (I32)(need) > PL_savestack_max) 
savestack_grow_cnt(need)
 #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
 #define SSPUSHLONG(i) (PL_savestack[PL_savestack_ix++].any_long = (long)(i))
 #define SSPUSHBOOL(p) (PL_savestack[PL_savestack_ix++].any_bool = (p))

==== //depot/maint-5.8/perl/sv.c#313 (text) ====
Index: perl/sv.c
--- perl/sv.c#312~29958~        2007-01-24 11:49:21.000000000 -0800
+++ perl/sv.c   2007-01-24 14:51:14.000000000 -0800
@@ -5971,7 +5971,7 @@
             *
             * - jik 9/25/96
             */
-           if (!(cnt < sizeof(buf) && PerlIO_eof(fp)))
+           if (!(cnt < (I32)sizeof(buf) && PerlIO_eof(fp)))
                goto screamer2;
        }
 
@@ -10340,7 +10340,7 @@
     SvREFCNT(&PL_sv_no)                = (~(U32)0)/2;
     SvFLAGS(&PL_sv_no)         = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK
                                  |SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
-    SvPV_set(&PL_sv_no, SAVEPVN(PL_No, 0));
+    SvPV_set(&PL_sv_no, savepvn(PL_No, 0));
     SvCUR_set(&PL_sv_no, 0);
     SvLEN_set(&PL_sv_no, 1);
     SvIV_set(&PL_sv_no, 0);
@@ -10351,7 +10351,7 @@
     SvREFCNT(&PL_sv_yes)       = (~(U32)0)/2;
     SvFLAGS(&PL_sv_yes)                = SVp_IOK|SVf_IOK|SVp_NOK|SVf_NOK
                                  |SVp_POK|SVf_POK|SVf_READONLY|SVt_PVNV;
-    SvPV_set(&PL_sv_yes, SAVEPVN(PL_Yes, 1));
+    SvPV_set(&PL_sv_yes, savepvn(PL_Yes, 1));
     SvCUR_set(&PL_sv_yes, 1);
     SvLEN_set(&PL_sv_yes, 2);
     SvIV_set(&PL_sv_yes, 1);

==== //depot/maint-5.8/perl/toke.c#145 (text) ====
Index: perl/toke.c
--- perl/toke.c#144~29961~      2007-01-24 14:12:24.000000000 -0800
+++ perl/toke.c 2007-01-24 14:51:14.000000000 -0800
@@ -9794,7 +9794,7 @@
        or if it didn't end, or if we see a newline
     */
 
-    if (len >= sizeof PL_tokenbuf)
+    if (len >= (I32)sizeof PL_tokenbuf)
        Perl_croak(aTHX_ "Excessively long <> operator");
     if (s >= end)
        Perl_croak(aTHX_ "Unterminated <> operator");

==== //depot/maint-5.8/perl/util.c#127 (text) ====
Index: perl/util.c
--- perl/util.c#126~29955~      2007-01-24 10:58:36.000000000 -0800
+++ perl/util.c 2007-01-24 14:51:14.000000000 -0800
@@ -1873,8 +1873,8 @@
                type value;                                     \
                char c[sizeof(type)];                           \
            } u;                                                \
-           register I32 i;                                     \
-           register I32 s = 0;                                 \
+           register U32 i;                                     \
+           register U32 s = 0;                                 \
            for (i = 0; i < sizeof(u.c); i++, s += 8) {         \
                u.c[i] = (n >> s) & 0xFF;                       \
            }                                                   \
@@ -1889,8 +1889,8 @@
                type value;                                     \
                char c[sizeof(type)];                           \
            } u;                                                \
-           register I32 i;                                     \
-           register I32 s = 0;                                 \
+           register U32 i;                                     \
+           register U32 s = 0;                                 \
            u.value = n;                                        \
            n = 0;                                              \
            for (i = 0; i < sizeof(u.c); i++, s += 8) {         \
@@ -1911,8 +1911,8 @@
                type value;                                     \
                char c[sizeof(type)];                           \
            } u;                                                \
-           register I32 i;                                     \
-           register I32 s = 8*(sizeof(u.c)-1);                 \
+           register U32 i;                                     \
+           register U32 s = 8*(sizeof(u.c)-1);                 \
            for (i = 0; i < sizeof(u.c); i++, s -= 8) {         \
                u.c[i] = (n >> s) & 0xFF;                       \
            }                                                   \
@@ -1927,8 +1927,8 @@
                type value;                                     \
                char c[sizeof(type)];                           \
            } u;                                                \
-           register I32 i;                                     \
-           register I32 s = 8*(sizeof(u.c)-1);                 \
+           register U32 i;                                     \
+           register U32 s = 8*(sizeof(u.c)-1);                 \
            u.value = n;                                        \
            n = 0;                                              \
            for (i = 0; i < sizeof(u.c); i++, s -= 8) {         \
@@ -2202,7 +2202,8 @@
     /* If we managed to get status pipe check for exec fail */
     if (did_pipes && pid > 0) {
        int errkid;
-       int n = 0, n1;
+       unsigned n = 0;
+       SSize_t n1;
 
        while (n < sizeof(int)) {
            n1 = PerlLIO_read(pp[0],
@@ -2351,7 +2352,8 @@
     PL_forkprocess = pid;
     if (did_pipes && pid > 0) {
        int errkid;
-       int n = 0, n1;
+       unsigned n = 0;
+       SSize_t n1;
 
        while (n < sizeof(int)) {
            n1 = PerlLIO_read(pp[0],
End of Patch.

Reply via email to