summaryrefslogtreecommitdiff
path: root/mg.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 /mg.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 'mg.c')
-rw-r--r--mg.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/mg.c b/mg.c
index 2f9b017857..05f8cd97cb 100644
--- a/mg.c
+++ b/mg.c
@@ -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;
}