This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More printf-fixes (see also #4426).
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 23 Oct 1999 21:47:49 +0000 (21:47 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 23 Oct 1999 21:47:49 +0000 (21:47 +0000)
p4raw-id: //depot/cfgperl@4429

15 files changed:
deb.c
dump.c
ext/Data/Dumper/Dumper.xs
malloc.c
mg.c
op.c
perl.c
pp.c
pp_ctl.c
regcomp.c
regexec.c
run.c
scope.c
sv.c
util.c

diff --git a/deb.c b/deb.c
index b6456e6..926b1e6 100644 (file)
--- a/deb.c
+++ b/deb.c
@@ -50,8 +50,8 @@ Perl_vdeb(pTHX_ const char *pat, va_list *args)
     GV* gv = PL_curcop->cop_filegv;
 
 #ifdef USE_THREADS
-    PerlIO_printf(Perl_debug_log, "0x%lx (%s:%ld)\t",
-                 (unsigned long) thr,
+    PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
+                 PTR2UV(thr),
                  SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
                  (long)PL_curcop->cop_line);
 #else
@@ -80,13 +80,16 @@ Perl_debstackptrs(pTHX)
 {
 #ifdef DEBUGGING
     dTHR;
-    PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
-       (unsigned long)PL_curstack, (unsigned long)PL_stack_base,
-       (long)*PL_markstack_ptr, (long)(PL_stack_sp-PL_stack_base),
-       (long)(PL_stack_max-PL_stack_base));
-    PerlIO_printf(Perl_debug_log, "%8lx %8lx %8ld %8ld %8ld\n",
-       (unsigned long)PL_mainstack, (unsigned long)AvARRAY(PL_curstack),
-       (long)PL_mainstack, (long)AvFILLp(PL_curstack), (long)AvMAX(PL_curstack));
+    PerlIO_printf(Perl_debug_log,
+                 "%8"UVxf" %8"UVxf" %8"IVdf" %8"IVdf" %8"IVdf"\n",
+                 PTR2UV(PL_curstack), PTR2UV(PL_stack_base),
+                 (IV)*PL_markstack_ptr, (IV)(PL_stack_sp-PL_stack_base),
+                 (IV)(PL_stack_max-PL_stack_base));
+    PerlIO_printf(Perl_debug_log,
+                 "%8"UVxf" %8"UVxf" %8"UVuf" %8"UVuf" %8"UVuf"\n",
+                 PTR2UV(PL_mainstack), PTR2UV(AvARRAY(PL_curstack)),
+                 PTR2UV(PL_mainstack), PTR2UV(AvFILLp(PL_curstack)),
+                 PTR2UV(AvMAX(PL_curstack)));
 #endif /* DEBUGGING */
     return 0;
 }
@@ -108,8 +111,9 @@ Perl_debstack(pTHX)
            break;
 
 #ifdef USE_THREADS
-    PerlIO_printf(Perl_debug_log, i ? "0x%lx    =>  ...  " : "0x%lx    =>  ",
-                 (unsigned long) thr);
+    PerlIO_printf(Perl_debug_log,
+                 i ? "0x%"UVxf"    =>  ...  " : "0x%lx    =>  ",
+                 PTR2UV(thr));
 #else
     PerlIO_printf(Perl_debug_log, i ? "    =>  ...  " : "    =>  ");
 #endif /* USE_THREADS */
diff --git a/dump.c b/dump.c
index 51c2f8d..a2db415 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -612,7 +612,8 @@ void
 Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
 {
     for (; mg; mg = mg->mg_moremagic) {
-       Perl_dump_indent(aTHX_ level, file, "  MAGIC = 0x%lx\n", (long)mg);
+       Perl_dump_indent(aTHX_ level, file,
+                        "  MAGIC = 0x%"UVxf"\n", PTR2UV(mg));
        if (mg->mg_virtual) {
             MGVTBL *v = mg->mg_virtual;
            char *s = 0;
@@ -646,7 +647,7 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxne
            if (s)
                Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = &PL_vtbl_%s\n", s);
            else
-               Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = 0x%lx\n", (long)v);
+               Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = 0x%"UVxf"\n", PTR2UV(v));
         }
        else
            Perl_dump_indent(aTHX_ level, file, "    MG_VIRTUAL = 0\n");
@@ -671,14 +672,14 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, MAGIC *mg, I32 nest, I32 maxne
                Perl_dump_indent(aTHX_ level, file, "      MINMATCH\n");
         }
        if (mg->mg_obj) {
-           Perl_dump_indent(aTHX_ level, file, "    MG_OBJ = 0x%lx\n", (long)mg->mg_obj);
+           Perl_dump_indent(aTHX_ level, file, "    MG_OBJ = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
            if (mg->mg_flags & MGf_REFCOUNTED)
                do_sv_dump(level+2, file, mg->mg_obj, nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
        }
         if (mg->mg_len)
            Perl_dump_indent(aTHX_ level, file, "    MG_LEN = %d\n", mg->mg_len);
         if (mg->mg_ptr) {
-           Perl_dump_indent(aTHX_ level, file, "    MG_PTR = 0x%lx", (long)mg->mg_ptr);
+           Perl_dump_indent(aTHX_ level, file, "    MG_PTR = 0x%"UVxf, PTR2UV(mg->mg_ptr));
            if (mg->mg_len >= 0) {
                SV *sv = newSVpvn("", 0);
                 PerlIO_printf(file, " %s", pv_display(sv, mg->mg_ptr, mg->mg_len, 0, pvlim));
@@ -705,7 +706,7 @@ Perl_magic_dump(pTHX_ MAGIC *mg)
 void
 Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv)
 {
-    Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+    Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
     if (sv && HvNAME(sv))
        PerlIO_printf(file, "\t\"%s\"\n", HvNAME(sv));
     else
@@ -715,7 +716,7 @@ Perl_do_hv_dump(pTHX_ I32 level, PerlIO *file, char *name, HV *sv)
 void
 Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
 {
-    Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+    Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
     if (sv && GvNAME(sv))
        PerlIO_printf(file, "\t\"%s\"\n", GvNAME(sv));
     else
@@ -725,7 +726,7 @@ Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
 void
 Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
 {
-    Perl_dump_indent(aTHX_ level, file, "%s = 0x%lx", name, (long)sv);
+    Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
     if (sv && GvNAME(sv)) {
        PerlIO_printf(file, "\t\"");
        if (GvSTASH(sv) && HvNAME(GvSTASH(sv)))
index 886c317..6f548bb 100644 (file)
@@ -585,7 +585,7 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
        if (SvIOK(val)) {
             STRLEN len;
            i = SvIV(val);
-            (void) sprintf(tmpbuf, "%d", i);
+            (void) sprintf(tmpbuf, "%"IVdf, (IV)i);
             len = strlen(tmpbuf);
            sv_catpvn(retval, tmpbuf, len);
        }
@@ -839,7 +839,7 @@ Data_Dumper_Dumpxs(href, ...)
                        STRLEN nchars = 0;
                        sv_setpvn(name, "$", 1);
                        sv_catsv(name, varname);
-                       (void) sprintf(tmpbuf, "%"IVdf, (IV)i+1);
+                       (void) sprintf(tmpbuf, "%d", i+1);
                        nchars = strlen(tmpbuf);
                        sv_catpvn(name, tmpbuf, nchars);
                    }
index 3bbbe1c..734ea06 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -1025,16 +1025,17 @@ Perl_malloc(register size_t nbytes)
        }
 
        DEBUG_m(PerlIO_printf(Perl_debug_log,
-                             "0x%lx: (%05lu) malloc %ld bytes\n",
-                             (unsigned long)(p+1), (unsigned long)(PL_an++),
+                             "0x%"UVxf": (%05lu) malloc %ld bytes\n",
+                             PTR2UV(p+1), (unsigned long)(PL_an++),
                              (long)size));
 
        /* remove from linked list */
 #if defined(RCHECK)
        if ((PTR2UV(p)) & (MEM_ALIGNBYTES - 1)) {
            dTHXo;
-           PerlIO_printf(PerlIO_stderr(), "Corrupt malloc ptr 0x%lx at 0x%lx\n",
-               (unsigned long)*((int*)p),(unsigned long)p);
+           PerlIO_printf(PerlIO_stderr(),
+                         "Corrupt malloc ptr 0x%lx at 0x%"UVxf"\n",
+                         (unsigned long)*((int*)p),PTR2UV(p));
        }
 #endif
        nextf[bucket] = p->ov_next;
@@ -1475,8 +1476,8 @@ Perl_mfree(void *mp)
 #endif 
 
        DEBUG_m(PerlIO_printf(Perl_debug_log, 
-                             "0x%lx: (%05lu) free\n",
-                             (unsigned long)cp, (unsigned long)(PL_an++)));
+                             "0x%"UVxf": (%05lu) free\n",
+                             PTR2UV(cp), (unsigned long)(PL_an++)));
 
        if (cp == NULL)
                return;
@@ -1661,8 +1662,8 @@ Perl_realloc(void *mp, size_t nbytes)
 #endif
                res = cp;
                DEBUG_m(PerlIO_printf(Perl_debug_log, 
-                             "0x%lx: (%05lu) realloc %ld bytes inplace\n",
-                             (unsigned long)res,(unsigned long)(PL_an++),
+                             "0x%"UVxf": (%05lu) realloc %ld bytes inplace\n",
+                             PTR2UV(res),(unsigned long)(PL_an++),
                              (long)size));
        } else if (incr == 1 && (cp - M_OVERHEAD == last_op) 
                   && (onb > (1 << LOG_OF_MIN_ARENA))) {
@@ -1697,8 +1698,8 @@ Perl_realloc(void *mp, size_t nbytes)
        } else {
          hard_way:
            DEBUG_m(PerlIO_printf(Perl_debug_log, 
-                             "0x%lx: (%05lu) realloc %ld bytes the hard way\n",
-                             (unsigned long)cp,(unsigned long)(PL_an++),
+                             "0x%"UVxf": (%05lu) realloc %ld bytes the hard way\n",
+                             PTR2UV(cp),(unsigned long)(PL_an++),
                              (long)size));
            if ((res = (char*)Perl_malloc(nbytes)) == NULL)
                return (NULL);
@@ -1969,8 +1970,8 @@ Perl_sbrk(int size)
       }
     }
 
-    DEBUG_m(PerlIO_printf(Perl_debug_log, "sbrk malloc size %ld (reqsize %ld), left size %ld, give addr 0x%lx\n",
-                   size, reqsize, Perl_sbrk_oldsize, got));
+    DEBUG_m(PerlIO_printf(Perl_debug_log, "sbrk malloc size %ld (reqsize %ld), left size %ld, give addr 0x%"UVxf"\n",
+                   size, reqsize, Perl_sbrk_oldsize, PTR2UV(got)));
 
     return (void *)got;
 }
diff --git a/mg.c b/mg.c
index b08cee3..e037282 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1941,8 +1941,9 @@ int
 Perl_magic_mutexfree(pTHX_ SV *sv, MAGIC *mg)
 {
     dTHR;
-    DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%lx: magic_mutexfree 0x%lx\n",
-                         (unsigned long)thr, (unsigned long)sv);)
+    DEBUG_S(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf": magic_mutexfree 0x%"UVxf"\n",
+                         PTR2UV(thr), PTR2UV(sv));)
     if (MgOWNER(mg))
        Perl_croak(aTHX_ "panic: magic_mutexfree");
     MUTEX_DESTROY(MgMUTEXP(mg));
