format/casting/warning RE: perl 5.9.1
Robin Barker [Wed, 17 Mar 2004 18:37:10 +0000 (18:37 +0000)]
Message-ID: <533D273D4014D411AB1D00062938C4D90404682E@hotel.npl.co.uk>

p4raw-id: //depot/perl@22521

dump.c
ext/Socket/Socket.xs
pad.c
util.c

diff --git a/dump.c b/dump.c
index eedd990..1847974 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -412,13 +412,13 @@ sequence(pTHX_ register OP *o)
     if (!o)
        return;
 
-    op = newSVuv((UV) o);
+    op = newSVuv(PTR2UV(o));
     key = SvPV(op, len);
     if (hv_exists(Sequence, key, len))
        return;
 
     for (; o; o = o->op_next) {
-       op = newSVuv((UV) o);
+       op = newSVuv(PTR2UV(o));
        key = SvPV(op, len);
        if (hv_exists(Sequence, key, len))
            break;
@@ -501,7 +501,7 @@ sequence_num(pTHX_ OP *o)
     char   *key;
     STRLEN  len;
     if (!o) return 0;
-    op = newSVuv((UV) o);
+    op = newSVuv(PTR2UV(o));
     key = SvPV(op, len);
     seq = hv_fetch(Sequence, key, len, 0);
     return seq ? SvUV(*seq): 0;
@@ -516,14 +516,15 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
     level++;
     seq = sequence_num(aTHX_ o);
     if (seq)
-       PerlIO_printf(file, "%-4d", seq);
+       PerlIO_printf(file, "%-4"UVf, 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 ? "%d\n" : "(%d)\n", sequence_num(aTHX_ o->op_next));
+       PerlIO_printf(file, seq ? "%"UVf"\n" : "(%"UVf")\n",
+                               sequence_num(aTHX_ o->op_next));
     else
        PerlIO_printf(file, "DONE\n");
     if (o->op_targ) {
@@ -795,17 +796,17 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
     case OP_ENTERLOOP:
        Perl_dump_indent(aTHX_ level, file, "REDO ===> ");
        if (cLOOPo->op_redoop)
-           PerlIO_printf(file, "%d\n", sequence_num(aTHX_ cLOOPo->op_redoop));
+           PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_redoop));
        else
            PerlIO_printf(file, "DONE\n");
        Perl_dump_indent(aTHX_ level, file, "NEXT ===> ");
        if (cLOOPo->op_nextop)
-           PerlIO_printf(file, "%d\n", sequence_num(aTHX_ cLOOPo->op_nextop));
+           PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_nextop));
        else
            PerlIO_printf(file, "DONE\n");
        Perl_dump_indent(aTHX_ level, file, "LAST ===> ");
        if (cLOOPo->op_lastop)
-           PerlIO_printf(file, "%d\n", sequence_num(aTHX_ cLOOPo->op_lastop));
+           PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOOPo->op_lastop));
        else
            PerlIO_printf(file, "DONE\n");
        break;
@@ -817,7 +818,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
     case OP_AND:
        Perl_dump_indent(aTHX_ level, file, "OTHER ===> ");
        if (cLOGOPo->op_other)
-           PerlIO_printf(file, "%d\n", sequence_num(aTHX_ cLOGOPo->op_other));
+           PerlIO_printf(file, "%"UVf"\n", sequence_num(aTHX_ cLOGOPo->op_other));
        else
            PerlIO_printf(file, "DONE\n");
        break;
index d2c0ae5..5644340 100644 (file)
@@ -376,7 +376,7 @@ unpack_sockaddr_un(sun_sv)
        e = (char*)addr.sun_path;
        /* On Linux, the name of abstract unix domain sockets begins
         * with a '\0', so allow this. */
-       while ((*e || e == addr.sun_path && e[1] && sockaddrlen > 1)
+       while ((*e || (e == addr.sun_path && e[1] && sockaddrlen > 1))
                && e < (char*)addr.sun_path + sizeof addr.sun_path)
            ++e;
        ST(0) = sv_2mortal(newSVpvn(addr.sun_path, e - (char*)addr.sun_path));
diff --git a/pad.c b/pad.c
index 5c8ce1a..209eb0a 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -1260,7 +1260,7 @@ Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padlist, int full)
        if (namesv) {
            if (SvFAKE(namesv))
                Perl_dump_indent(aTHX_ level+1, file,
-                   "%2d. 0x%"UVxf"<%lu> FAKE \"%s\" flags=0x%x index=%lu\n",
+                   "%2d. 0x%"UVxf"<%lu> FAKE \"%s\" flags=0x%lx index=%lu\n",
                    (int) ix,
                    PTR2UV(ppad[ix]),
                    (unsigned long) (ppad[ix] ? SvREFCNT(ppad[ix]) : 0),
diff --git a/util.c b/util.c
index 6df76a6..e2783b4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3877,11 +3877,11 @@ Perl_vnumify(pTHX_ SV *vs)
        return sv;
     }
     digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
-    Perl_sv_setpvf(aTHX_ sv,"%d.", PERL_ABS(digit));
+    Perl_sv_setpvf(aTHX_ sv,"%d.", (int)PERL_ABS(digit));
     for ( i = 1 ; i <= len ; i++ )
     {
        digit = SvIVX(*av_fetch((AV *)vs, i, 0));
-       Perl_sv_catpvf(aTHX_ sv,"%03d", PERL_ABS(digit));
+       Perl_sv_catpvf(aTHX_ sv,"%03d", (int)PERL_ABS(digit));
     }
     if ( len == 0 )
         Perl_sv_catpv(aTHX_ sv,"000");