diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-21 11:42:43 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-21 11:42:43 +0000 |
commit | 4ea561bc94841f378b6950ed75b669dc60767dfa (patch) | |
tree | 7a76995aa0b9fd27756ad182df7d997dd06c953c /doio.c | |
parent | 25270bc0b7409c7dbdeef1a6ec0b548e2d3e51a1 (diff) | |
download | perl-4ea561bc94841f378b6950ed75b669dc60767dfa.tar.gz |
Where possible, use SvIV instead of SvIVX, SvNV instead of SvNVX,
SvUV instead of SvUVX, and SvPV* variants instead of SvPVX*.
Document that the non-x variants are preferable whenever the expression
has no side effects. (Compilers perform common subexression
elimination). Likewise SvREFCNT_inc simple variants are valid for all
cases apart from expressions with side effects.
p4raw-id: //depot/perl@31010
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1609,7 +1609,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) case OP_CHMOD: APPLY_TAINT_PROPER(); if (++mark <= sp) { - val = SvIVx(*mark); + val = SvIV(*mark); APPLY_TAINT_PROPER(); tot = sp - mark; while (++mark <= sp) { @@ -1703,7 +1703,7 @@ nothing in the core. Perl_croak(aTHX_ "Unrecognized signal name \"%s\"",s); } else - val = SvIVx(*mark); + val = SvIV(*mark); APPLY_TAINT_PROPER(); tot = sp - mark; #ifdef VMS @@ -1716,7 +1716,7 @@ nothing in the core. * CRTL's emulation of Unix-style signals and kill() */ while (++mark <= sp) { - I32 proc = SvIVx(*mark); + I32 proc = SvIV(*mark); register unsigned long int __vmssts; APPLY_TAINT_PROPER(); if (!((__vmssts = sys$delprc(&proc,0)) & 1)) { @@ -1740,7 +1740,7 @@ nothing in the core. if (val < 0) { val = -val; while (++mark <= sp) { - const I32 proc = SvIVx(*mark); + const I32 proc = SvIV(*mark); APPLY_TAINT_PROPER(); #ifdef HAS_KILLPG if (PerlProc_killpg(proc,val)) /* BSD */ @@ -1752,7 +1752,7 @@ nothing in the core. } else { while (++mark <= sp) { - const I32 proc = SvIVx(*mark); + const I32 proc = SvIV(*mark); APPLY_TAINT_PROPER(); if (PerlProc_kill(proc, val)) tot--; @@ -1810,16 +1810,16 @@ nothing in the core. else { Zero(&utbuf, sizeof utbuf, char); #ifdef HAS_FUTIMES - utbuf[0].tv_sec = (long)SvIVx(accessed); /* time accessed */ + utbuf[0].tv_sec = (long)SvIV(accessed); /* time accessed */ utbuf[0].tv_usec = 0; - utbuf[1].tv_sec = (long)SvIVx(modified); /* time modified */ + utbuf[1].tv_sec = (long)SvIV(modified); /* time modified */ utbuf[1].tv_usec = 0; #elif defined(BIG_TIME) - utbuf.actime = (Time_t)SvNVx(accessed); /* time accessed */ - utbuf.modtime = (Time_t)SvNVx(modified); /* time modified */ + utbuf.actime = (Time_t)SvNV(accessed); /* time accessed */ + utbuf.modtime = (Time_t)SvNV(modified); /* time modified */ #else - utbuf.actime = (Time_t)SvIVx(accessed); /* time accessed */ - utbuf.modtime = (Time_t)SvIVx(modified); /* time modified */ + utbuf.actime = (Time_t)SvIV(accessed); /* time accessed */ + utbuf.modtime = (Time_t)SvIV(modified); /* time modified */ #endif } APPLY_TAINT_PROPER(); |