summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-10-30 23:22:31 +0000
committerNicholas Clark <nick@ccl4.org>2008-10-30 23:22:31 +0000
commitad64d0ecd555e97c5a216efca1ec5a96b7fd0b34 (patch)
treef9ac4da2522a36d77b09d165b4cb1d4e43d5b4f4 /dump.c
parentb3dbd76e6e180b608015c6158c3fec9739ef1343 (diff)
downloadperl-ad64d0ecd555e97c5a216efca1ec5a96b7fd0b34.tar.gz
Eliminate (SV *) casts from the rest of *.c, picking up one (further)
erroneous const in dump.c. p4raw-id: //depot/perl@34675
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/dump.c b/dump.c
index 7f55558106..1d2dd2b283 100644
--- a/dump.c
+++ b/dump.c
@@ -409,7 +409,7 @@ Perl_sv_peek(pTHX_ SV *sv)
sv_catpv(t, "VOID");
goto finish;
}
- else if (sv == (SV*)0x55555555 || SvTYPE(sv) == 'U') {
+ else if (sv == (const SV *)0x55555555 || SvTYPE(sv) == 'U') {
sv_catpv(t, "WILD");
goto finish;
}
@@ -480,7 +480,7 @@ Perl_sv_peek(pTHX_ SV *sv)
sv_catpv(t, "...");
goto finish;
}
- sv = (SV*)SvRV(sv);
+ sv = SvRV(sv);
goto retry;
}
type = SvTYPE(sv);
@@ -1328,7 +1328,8 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
}
else if (mg->mg_len == HEf_SVKEY) {
PerlIO_puts(file, " => HEf_SVKEY\n");
- do_sv_dump(level+2, file, (SV*)((mg)->mg_ptr), nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
+ do_sv_dump(level+2, file, MUTABLE_SV(((mg)->mg_ptr)), nest+1,
+ maxnest, dumpops, pvlim); /* MG is already +1 */
continue;
}
else
@@ -1745,12 +1746,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", hvname);
}
if (SvOOK(sv)) {
- const AV * const backrefs
+ AV * const backrefs
= *Perl_hv_backreferences_p(aTHX_ MUTABLE_HV(sv));
if (backrefs) {
Perl_dump_indent(aTHX_ level, file, " BACKREFS = 0x%"UVxf"\n",
PTR2UV(backrefs));
- do_sv_dump(level+1, file, (SV*)backrefs, nest+1, maxnest,
+ do_sv_dump(level+1, file, MUTABLE_SV(backrefs), nest+1, maxnest,
dumpops, pvlim);
}
}
@@ -1840,7 +1841,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
: CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
}
if (nest < maxnest && (CvCLONE(sv) || CvCLONED(sv)))
- do_sv_dump(level+1, file, (SV*)CvOUTSIDE(sv), nest+1, maxnest, dumpops, pvlim);
+ do_sv_dump(level+1, file, MUTABLE_SV(CvOUTSIDE(sv)), nest+1, maxnest, dumpops, pvlim);
break;
case SVt_PVGV:
case SVt_PVLV:
@@ -1895,8 +1896,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
else {
Perl_dump_indent(aTHX_ level, file, " TOP_GV = 0x%"UVxf"\n",
PTR2UV(IoTOP_GV(sv)));
- do_sv_dump (level+1, file, (SV *) IoTOP_GV(sv), nest+1, maxnest,
- dumpops, pvlim);
+ do_sv_dump (level+1, file, MUTABLE_SV(IoTOP_GV(sv)), nest+1,
+ maxnest, dumpops, pvlim);
}
/* Source filters hide things that are not GVs in these three, so let's
be careful out there. */
@@ -1907,8 +1908,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
else {
Perl_dump_indent(aTHX_ level, file, " FMT_GV = 0x%"UVxf"\n",
PTR2UV(IoFMT_GV(sv)));
- do_sv_dump (level+1, file, (SV *) IoFMT_GV(sv), nest+1, maxnest,
- dumpops, pvlim);
+ do_sv_dump (level+1, file, MUTABLE_SV(IoFMT_GV(sv)), nest+1,
+ maxnest, dumpops, pvlim);
}
if (IoBOTTOM_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
@@ -1917,8 +1918,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
else {
Perl_dump_indent(aTHX_ level, file, " BOTTOM_GV = 0x%"UVxf"\n",
PTR2UV(IoBOTTOM_GV(sv)));
- do_sv_dump (level+1, file, (SV *) IoBOTTOM_GV(sv), nest+1, maxnest,
- dumpops, pvlim);
+ do_sv_dump (level+1, file, MUTABLE_SV(IoBOTTOM_GV(sv)), nest+1,
+ maxnest, dumpops, pvlim);
}
if (isPRINT(IoTYPE(sv)))
Perl_dump_indent(aTHX_ level, file, " TYPE = '%c'\n", IoTYPE(sv));
@@ -2372,7 +2373,7 @@ Perl_sv_xmlpeek(pTHX_ SV *sv)
sv_catpv(t, "VOID=\"\"");
goto finish;
}
- else if (sv == (SV*)0x55555555 || SvTYPE(sv) == 'U') {
+ else if (sv == (const SV *)0x55555555 || SvTYPE(sv) == 'U') {
sv_catpv(t, "WILD=\"\"");
goto finish;
}
@@ -2536,7 +2537,7 @@ Perl_do_pmop_xmldump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
if (PM_GETRE(pm)) {
REGEXP *const r = PM_GETRE(pm);
SV * const tmpsv = newSVpvn_utf8("", 0, TRUE);
- sv_catxmlsv(tmpsv, (SV*)r);
+ sv_catxmlsv(tmpsv, MUTABLE_SV(r));
Perl_xmldump_indent(aTHX_ level, file, "pre=\"%s\"\n",
SvPVX(tmpsv));
SvREFCNT_dec(tmpsv);
@@ -2945,7 +2946,7 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
break;
case MAD_SV:
sv_catpv(tmpsv, " val=\"");
- sv_catxmlsv(tmpsv, (SV*)mp->mad_val);
+ sv_catxmlsv(tmpsv, MUTABLE_SV(mp->mad_val));
sv_catpv(tmpsv, "\"");
Perl_xmldump_indent(aTHX_ level, file, "<mad_sv key=%s/>\n", SvPVX(tmpsv));
break;