diff --git a/op.c b/op.c
index f38b26c..8609ba6 100644 (file)
--- a/op.c
+++ b/op.c
@@ -450,12 +450,14 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype)
     SvFLAGS(sv) |= tmptype;
     PL_curpad = AvARRAY(PL_comppad);
 #ifdef USE_THREADS
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx alloc %ld for %s\n",
-                         (unsigned long) thr, (unsigned long) PL_curpad,
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" Pad 0x%"UVxf" alloc %ld for %s\n",
+                         PTR2UV(thr), PTR2UV(PL_curpad),
                          (long) retval, PL_op_name[optype]));
 #else
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx alloc %ld for %s\n",
-                         (unsigned long) PL_curpad,
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "Pad 0x%"UVxf" alloc %ld for %s\n",
+                         PTR2UV(PL_curpad),
                          (long) retval, PL_op_name[optype]));
 #endif /* USE_THREADS */
     return (PADOFFSET)retval;
@@ -466,13 +468,14 @@ Perl_pad_sv(pTHX_ PADOFFSET po)
 {
     dTHR;
 #ifdef USE_THREADS
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx sv %d\n",
-                         (unsigned long) thr, (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" Pad 0x%"UVxf" sv %d\n",
+                         PTR2UV(thr), PTR2UV(PL_curpad), po));
 #else
     if (!po)
        Perl_croak(aTHX_ "panic: pad_sv po");
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx sv %d\n",
-                         (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" sv %d\n",
+                         PTR2UV(PL_curpad), po));
 #endif /* USE_THREADS */
     return PL_curpad[po];              /* eventually we'll turn this into a macro */
 }
