summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2019-11-08 10:17:50 -0500
committerJames E Keenan <jkeenan@cpan.org>2019-11-12 19:50:59 +0000
commit35bc1e35279523a59fee1761d7505ff5c04638c0 (patch)
tree2f4a788c40bd59c3c28fc2e2ef6fc646db67cb9a /toke.c
parentecfd8588da8b6d2b74d6476d4d1c9e40c7de8b8c (diff)
downloadperl-35bc1e35279523a59fee1761d7505ff5c04638c0.tar.gz
Fix: local variable hiding parameter of same name
LGTM provides static code analysis and recommendations for code quality improvements. Their recent run over the Perl 5 core distribution identified 12 instances where a local variable hid a parameter of the same name in an outer scope. The LGTM rule governing this situation can be found here: Per: https://lgtm.com/rules/2156240606/ This patch renames local variables in approximately 8 of those instances to comply with the LGTM recommendation. Suggestions for renamed variables were made by Tony Cook. For: https://github.com/Perl/perl5/pull/17281
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index 24df24d300..6dcb6fe36b 100644
--- a/toke.c
+++ b/toke.c
@@ -9712,11 +9712,11 @@ S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
}
if (UNLIKELY(tick_warn && saw_tick && PL_lex_state == LEX_INTERPNORMAL
&& !PL_lex_brackets && ckWARN(WARN_SYNTAX))) {
- char *d;
+ char *this_d;
char *d2;
- Newx(d, *s - olds + saw_tick + 2, char); /* +2 for $# */
- d2 = d;
- SAVEFREEPV(d);
+ Newx(this_d, *s - olds + saw_tick + 2, char); /* +2 for $# */
+ d2 = this_d;
+ SAVEFREEPV(this_d);
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"Old package separator used in string");
if (olds[-1] == '#')
@@ -9732,7 +9732,7 @@ S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
}
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"\t(Did you mean \"%" UTF8f "\" instead?)\n",
- UTF8fARG(is_utf8, d2-d, d));
+ UTF8fARG(is_utf8, d2-this_d, this_d));
}
return;
}