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
{
#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;
}
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 */
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;
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");
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));
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
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
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)))
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);
}
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);
}
}
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;
#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;
#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))) {
} 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);
}
}
- 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;
}
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));
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;
{
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 */
}
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]);
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);
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--) {
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"
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 */
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);
#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");
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 */
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);
}
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;
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;
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
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) {
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)" : ""));
);
}
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 ? "..." : ""))
);
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 ? "..." : ""))
);
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;
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,
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));
} );
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;
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));
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 */
}
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)) {
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",
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:
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:
(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 */
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;
}
}
#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 */
(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));
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);
}
(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));
#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
#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
*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:
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
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) {
}
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;
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,
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);
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() */
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() */