summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2017-02-17 19:46:15 -0600
committerDavid Mitchell <davem@iabyn.com>2017-02-18 12:19:54 +0000
commit19742f39bfbfba7529a49232271b390bc4e811cb (patch)
tree7c4bc6dcc2549314279de41e4b84ca22d3af270e /pp_sys.c
parentd8f2fe0966b076afb4b85eb04d1524b6af37e344 (diff)
downloadperl-19742f39bfbfba7529a49232271b390bc4e811cb.tar.gz
Moving variables to their innermost scope.
Some vars have been tagged as const because they do not change in their new scopes. In pp_reverse in pp.c, I32 tmp is only used to hold a char, so is changed to char.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 9874107e06..7a5703515c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1432,7 +1432,6 @@ PP(pp_enterwrite)
IO *io;
GV *fgv;
CV *cv = NULL;
- SV *tmpsv = NULL;
if (MAXARG == 0) {
EXTEND(SP, 1);
@@ -1456,7 +1455,7 @@ PP(pp_enterwrite)
cv = GvFORM(fgv);
if (!cv) {
- tmpsv = sv_newmortal();
+ SV * const tmpsv = sv_newmortal();
gv_efullname4(tmpsv, fgv, NULL, FALSE);
DIE(aTHX_ "Undefined format \"%" SVf "\" called", SVfARG(tmpsv));
}
@@ -4439,10 +4438,9 @@ PP(pp_system)
if (did_pipes) {
int errkid;
unsigned n = 0;
- SSize_t n1;
while (n < sizeof(int)) {
- n1 = PerlLIO_read(pp[0],
+ const SSize_t n1 = PerlLIO_read(pp[0],
(void*)(((char*)&errkid)+n),
(sizeof(int)) - n);
if (n1 <= 0)
@@ -4851,7 +4849,6 @@ PP(pp_alarm)
PP(pp_sleep)
{
dSP; dTARGET;
- I32 duration;
Time_t lasttime;
Time_t when;
@@ -4859,7 +4856,7 @@ PP(pp_sleep)
if (MAXARG < 1 || (!TOPs && !POPs))
PerlProc_pause();
else {
- duration = POPi;
+ const I32 duration = POPi;
if (duration < 0) {
/* diag_listed_as: %s() with negative argument */
Perl_ck_warner_d(aTHX_ packWARN(WARN_MISC),