summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-04-30 18:26:09 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-05-10 12:07:13 +0000
commit25da4f389200e19df8aa50bcef9af9506f48ed2e (patch)
tree65b30771e2788ce1648d3a92a6cb6ca63f48ca23 /dump.c
parenta1bd196e40598e773ccd679fc8778a94de7814af (diff)
downloadperl-25da4f389200e19df8aa50bcef9af9506f48ed2e.tar.gz
Self-consistent numeric conversion again
Message-Id: <199905010226.WAA19127@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3378
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/dump.c b/dump.c
index 8f90e607de..811fe7886b 100644
--- a/dump.c
+++ b/dump.c
@@ -279,8 +279,12 @@ sv_peek(SV *sv)
SET_NUMERIC_STANDARD();
sv_catpvf(t, "(%g)",SvNVX(sv));
}
- else if (SvIOKp(sv))
- sv_catpvf(t, "(%ld)",(long)SvIVX(sv));
+ else if (SvIOKp(sv)) { /* XXXX: IV, UV? */
+ if (SvIsUV(sv))
+ sv_catpvf(t, "(%lu)",(unsigned long)SvUVX(sv));
+ else
+ sv_catpvf(t, "(%ld)",(long)SvIVX(sv));
+ }
else
sv_catpv(t, "()");
@@ -781,6 +785,7 @@ do_sv_dump(I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops,
if (CvCLONE(sv)) sv_catpv(d, "CLONE,");
if (CvCLONED(sv)) sv_catpv(d, "CLONED,");
if (CvNODEBUG(sv)) sv_catpv(d, "NODEBUG,");
+ if (SvCOMPILED(sv)) sv_catpv(d, "COMPILED,");
break;
case SVt_PVHV:
if (HvSHAREKEYS(sv)) sv_catpv(d, "SHAREKEYS,");
@@ -803,9 +808,14 @@ do_sv_dump(I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops,
sv_catpv(d, " ),");
}
}
+ /* FALL THROGH */
+ default:
+ if (SvEVALED(sv)) sv_catpv(d, "EVALED,");
+ if (SvIsUV(sv)) sv_catpv(d, "IsUV,");
+ break;
case SVt_PVBM:
if (SvTAIL(sv)) sv_catpv(d, "TAIL,");
- if (SvCOMPILED(sv)) sv_catpv(d, "COMPILED,");
+ if (SvVALID(sv)) sv_catpv(d, "VALID,");
break;
}
@@ -869,7 +879,10 @@ do_sv_dump(I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops,
return;
}
if (type >= SVt_PVIV || type == SVt_IV) {
- dump_indent(level, file, " IV = %ld", (long)SvIVX(sv));
+ if (SvIsUV(sv))
+ dump_indent(level, file, " UV = %lu", (unsigned long)SvUVX(sv));
+ else
+ dump_indent(level, file, " IV = %ld", (long)SvIVX(sv));
if (SvOOK(sv))
PerlIO_printf(file, " (OFFSET)");
PerlIO_putc(file, '\n');