summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-10-29 21:57:34 +0000
committerNicholas Clark <nick@ccl4.org>2008-10-29 21:57:34 +0000
commitea726b52599b52cf534201a46ec3455418c9eb8e (patch)
tree4206fe1b3aea75154b82cac19301cc56345b63a4 /pad.c
parent126f53f392147cb95f8643714b33fe373747680a (diff)
downloadperl-ea726b52599b52cf534201a46ec3455418c9eb8e.tar.gz
Add MUTABLE_CV(), and eliminate (CV *) casts in *.c.
p4raw-id: //depot/perl@34647
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pad.c b/pad.c
index 16a539b1d0..caf3df584c 100644
--- a/pad.c
+++ b/pad.c
@@ -285,7 +285,7 @@ Perl_pad_undef(pTHX_ CV* cv)
if (namesv && namesv != &PL_sv_undef
&& *SvPVX_const(namesv) == '&')
{
- CV * const innercv = (CV*)curpad[ix];
+ CV * const innercv = MUTABLE_CV(curpad[ix]);
U32 inner_rc = SvREFCNT(innercv);
assert(inner_rc);
namepad[ix] = NULL;
@@ -511,10 +511,10 @@ Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
/* to avoid ref loops, we never have parent + child referencing each
* other simultaneously */
- if (CvOUTSIDE((CV*)sv)) {
- assert(!CvWEAKOUTSIDE((CV*)sv));
- CvWEAKOUTSIDE_on((CV*)sv);
- SvREFCNT_dec(CvOUTSIDE((CV*)sv));
+ if (CvOUTSIDE((const CV *)sv)) {
+ assert(!CvWEAKOUTSIDE((const CV *)sv));
+ CvWEAKOUTSIDE_on(MUTABLE_CV(sv));
+ SvREFCNT_dec(CvOUTSIDE(MUTABLE_CV(sv)));
}
return ix;
}
@@ -1486,7 +1486,7 @@ Perl_cv_clone(pTHX_ CV *proto)
ENTER;
SAVESPTR(PL_compcv);
- cv = PL_compcv = (CV*)newSV_type(SvTYPE(proto));
+ cv = PL_compcv = MUTABLE_CV(newSV_type(SvTYPE(proto)));
CvFLAGS(cv) = CvFLAGS(proto) & ~(CVf_CLONE|CVf_WEAKOUTSIDE);
CvCLONED_on(cv);
@@ -1502,7 +1502,7 @@ Perl_cv_clone(pTHX_ CV *proto)
CvROOT(cv) = OpREFCNT_inc(CvROOT(proto));
OP_REFCNT_UNLOCK;
CvSTART(cv) = CvSTART(proto);
- CvOUTSIDE(cv) = (CV*)SvREFCNT_inc_simple(outside);
+ CvOUTSIDE(cv) = MUTABLE_CV(SvREFCNT_inc_simple(outside));
CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(proto);
if (SvPOK(proto))
@@ -1620,7 +1620,7 @@ Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
if (namesv && namesv != &PL_sv_undef
&& *SvPVX_const(namesv) == '&')
{
- CV * const innercv = (CV*)curpad[ix];
+ CV * const innercv = MUTABLE_CV(curpad[ix]);
assert(CvWEAKOUTSIDE(innercv));
assert(CvOUTSIDE(innercv) == old_cv);
CvOUTSIDE(innercv) = new_cv;