; was RE: [PATCH perlio.c pp.c regcomp.c] silence format and comparison warnings
Robin Barker [Fri, 1 Sep 2006 16:10:25 +0000 (17:10 +0100)]
From: "Robin Barker" <Robin.Barker@npl.co.uk>
Message-ID: <2C2E01334A940D4792B3E115F95B7226120A21@exchsvr1.npl.ad.local>

p4raw-id: //depot/perl@28786

dump.c
perl.h
perlio.c
pp.c
pp_pack.c
sv.c
utf8.c

diff --git a/dump.c b/dump.c
index 03bdab3..ce2c7ca 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -711,14 +711,14 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
     level++;
     seq = sequence_num(o);
     if (seq)
-       PerlIO_printf(file, "%-4"UVf, seq);
+       PerlIO_printf(file, "%-4"UVuf, seq);
     else
        PerlIO_printf(file, "    ");
     PerlIO_printf(file,
                  "%*sTYPE = %s  ===> ",
                  (int)(PL_dumpindent*level-4), "", OP_NAME(o));
     if (o->op_next)
-       PerlIO_printf(file, seq ? "%"UVf"\n" : "(%"UVf")\n",
+       PerlIO_printf(file, seq ? "%"UVuf"\n" : "(%"UVuf")\n",
                                sequence_num(o->op_next));
     else
        PerlIO_printf(file, "DONE\n");
@@ -727,7 +727,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
            Perl_dump_indent(aTHX_ level, file, "  (was %s)\n", PL_op_name[o->op_targ]);
            if (o->op_targ == OP_NEXTSTATE) {
                if (CopLINE(cCOPo))
-                   Perl_dump_indent(aTHX_ level, file, "LINE = %"UVf"\n",
+                   Perl_dump_indent(aTHX_ level, file, "LINE = %"UVuf"\n",
                                     (UV)CopLINE(cCOPo));
                if (CopSTASHPV(cCOPo))
                    Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
@@ -1027,7 +1027,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
     case OP_NEXTSTATE:
     case OP_DBSTATE:
        if (CopLINE(cCOPo))
-           Perl_dump_indent(aTHX_ level, file, "LINE = %"UVf"\n",
+           Perl_dump_indent(aTHX_ level, file, "LINE = %"UVuf"\n",
                             (UV)CopLINE(cCOPo));
        if (CopSTASHPV(cCOPo))
            Perl_dump_indent(aTHX_ level, file, "PACKAGE = \"%s\"\n",
@@ -1039,17 +1039,17 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
     case OP_ENTERLOOP:
        Perl_dump_indent(aTHX_ level, file, "REDO ===> ");
        if (cLOOPo->op_redoop)
-           PerlIO_printf(file, "%"UVf"\n", sequence_num(cLOOPo->op_redoop));
+           PerlIO_printf(file, "%"UVuf"\n", sequence_num(cLOOPo->op_redoop));
        else
            PerlIO_printf(file, "DONE\n");
        Perl_dump_indent(aTHX_ level, file, "NEXT ===> ");
        if (cLOOPo->op_nextop)
-           PerlIO_printf(file, "%"UVf"\n", sequence_num(cLOOPo->op_nextop));
+           PerlIO_printf(file, "%"UVuf"\n", sequence_num(cLOOPo->op_nextop));
        else
            PerlIO_printf(file, "DONE\n");
        Perl_dump_indent(aTHX_ level, file, "LAST ===> ");
        if (cLOOPo->op_lastop)
-           PerlIO_printf(file, "%"UVf"\n", sequence_num(cLOOPo->op_lastop));
+           PerlIO_printf(file, "%"UVuf"\n", sequence_num(cLOOPo->op_lastop));
        else
            PerlIO_printf(file, "DONE\n");
        break;
@@ -1061,7 +1061,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
     case OP_AND:
        Perl_dump_indent(aTHX_ level, file, "OTHER ===> ");
        if (cLOGOPo->op_other)
-           PerlIO_printf(file, "%"UVf"\n", sequence_num(cLOGOPo->op_other));
+           PerlIO_printf(file, "%"UVuf"\n", sequence_num(cLOGOPo->op_other));
        else
            PerlIO_printf(file, "DONE\n");
        break;
@@ -2492,7 +2492,7 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
            if (o->op_targ == OP_NEXTSTATE)
            {
                if (CopLINE(cCOPo))
-                   PerlIO_printf(file, " line=\"%"UVf"\"",
+                   PerlIO_printf(file, " line=\"%"UVuf"\"",
                                     (UV)CopLINE(cCOPo));
                if (CopSTASHPV(cCOPo))
                    PerlIO_printf(file, " package=\"%s\"",
@@ -2759,7 +2759,7 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
     case OP_NEXTSTATE:
     case OP_DBSTATE:
        if (CopLINE(cCOPo))
-           S_xmldump_attr(aTHX_ level, file, "line=\"%"UVf"\"",
+           S_xmldump_attr(aTHX_ level, file, "line=\"%"UVuf"\"",
                             (UV)CopLINE(cCOPo));
        if (CopSTASHPV(cCOPo))
            S_xmldump_attr(aTHX_ level, file, "package=\"%s\"",
diff --git a/perl.h b/perl.h
index 7d7e257..665324a 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3015,6 +3015,7 @@ typedef pthread_key_t     perl_key;
 #  endif
 #endif
  
+/* not used; but needed for backward compatibilty with XS code? - RMB */ 
 #ifndef UVf
 #  define UVf UVuf
 #endif
index dcd6138..b6dca82 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -2970,6 +2970,7 @@ PerlIOStdio_invalidate_fileno(pTHX_ FILE *f)
     f->_fileno = -1;
     return 1;
 #  elif defined(__sun__)
+    PERL_UNUSED_ARG(f);
     return 0;
 #  elif defined(__hpux)
     f->__fileH = 0xff;
diff --git a/pp.c b/pp.c
index 78f7adf..4c5c815 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4035,7 +4035,7 @@ PP(pp_hslice)
                        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);
                    }
                }
             }
index f155e34..c898dce 100644 (file)
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1971,7 +1971,7 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
                    if (++bytes >= sizeof(UV)) {        /* promote to string */
                        const char *t;
 
-                       sv = Perl_newSVpvf(aTHX_ "%.*"UVf, (int)TYPE_DIGITS(UV), auv);
+                       sv = Perl_newSVpvf(aTHX_ "%.*"UVuf, (int)TYPE_DIGITS(UV), auv);
                        while (s < strend) {
                            ch = SHIFT_BYTE(utf8, s, strend, datumtype);
                            sv = mul128(sv, (U8)(ch & 0x7f));
diff --git a/sv.c b/sv.c
index 93b6d58..1673341 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5352,8 +5352,8 @@ Perl_sv_len_utf8(pTHX_ register SV *sv)
                        */
                        SAVEI8(PL_utf8cache);
                        PL_utf8cache = 0;
-                       Perl_croak(aTHX_ "panic: sv_len_utf8 cache %"UVf
-                                  " real %"UVf" for %"SVf,
+                       Perl_croak(aTHX_ "panic: sv_len_utf8 cache %"UVuf
+                                  " real %"UVuf" for %"SVf,
                                   (UV) ulen, (UV) real, (void*)sv);
                    }
                }
@@ -5510,8 +5510,8 @@ S_sv_pos_u2b_cached(pTHX_ SV *sv, MAGIC **mgp, const U8 *const start,
                   infinitely while printing error messages.  */
                SAVEI8(PL_utf8cache);
                PL_utf8cache = 0;
-               Perl_croak(aTHX_ "panic: sv_pos_u2b_cache cache %"UVf
-                          " real %"UVf" for %"SVf,
+               Perl_croak(aTHX_ "panic: sv_pos_u2b_cache cache %"UVuf
+                          " real %"UVuf" for %"SVf,
                           (UV) boffset, (UV) real_boffset, (void*)sv);
            }
        }
@@ -5644,8 +5644,8 @@ S_utf8_mg_pos_cache_update(pTHX_ SV *sv, MAGIC **mgp, STRLEN byte, STRLEN utf8,
               infinitely while printing error messages.  */
            SAVEI8(PL_utf8cache);
            PL_utf8cache = 0;
-           Perl_croak(aTHX_ "panic: utf8_mg_pos_cache_update cache %"UVf
-                      " real %"UVf" for %"SVf, (UV) utf8, (UV) realutf8, (void*)sv);
+           Perl_croak(aTHX_ "panic: utf8_mg_pos_cache_update cache %"UVuf
+                      " real %"UVuf" for %"SVf, (UV) utf8, (UV) realutf8, (void*)sv);
        }
     }
 
@@ -5890,8 +5890,8 @@ Perl_sv_pos_b2u(pTHX_ register SV* sv, I32* offsetp)
                   infinitely while printing error messages.  */
                SAVEI8(PL_utf8cache);
                PL_utf8cache = 0;
-               Perl_croak(aTHX_ "panic: sv_pos_b2u cache %"UVf
-                          " real %"UVf" for %"SVf,
+               Perl_croak(aTHX_ "panic: sv_pos_b2u cache %"UVuf
+                          " real %"UVuf" for %"SVf,
                           (UV) len, (UV) real_len, (void*)sv);
            }
        }
diff --git a/utf8.c b/utf8.c
index f3e3633..19f54ca 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -896,7 +896,7 @@ Perl_utf16_to_utf8(pTHX_ U8* p, U8* d, I32 bytelen, I32 *newlen)
     }
 
     if (bytelen & 1)
-       Perl_croak(aTHX_ "panic: utf16_to_utf8: odd bytelen %"UVf, (UV)bytelen);
+       Perl_croak(aTHX_ "panic: utf16_to_utf8: odd bytelen %"UVuf, (UV)bytelen);
 
     pend = p + bytelen;