@@ -488,11 +491,12 @@ Perl_pad_free(pTHX_ PADOFFSET po)
     if (!po)
        Perl_croak(aTHX_ "panic: pad_free po");
 #ifdef USE_THREADS
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx free %d\n",
-                         (unsigned long) thr, (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" Pad 0x%"UVxf" free %d\n",
+                         PTR2UV(thr), PTR2UV(PL_curpad), po));
 #else
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx free %d\n",
-                         (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" free %d\n",
+                         PTR2UV(PL_curpad), po));
 #endif /* USE_THREADS */
     if (PL_curpad[po] && PL_curpad[po] != &PL_sv_undef)
        SvPADTMP_off(PL_curpad[po]);
@@ -509,11 +513,12 @@ Perl_pad_swipe(pTHX_ PADOFFSET po)
     if (!po)
        Perl_croak(aTHX_ "panic: pad_swipe po");
 #ifdef USE_THREADS
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx swipe %d\n",
-                         (unsigned long) thr, (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" Pad 0x%"UVxf" swipe %d\n",
+                         PTR2UV(thr), PTR2UV(PL_curpad), po));
 #else
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx swipe %d\n",
-                         (unsigned long) PL_curpad, po));
+    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" swipe %d\n",
+                         PTR2UV(PL_curpad), po));
 #endif /* USE_THREADS */
     SvPADTMP_off(PL_curpad[po]);
     PL_curpad[po] = NEWSV(1107,0);
@@ -538,11 +543,12 @@ Perl_pad_reset(pTHX)
     if (AvARRAY(PL_comppad) != PL_curpad)
        Perl_croak(aTHX_ "panic: pad_reset curpad");
 #ifdef USE_THREADS
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx reset\n",
-                         (unsigned long) thr, (unsigned long) PL_curpad));
+    DEBUG_X(PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" Pad 0x%"UVxf" reset\n",
+                         PTR2UV(thr), PTR2UV(PL_curpad)));
 #else
