summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-12-05 07:46:13 -0600
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-12-06 17:23:09 +0000
commit0bd48802b00657d8da2da444a1c97fb25cb7d562 (patch)
tree0843dbed7bc7b59e6c3926ed70780c7e9ae79a34 /pp_hot.c
parent05f9f7bb7728f3c6ba669b2c4adc66fe958a9b51 (diff)
downloadperl-0bd48802b00657d8da2da444a1c97fb25cb7d562.tar.gz
More consting, and putting stuff in embed.fnc
Message-ID: <20051205194613.GB7791@petdance.com> p4raw-id: //depot/perl@26281
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 173aca287d..bf8f7b7599 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -111,8 +111,8 @@ PP(pp_sassign)
dSP; dPOPTOPssrl;
if (PL_op->op_private & OPpASSIGN_BACKWARDS) {
- SV *temp;
- temp = left; left = right; right = temp;
+ SV * const temp = left;
+ left = right; right = temp;
}
if (PL_tainting && PL_tainted && !SvTAINTED(left))
TAINT_NOT;
@@ -259,8 +259,8 @@ PP(pp_eq)
right argument if we know the left is integer. */
SvIV_please(TOPm1s);
if (SvIOK(TOPm1s)) {
- bool auvok = SvUOK(TOPm1s);
- bool buvok = SvUOK(TOPs);
+ const bool auvok = SvUOK(TOPm1s);
+ const bool buvok = SvUOK(TOPs);
if (auvok == buvok) { /* ## IV == IV or UV == UV ## */
/* Casting IV to UV before comparison isn't going to matter
@@ -269,8 +269,8 @@ PP(pp_eq)
differ from normal zero. As I understand it. (Need to
check - is negative zero implementation defined behaviour
anyway?). NWC */
- UV buv = SvUVX(POPs);
- UV auv = SvUVX(TOPs);
+ const UV buv = SvUVX(POPs);
+ const UV auv = SvUVX(TOPs);
SETs(boolSV(auv == buv));
RETURN;
@@ -558,7 +558,7 @@ PP(pp_aelemfast)
AV *av = PL_op->op_flags & OPf_SPECIAL ?
(AV*)PAD_SV(PL_op->op_targ) : GvAV(cGVOP_gv);
const U32 lval = PL_op->op_flags & OPf_MOD;
- SV** svp = av_fetch(av, PL_op->op_private, lval);
+ SV** const svp = av_fetch(av, PL_op->op_private, lval);
SV *sv = (svp ? *svp : &PL_sv_undef);
EXTEND(SP, 1);
if (!lval && SvGMAGICAL(sv)) /* see note in pp_helem() */
@@ -601,15 +601,10 @@ PP(pp_pushre)
PP(pp_print)
{
dVAR; dSP; dMARK; dORIGMARK;
- GV *gv;
IO *io;
register PerlIO *fp;
MAGIC *mg;
-
- if (PL_op->op_flags & OPf_STACKED)
- gv = (GV*)*++MARK;
- else
- gv = PL_defoutgv;
+ GV * const gv = (PL_op->op_flags & OPf_STACKED) ? (GV*)*++MARK : PL_defoutgv;
if (gv && (io = GvIO(gv))
&& (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))