summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-12 16:06:20 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-12 16:06:20 +0100
commita2a5de9516c1b256b060768ac6dad252a3aa3be7 (patch)
treeaeb1473ea930984671f646814f6a7a7802164960 /pad.c
parent5f5991a0d6d8ef99d2643b88a7d9285e35277331 (diff)
downloadperl-a2a5de9516c1b256b060768ac6dad252a3aa3be7.tar.gz
Add Perl_ck_warner(), which combines Perl_ckwarn() and Perl_warner().
Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code size (about 0.2%), for 1 more function call if warnings are not enabled. However, if we're now in the L1 or L2 cache when we weren't previously, that's still going to be a speed win.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/pad.c b/pad.c
index a68e202efb..123342fbab 100644
--- a/pad.c
+++ b/pad.c
@@ -781,9 +781,9 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn,
? CvANON(cv) && CvCLONE(cv) && !CvCLONED(cv)
: *out_flags & PAD_FAKELEX_ANON)
{
- if (warn && ckWARN(WARN_CLOSURE))
- Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
- "Variable \"%s\" is not available", name);
+ if (warn)
+ Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE),
+ "Variable \"%s\" is not available", name);
*out_capture = NULL;
}
@@ -823,9 +823,8 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn,
if (SvPADSTALE(*out_capture)
&& !SvPAD_STATE(name_svp[offset]))
{
- if (ckWARN(WARN_CLOSURE))
- Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
- "Variable \"%s\" is not available", name);
+ Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE),
+ "Variable \"%s\" is not available", name);
*out_capture = NULL;
}
}
@@ -1527,9 +1526,8 @@ Perl_cv_clone(pTHX_ CV *proto)
while my $x if $false can leave an active var marked as
stale. And state vars are always available */
if (SvPADSTALE(sv) && !SvPAD_STATE(namesv)) {
- if (ckWARN(WARN_CLOSURE))
- Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
- "Variable \"%s\" is not available", SvPVX_const(namesv));
+ Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE),
+ "Variable \"%s\" is not available", SvPVX_const(namesv));
sv = NULL;
}
else