-    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx reset\n",
-                         (unsigned long) PL_curpad));
+    DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" reset\n",
+                         PTR2UV(PL_curpad)));
 #endif /* USE_THREADS */
     if (!PL_tainting) {        /* Can't mix tainted and non-tainted temporaries. */
        for (po = AvMAX(PL_comppad); po > PL_padix_floor; po--) {
@@ -3842,13 +3848,14 @@ cv_dump(CV *cv)
     SV** ppad;
     I32 ix;
 
-    PerlIO_printf(Perl_debug_log, "\tCV=0x%lx (%s), OUTSIDE=0x%lx (%s)\n",
-                 cv,
+    PerlIO_printf(Perl_debug_log,
+                 "\tCV=0x%"UVxf" (%s), OUTSIDE=0x%"UVxf" (%s)\n",
+                 PTR2UV(cv),
                  (CvANON(cv) ? "ANON"
                   : (cv == PL_main_cv) ? "MAIN"
                   : CvUNIQUE(cv) ? "UNIQUE"
                   : CvGV(cv) ? GvNAME(CvGV(cv)) : "UNDEFINED"),
-                 outside,
+                 PTR2UV(outside),
                  (!outside ? "null"
                   : CvANON(outside) ? "ANON"
                   : (outside == PL_main_cv) ? "MAIN"
@@ -3865,12 +3872,13 @@ cv_dump(CV *cv)
 
     for (ix = 1; ix <= AvFILLp(pad_name); ix++) {
        if (SvPOK(pname[ix]))
-           PerlIO_printf(Perl_debug_log, "\t%4d. 0x%lx (%s\"%s\" %ld-%ld)\n",
-                         ix, ppad[ix],
+           PerlIO_printf(Perl_debug_log,
+                         "\t%4d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n",
+                         ix, PTR2UV(ppad[ix]),
                          SvFAKE(pname[ix]) ? "FAKE " : "",
                          SvPVX(pname[ix]),
-                         (long)I_32(SvNVX(pname[ix])),
-                         (long)SvIVX(pname[ix]));
+                         (IV)I_32(SvNVX(pname[ix])),
+                         SvIVX(pname[ix]));
     }
 }
 #endif /* DEBUG_CLOSURES */
diff --git a/perl.c b/perl.c
index 23ece0f..4fb1771 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1094,8 +1094,8 @@ S_run_body(pTHX_ va_list args)
     if (!PL_restartop) {
        DEBUG_x(dump_all());
        DEBUG(PerlIO_printf(Perl_debug_log, "\nEXECUTING...\n\n"));
-       DEBUG_S(PerlIO_printf(Perl_debug_log, "main thread is 0x%lx\n",
-                             (unsigned long) thr));
+       DEBUG_S(PerlIO_printf(Perl_debug_log, "main thread is 0x%"UVxf"\n",
+                             PTR2UV(thr)));
 
        if (PL_minus_c) {
            PerlIO_printf(Perl_error_log, "%s syntax OK\n", PL_origfilename);
@@ -1765,7 +1765,7 @@ Perl_moreswitches(pTHX_ char *s)
 #if defined(LOCAL_PATCH_COUNT)
        if (LOCAL_PATCH_COUNT > 0)
            printf("\n(with %d registered patch%s, see perl -V for more detail)",
-               LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : "");
+               (int)LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : "");
 #endif
 
        printf("\n\nCopyright 1987-1999, Larry Wall\n");
diff --git a/pp.c b/pp.c
index 8f4a156..b38693b 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -5179,8 +5179,8 @@ Perl_unlock_condpair(pTHX_ void *svv)
        Perl_croak(aTHX_ "panic: unlock_condpair unlocking mutex that we don't own");
     MgOWNER(mg) = 0;
     COND_SIGNAL(MgOWNERCONDP(mg));
-    DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%lx: unlock 0x%lx\n",
-                         (unsigned long)thr, (unsigned long)svv);)
+    DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": unlock 0x%"UVxf"\n",
+                         PTR2UV(thr), PTR2UV(svv));)
     MUTEX_UNLOCK(MgMUTEXP(mg));
 }
 #endif /* USE_THREADS */
@@ -5204,8 +5204,8 @@ PP(pp_lock)
        while (MgOWNER(mg))
            COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
        MgOWNER(mg) = thr;
-       DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%lx: pp_lock lock 0x%lx\n",
-                             (unsigned long)thr, (unsigned long)sv);)
+       DEBUG_S(PerlIO_printf(Perl_debug_log, "0x%"UVxf": pp_lock lock 0x%"UVxf"\n",
+                             PTR2UV(thr), PTR2UV(sv));)
        MUTEX_UNLOCK(MgMUTEXP(mg));
        SAVEDESTRUCTOR_X(Perl_unlock_condpair, sv);
     }
index 5f937ba..9126007 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2819,8 +2819,8 @@ PP(pp_require)
                        loader = *av_fetch((AV *)SvRV(loader), 0, TRUE);
                    }
 
-                   Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%lx/%s",
-                                  SvANY(loader), name);
+                   Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%"UVxf"/%s",
+                                  PTR2UV(SvANY(loader)), name);
                    tryname = SvPVX(namesv);
                    tryrsfp = 0;
 
index 2b0e0c5..e3ba341 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -844,7 +844,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
     DEBUG_r(if (!PL_colorset) reginitcolors());
     DEBUG_r(PerlIO_printf(Perl_debug_log, "%sCompiling REx%s `%s%*s%s'\n",
                      PL_colors[4],PL_colors[5],PL_colors[0],
-                     xend - exp, PL_regprecomp, PL_colors[1]));
+                     (int)(xend - exp), PL_regprecomp, PL_colors[1]));
     PL_regflags = pm->op_pmflags;
     PL_regsawback = 0;
 
