diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-10-12 16:06:20 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-10-12 16:06:20 +0100 |
commit | a2a5de9516c1b256b060768ac6dad252a3aa3be7 (patch) | |
tree | aeb1473ea930984671f646814f6a7a7802164960 /mg.c | |
parent | 5f5991a0d6d8ef99d2643b88a7d9285e35277331 (diff) | |
download | perl-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 'mg.c')
-rw-r--r-- | mg.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1428,8 +1428,8 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg) mg->mg_private = (U16)i; } if (i <= 0) { - if (sv && ckWARN(WARN_SIGNAL)) - Perl_warner(aTHX_ packWARN(WARN_SIGNAL), "No such signal: SIG%s", s); + if (sv) + Perl_ck_warner(aTHX_ packWARN(WARN_SIGNAL), "No such signal: SIG%s", s); return 0; } #ifdef HAS_SIGPROCMASK @@ -1880,9 +1880,8 @@ Perl_magic_setarylen(pTHX_ SV *sv, MAGIC *mg) if (obj) { av_fill(obj, SvIV(sv) - CopARYBASE_get(PL_curcop)); } else { - if (ckWARN(WARN_MISC)) - Perl_warner(aTHX_ packWARN(WARN_MISC), - "Attempt to set length of freed array"); + Perl_ck_warner(aTHX_ packWARN(WARN_MISC), + "Attempt to set length of freed array"); } return 0; } @@ -2863,12 +2862,11 @@ Perl_sighandler(int sig) } if (!cv || !CvROOT(cv)) { - if (ckWARN(WARN_SIGNAL)) - Perl_warner(aTHX_ packWARN(WARN_SIGNAL), "SIG%s handler \"%s\" not defined.\n", - PL_sig_name[sig], (gv ? GvENAME(gv) - : ((cv && CvGV(cv)) - ? GvENAME(CvGV(cv)) - : "__ANON__"))); + Perl_ck_warner(aTHX_ packWARN(WARN_SIGNAL), "SIG%s handler \"%s\" not defined.\n", + PL_sig_name[sig], (gv ? GvENAME(gv) + : ((cv && CvGV(cv)) + ? GvENAME(CvGV(cv)) + : "__ANON__"))); goto cleanup; } |