summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-10-31 08:55:20 +0000
committerNicholas Clark <nick@ccl4.org>2008-10-31 08:55:20 +0000
commit159b6efe04c56d08ae56a63921b5ab3a69ac2ee9 (patch)
treed48340b2de188981511861f9089de49d53b12874 /doio.c
parent88e52f1cd82cd6da272e85a8b52d3a27cf1db31e (diff)
downloadperl-159b6efe04c56d08ae56a63921b5ab3a69ac2ee9.tar.gz
Add MUTABLE_GV(), and eliminate (V *) casts in *.c.
Can't easily do gv.h, as GvGP() (at least) needs to split into two macros - one const for reading, one non-const for writing. p4raw-id: //depot/perl@34679
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/doio.c b/doio.c
index 506470504e..aa52f39460 100644
--- a/doio.c
+++ b/doio.c
@@ -906,7 +906,7 @@ Perl_nextargv(pTHX_ register GV *gv)
if (io && (IoFLAGS(io) & IOf_ARGV)
&& PL_argvout_stack && AvFILLp(PL_argvout_stack) >= 0)
{
- GV * const oldout = (GV*)av_pop(PL_argvout_stack);
+ GV * const oldout = MUTABLE_GV(av_pop(PL_argvout_stack));
setdefout(oldout);
SvREFCNT_dec(oldout);
return NULL;
@@ -1308,11 +1308,11 @@ Perl_my_stat(pTHX)
STRLEN len;
PUTBACK;
if (isGV_with_GP(sv)) {
- gv = (GV*)sv;
+ gv = MUTABLE_GV(sv);
goto do_fstat;
}
else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
- gv = (GV*)SvRV(sv);
+ gv = MUTABLE_GV(SvRV(sv));
goto do_fstat;
}
else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVIO) {
@@ -1365,7 +1365,7 @@ Perl_my_lstat(pTHX)
PUTBACK;
if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) {
Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
- GvENAME((GV*) SvRV(sv)));
+ GvENAME((const GV *)SvRV(sv)));
return (PL_laststatval = -1);
}
file = SvPV_nolen_const(sv);
@@ -1625,7 +1625,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
while (++mark <= sp) {
GV* gv;
if (isGV_with_GP(*mark)) {
- gv = (GV*)*mark;
+ gv = MUTABLE_GV(*mark);
do_fchmod:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
#ifdef HAS_FCHMOD
@@ -1641,7 +1641,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
}
}
else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
- gv = (GV*)SvRV(*mark);
+ gv = MUTABLE_GV(SvRV(*mark));
goto do_fchmod;
}
else {
@@ -1665,7 +1665,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
while (++mark <= sp) {
GV* gv;
if (isGV_with_GP(*mark)) {
- gv = (GV*)*mark;
+ gv = MUTABLE_GV(*mark);
do_fchown:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
#ifdef HAS_FCHOWN
@@ -1681,7 +1681,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
}
}
else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
- gv = (GV*)SvRV(*mark);
+ gv = MUTABLE_GV(SvRV(*mark));
goto do_fchown;
}
else {
@@ -1837,7 +1837,7 @@ nothing in the core.
while (++mark <= sp) {
GV* gv;
if (isGV_with_GP(*mark)) {
- gv = (GV*)*mark;
+ gv = MUTABLE_GV(*mark);
do_futimes:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
#ifdef HAS_FUTIMES
@@ -1854,7 +1854,7 @@ nothing in the core.
}
}
else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
- gv = (GV*)SvRV(*mark);
+ gv = MUTABLE_GV(SvRV(*mark));
goto do_futimes;
}
else {