@@ -986,8 +986,8 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
            r->reganch |= ROPT_SKIP;
 
        /* Scan is after the zeroth branch, first is atomic matcher. */
-       DEBUG_r(PerlIO_printf(Perl_debug_log, "first at %d\n", 
-                             first - scan + 1));
+       DEBUG_r(PerlIO_printf(Perl_debug_log, "first at %"IVdf"\n", 
+                             (IV)(first - scan + 1)));
        /*
        * If there's something expensive in the r.e., find the
        * longest literal string that must appear and make it the
@@ -3173,12 +3173,12 @@ S_dumpuntil(pTHX_ regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
        if (OP(node) == OPTIMIZED)
            goto after_print;
        regprop(sv, node);
-       PerlIO_printf(Perl_debug_log, "%4d:%*s%s", node - start, 
+       PerlIO_printf(Perl_debug_log, "%4"IVdf":%*s%s", (IV)(node - start),
                      2*l + 1, "", SvPVX(sv));
        if (next == NULL)               /* Next ptr. */
            PerlIO_printf(Perl_debug_log, "(0)");
        else 
-           PerlIO_printf(Perl_debug_log, "(%d)", next - start);
+           PerlIO_printf(Perl_debug_log, "(%"IVdf")", (IV)(next - start));
        (void)PerlIO_putc(Perl_debug_log, '\n');
       after_print:
        if (PL_regkind[(U8)op] == BRANCHJ) {
index f159f7a..7b5a488 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -176,10 +176,10 @@ S_regcppop(pTHX)
            PL_regendp[paren] = tmps;
        DEBUG_r(
            PerlIO_printf(Perl_debug_log,
-                         "     restoring \\%d to %d(%d)..%d%s\n",
-                         paren, PL_regstartp[paren], 
-                         PL_reg_start_tmp[paren] - PL_bostr,
-                         PL_regendp[paren], 
+                         "     restoring \\%"UVuf" to %"IVdf"(%"IVdf")..%"IVdf"%s\n",
+                         (UV)paren, (IV)PL_regstartp[paren], 
+                         (IV)(PL_reg_start_tmp[paren] - PL_bostr),
+                         (IV)PL_regendp[paren], 
                          (paren > *PL_reglastparen ? "(no)" : ""));
        );
     }
@@ -314,7 +314,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
                      PL_colors[1],
                      (strlen(prog->precomp) > 60 ? "..." : ""),
                      PL_colors[0],
-                     (strend - strpos > 60 ? 60 : strend - strpos),
+                     (int)(strend - strpos > 60 ? 60 : strend - strpos),
                      strpos, PL_colors[1],
                      (strend - strpos > 60 ? "..." : ""))
        );
@@ -777,7 +777,7 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
                      PL_colors[1],
                      (strlen(prog->precomp) > 60 ? "..." : ""),
                      PL_colors[0],
-                     (strend - startpos > 60 ? 60 : strend - startpos),
+                     (int)(strend - startpos > 60 ? 60 : strend - startpos),
                      startpos, PL_colors[1],
                      (strend - startpos > 60 ? "..." : ""))
        );
@@ -1482,8 +1482,8 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
 
        PL_reg_eval_set = RS_init;
        DEBUG_r(DEBUG_s(
-           PerlIO_printf(Perl_debug_log, "  setting stack tmpbase at %i\n",
-                         PL_stack_sp - PL_stack_base);
+           PerlIO_printf(Perl_debug_log, "  setting stack tmpbase at %"IVdf"\n",
+                         (IV)(PL_stack_sp - PL_stack_base));
            ));
        SAVEINT(cxstack[cxstack_ix].blk_oldsp);
        cxstack[cxstack_ix].blk_oldsp = PL_stack_sp - PL_stack_base;
@@ -1646,8 +1646,8 @@ S_regmatch(pTHX_ regnode *prog)
                pref0_len = pref_len;
            regprop(prop, scan);
            PerlIO_printf(Perl_debug_log, 
-                         "%4i <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3d:%*s%s\n",
-                         locinput - PL_bostr
+                         "%4"IVdf" <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3"IVdf":%*s%s\n",
+                         (IV)(locinput - PL_bostr)
                          PL_colors[4], pref0_len, 
                          locinput - pref_len, PL_colors[5],
                          PL_colors[2], pref_len - pref0_len, 
@@ -1656,7 +1656,7 @@ S_regmatch(pTHX_ regnode *prog)
                          PL_colors[0], l, locinput, PL_colors[1],
                          15 - l - pref_len + 1,
                          "",
-                         scan - PL_regprogram, PL_regindent*2, "",
+                         (IV)(scan - PL_regprogram), PL_regindent*2, "",
                          SvPVX(prop));
        } );
 
@@ -3053,8 +3053,8 @@ S_regmatch(pTHX_ regnode *prog)
                next = NULL;
            break;
        default:
-           PerlIO_printf(Perl_error_log, "%lx %d\n",
-                         (unsigned long)scan, OP(scan));
+           PerlIO_printf(Perl_error_log, "%"UVxf" %d\n",
+                         (UV)scan, OP(scan));
            Perl_croak(aTHX_ "regexp memory corruption");
        }
        scan = next;
diff --git a/run.c b/run.c
index decf040..38c35e0 100644 (file)
--- a/run.c
+++ b/run.c
@@ -42,8 +42,9 @@ Perl_runops_debug(pTHX)
     do {
        if (PL_debug) {
            if (PL_watchaddr != 0 && *PL_watchaddr != PL_watchok)
-               PerlIO_printf(Perl_debug_log, "WARNING: %lx changed from %lx to %lx\n",
-                   (long)PL_watchaddr, (long)PL_watchok, (long)*PL_watchaddr);
+               PerlIO_printf(Perl_debug_log,
+                             "WARNING: %"UVxf" changed from %"UVxf" to %"UVxf"\n",
+                             PTR2UV(PL_watchaddr), PTR2UV(PL_watchok), (UV)*PL_watchaddr);
            DEBUG_s(debstack());
            DEBUG_t(debop(PL_op));
            DEBUG_P(debprof(PL_op));
@@ -94,8 +95,8 @@ Perl_watch(pTHX_ char **addr)
     dTHR;
     PL_watchaddr = addr;
     PL_watchok = *addr;
-    PerlIO_printf(Perl_debug_log, "WATCHING, %lx is currently %lx\n",
-       (long)PL_watchaddr, (long)PL_watchok);
+    PerlIO_printf(Perl_debug_log, "WATCHING, %"UVxf" is currently %"UVxf"\n",
+       PTR2UV(PL_watchaddr), PTR2UV(PL_watchok));
 #endif /* DEBUGGING */
 }
 
diff --git a/scope.c b/scope.c
index 1597acc..e86a9fe 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -918,11 +918,13 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
     PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]);
     if (CxTYPE(cx) != CXt_SUBST) {
        PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
-       PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%lx\n", (long)cx->blk_oldcop);
+       PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n",
+                     PTR2UV(cx->blk_oldcop));
        PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
        PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
        PerlIO_printf(Perl_debug_log, "BLK_OLDRETSP = %ld\n", (long)cx->blk_oldretsp);
-       PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%lx\n", (long)cx->blk_oldpm);
+       PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n",
+                     PTR2UV(cx->blk_oldpm));
        PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
     }
     switch (CxTYPE(cx)) {
@@ -930,12 +932,12 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
     case CXt_BLOCK:
        break;
     case CXt_SUB:
-       PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%lx\n",
-               (long)cx->blk_sub.cv);
-       PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%lx\n",
-               (long)cx->blk_sub.gv);
-       PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%lx\n",
-               (long)cx->blk_sub.dfoutgv);
+       PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_sub.cv));
+       PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_sub.gv));
+       PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_sub.dfoutgv));
        PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
                (long)cx->blk_sub.olddepth);
        PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
@@ -949,8 +951,8 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
                PL_op_desc[cx->blk_eval.old_op_type]);
        PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
                cx->blk_eval.old_name);
-       PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%lx\n",
-               (long)cx->blk_eval.old_eval_root);
+       PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_eval.old_eval_root));
        break;
 
     case CXt_LOOP:
@@ -958,23 +960,23 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
                cx->blk_loop.label);
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
                (long)cx->blk_loop.resetsp);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%lx\n",
-               (long)cx->blk_loop.redo_op);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%lx\n",
-               (long)cx->blk_loop.next_op);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%lx\n",
-               (long)cx->blk_loop.last_op);
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.redo_op));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.next_op));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.last_op));
        PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
                (long)cx->blk_loop.iterix);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%lx\n",
-               (long)cx->blk_loop.iterary);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%lx\n",
-               (long)cx->blk_loop.itervar);
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.iterary));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.itervar));
        if (cx->blk_loop.itervar)
-           PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%lx\n",
-               (long)cx->blk_loop.itersave);
-       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%lx\n",
-               (long)cx->blk_loop.iterlval);
+           PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.itersave));
+       PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%"UVxf"\n",
+               PTR2UV(cx->blk_loop.iterlval));
        break;
 
     case CXt_SUBST:
@@ -988,18 +990,18 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
                (long)cx->sb_once);
        PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
                cx->sb_orig);
-       PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%lx\n",
-               (long)cx->sb_dstr);
-       PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%lx\n",
-               (long)cx->sb_targ);
-       PerlIO_printf(Perl_debug_log, "SB_S = 0x%lx\n",
-               (long)cx->sb_s);
-       PerlIO_printf(Perl_debug_log, "SB_M = 0x%lx\n",
-               (long)cx->sb_m);
-       PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%lx\n",
-               (long)cx->sb_strend);
-       PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%lx\n",
-               (long)cx->sb_rxres);
+       PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_dstr));
+       PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_targ));
+       PerlIO_printf(Perl_debug_log, "SB_S = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_s));
+       PerlIO_printf(Perl_debug_log, "SB_M = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_m));
+       PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_strend));
+       PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%"UVxf"\n",
+               PTR2UV(cx->sb_rxres));
        break;
     }
 #endif /* DEBUGGING */
diff --git a/sv.c b/sv.c
index cd6473c..937a5ce 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -186,7 +186,8 @@ S_del_sv(pTHX_ SV *p)
        if (!ok) {
            if (ckWARN_d(WARN_INTERNAL))        
                Perl_warner(aTHX_ WARN_INTERNAL,
-                      "Attempt to free non-arena SV: 0x%lx", (unsigned long)p);
+                           "Attempt to free non-arena SV: 0x%"UVxf,
+                           PTR2UV(p));
            return;
        }
     }
@@ -1206,7 +1207,8 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen)
 
 #ifdef HAS_64K_LIMIT
     if (newlen >= 0x10000) {
-       PerlIO_printf(Perl_debug_log, "Allocation too large: %lx\n", newlen);
+       PerlIO_printf(Perl_debug_log,
+                     "Allocation too large: %"UVxf"\n", (UV)newlen);
        my_exit(1);
     }
 #endif /* HAS_64K_LIMIT */
@@ -1500,11 +1502,11 @@ Perl_sv_2iv(pTHX_ register SV *sv)
            (void)SvNOK_on(sv);
            (void)SvIOK_on(sv);
 #if defined(USE_LONG_DOUBLE)
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
-                                 (unsigned long)sv, SvNVX(sv)));
+           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+                                 PTR2UV(sv), SvNVX(sv)));
 #else
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n",
-                                 (unsigned long)sv, SvNVX(sv)));
+           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%g)\n",
+                                 PTR2UV(sv), SvNVX(sv)));
 #endif
            if (SvNVX(sv) < (NV)IV_MAX + 0.5)
                SvIVX(sv) = I_V(SvNVX(sv));
@@ -1542,8 +1544,8 @@ Perl_sv_2iv(pTHX_ register SV *sv)
            sv_upgrade(sv, SVt_IV);
        return 0;
     }
-    DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2iv(%ld)\n",
-       (unsigned long)sv,(long)SvIVX(sv)));
+    DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2iv(%"IVdf")\n",
+       PTR2UV(sv),SvIVX(sv)));
     return SvIsUV(sv) ? (IV)SvUVX(sv) : SvIVX(sv);
 }
 
@@ -1638,11 +1640,13 @@ Perl_sv_2uv(pTHX_ register SV *sv)
            (void)SvNOK_on(sv);
            (void)SvIOK_on(sv);
 #if defined(USE_LONG_DOUBLE)
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
-                                 (unsigned long)sv, SvNVX(sv)));
+           DEBUG_c(PerlIO_printf(Perl_debug_log,
+                                 "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+                                 PTR2UV(sv), SvNVX(sv)));
 #else
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n",
-                                 (unsigned long)sv, SvNVX(sv)));
+           DEBUG_c(PerlIO_printf(Perl_debug_log,
+                                 "0x%"UVxf" 2nv(%g)\n",
+                                 PTR2UV(sv), SvNVX(sv)));
 #endif
            if (SvNVX(sv) < -0.5) {
                SvIVX(sv) = I_V(SvNVX(sv));
@@ -1756,15 +1760,16 @@ Perl_sv_2nv(pTHX_ register SV *sv)
 #if defined(USE_LONG_DOUBLE)
        DEBUG_c({
            RESTORE_NUMERIC_STANDARD();
-           PerlIO_printf(Perl_debug_log, "0x%lx num(%" PERL_PRIgldbl ")\n",
-                         (unsigned long)sv, SvNVX(sv));
+           PerlIO_printf(Perl_debug_log,
+                         "0x%"UVxf" num(%" PERL_PRIgldbl ")\n",
+                         PTR2UV(sv), SvNVX(sv));
            RESTORE_NUMERIC_LOCAL();
        });
 #else
        DEBUG_c({
            RESTORE_NUMERIC_STANDARD();
-           PerlIO_printf(Perl_debug_log, "0x%lx num(%g)\n",
-                         (unsigned long)sv, SvNVX(sv));
+           PerlIO_printf(Perl_debug_log, "0x%"UVxf" num(%g)\n",
+                         PTR2UV(sv), SvNVX(sv));
            RESTORE_NUMERIC_LOCAL();
        });
 #endif
@@ -1795,15 +1800,15 @@ Perl_sv_2nv(pTHX_ register SV *sv)
 #if defined(USE_LONG_DOUBLE)
     DEBUG_c({
        RESTORE_NUMERIC_STANDARD();
-       PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%" PERL_PRIgldbl ")\n",
-                     (unsigned long)sv, SvNVX(sv));
+       PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2nv(%" PERL_PRIgldbl ")\n",
+                     PTR2UV(sv), SvNVX(sv));
        RESTORE_NUMERIC_LOCAL();
     });
 #else
     DEBUG_c({
        RESTORE_NUMERIC_STANDARD();
-       PerlIO_printf(Perl_debug_log, "0x%lx 1nv(%g)\n",
-                     (unsigned long)sv, SvNVX(sv));
+       PerlIO_printf(Perl_debug_log, "0x%"UVxf" 1nv(%g)\n",
+                     PTR2UV(sv), SvNVX(sv));
        RESTORE_NUMERIC_LOCAL();
     });
 #endif
@@ -2199,8 +2204,8 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
     *lp = s - SvPVX(sv);
     SvCUR_set(sv, *lp);
     SvPOK_on(sv);
-    DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2pv(%s)\n",
-                         (unsigned long)sv,SvPVX(sv)));
+    DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2pv(%s)\n",
+                         PTR2UV(sv),SvPVX(sv)));
     return SvPVX(sv);
 
   tokensave:
@@ -3466,7 +3471,8 @@ Perl_sv_free(pTHX_ SV *sv)
     if (SvTEMP(sv)) {
        if (ckWARN_d(WARN_DEBUGGING))
            Perl_warner(aTHX_ WARN_DEBUGGING,
-                       "Attempt to free temp prematurely: SV 0x%lx", (unsigned long)sv);
+                       "Attempt to free temp prematurely: SV 0x%"UVxf,
+                       PTR2UV(sv));
        return;
     }
 #endif
@@ -3845,11 +3851,11 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append)
     bp = (STDCHAR*)SvPVX(sv) + append;  /* move these two too to registers */
     ptr = (STDCHAR*)PerlIO_get_ptr(fp);
     DEBUG_P(PerlIO_printf(Perl_debug_log,
-       "Screamer: entering, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+       "Screamer: entering, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
     DEBUG_P(PerlIO_printf(Perl_debug_log,
-       "Screamer: entering: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-              (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-              (long)(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
+       "Screamer: entering: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+              PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp), 
+              PTR2UV(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
     for (;;) {
       screamer:
        if (cnt > 0) {
@@ -3879,24 +3885,25 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append)
        }
 
        DEBUG_P(PerlIO_printf(Perl_debug_log,
-           "Screamer: going to getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+                             "Screamer: going to getc, ptr=%"UVuf", cnt=%ld\n",
+                             PTR2UV(ptr),(long)cnt));
        PerlIO_set_ptrcnt(fp, ptr, cnt); /* deregisterize cnt and ptr */
        DEBUG_P(PerlIO_printf(Perl_debug_log,
-           "Screamer: pre: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-           (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-           (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+           "Screamer: pre: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+           PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp), 
+           PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
        /* This used to call 'filbuf' in stdio form, but as that behaves like 
           getc when cnt <= 0 we use PerlIO_getc here to avoid introducing
           another abstraction.  */
        i   = PerlIO_getc(fp);          /* get more characters */
        DEBUG_P(PerlIO_printf(Perl_debug_log,
-           "Screamer: post: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-           (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-           (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+           "Screamer: post: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+           PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp), 
+           PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
        cnt = PerlIO_get_cnt(fp);
        ptr = (STDCHAR*)PerlIO_get_ptr(fp);     /* reregisterize cnt and ptr */
        DEBUG_P(PerlIO_printf(Perl_debug_log,
-           "Screamer: after getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+           "Screamer: after getc, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
 
        if (i == EOF)                   /* all done for ever? */
            goto thats_really_all_folks;
@@ -3920,12 +3927,12 @@ thats_really_all_folks:
     if (shortbuffered)
        cnt += shortbuffered;
        DEBUG_P(PerlIO_printf(Perl_debug_log,
-           "Screamer: quitting, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
+           "Screamer: quitting, ptr=%"UVuf", cnt=%ld\n",PTR2UV(ptr),(long)cnt));
     PerlIO_set_ptrcnt(fp, ptr, cnt);   /* put these back or we're in trouble */
     DEBUG_P(PerlIO_printf(Perl_debug_log,
-       "Screamer: end: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-       (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-       (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+       "Screamer: end: FILE * thinks ptr=%"UVuf", cnt=%ld, base=%"UVuf"\n",
+       PTR2UV(PerlIO_get_ptr(fp)), (long)PerlIO_get_cnt(fp), 
+       PTR2UV(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
     *bp = '\0';
     SvCUR_set(sv, bp - (STDCHAR*)SvPVX(sv));   /* set length */
     DEBUG_P(PerlIO_printf(Perl_debug_log,
@@ -4628,8 +4635,8 @@ Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp)
        if (!SvPOK(sv)) {
            SvPOK_on(sv);               /* validate pointer */
            SvTAINT(sv);
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2pv(%s)\n",
-               (unsigned long)sv,SvPVX(sv)));
+           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2pv(%s)\n",
+                                 PTR2UV(sv),SvPVX(sv)));
        }
     }
     return SvPVX(sv);
diff --git a/util.c b/util.c
index f78ad04..3f03744 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1555,8 +1555,8 @@ Perl_vcroak(pTHX_ const char* pat, va_list *args)
     else
        message = SvPV(msv,msglen);
 
-    DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%lx %s",
-                         (unsigned long) thr, message));
+    DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s",
+                         PTR2UV(thr), message));
 
     if (PL_diehook) {
        /* sv_2cv might call Perl_croak() */
@@ -1742,7 +1742,7 @@ Perl_vwarner(pTHX_ U32  err, const char* pat, va_list* args)
 
     if (ckDEAD(err)) {
 #ifdef USE_THREADS
-        DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%lx %s", (unsigned long) thr, message));
+        DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s", PTR2UV(thr), message));
 #endif /* USE_THREADS */
         if (PL_diehook) {
             /* sv_2cv might call Perl_croak() */