summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-06-15 17:49:32 -0400
committerTony Cook <tony@develop-help.com>2014-06-24 15:30:11 +1000
commitddeaf6457db7d0d56f0cc5a6452effef1d1a0f2f (patch)
tree7e77c495dc08f1dd859592352f55e32398a3113c /numeric.c
parent21134f66d28b7acf8dde08e536e8b4ee120ea3af (diff)
downloadperl-ddeaf6457db7d0d56f0cc5a6452effef1d1a0f2f.tar.gz
PERL_UNUSED_CONTEXT -> remove interp context where possible
Removing context params will save machine code in the callers of these functions, and 1 ptr of stack space. Some of these funcs are heavily used as mg_find*. The contexts can always be readded in the future the same way they were removed. This patch inspired by commit dc3bf40570. Also remove PERL_UNUSED_CONTEXT when its not needed. See removal candidate rejection rational in [perl #122106]. -Perl_hv_backreferences_p uses context in S_hv_auxinit commit 96a5add60f was wrong -Perl_whichsig_sv and Perl_whichsig_pv wrongly used PERL_UNUSED_CONTEXT from inception in commit 84c7b88cca -in authors opinion cast_* shouldn't be public API, no CPAN grep usage, can't be static and/or inline optimized since it is exported -Perl_my_unexec move to block where it is needed, make Win32 block, context free, for inlining likelyhood, private api and only 2 callers in core -Perl_my_dirfd make all blocks context free, then change proto -Perl_bytes_cmp_utf8 wrongly used PERL_UNUSED_CONTEXT from inception in commit fed3ba5d6b
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/numeric.c b/numeric.c
index e0ffafa7a6..e70992a07b 100644
--- a/numeric.c
+++ b/numeric.c
@@ -30,9 +30,8 @@ values, including such things as replacements for the OS's atof() function
#include "perl.h"
U32
-Perl_cast_ulong(pTHX_ NV f)
+Perl_cast_ulong(NV f)
{
- PERL_UNUSED_CONTEXT;
if (f < 0.0)
return f < I32_MIN ? (U32) I32_MIN : (U32)(I32) f;
if (f < U32_MAX_P1) {
@@ -49,9 +48,8 @@ Perl_cast_ulong(pTHX_ NV f)
}
I32
-Perl_cast_i32(pTHX_ NV f)
+Perl_cast_i32(NV f)
{
- PERL_UNUSED_CONTEXT;
if (f < I32_MAX_P1)
return f < I32_MIN ? I32_MIN : (I32) f;
if (f < U32_MAX_P1) {
@@ -68,9 +66,8 @@ Perl_cast_i32(pTHX_ NV f)
}
IV
-Perl_cast_iv(pTHX_ NV f)
+Perl_cast_iv(NV f)
{
- PERL_UNUSED_CONTEXT;
if (f < IV_MAX_P1)
return f < IV_MIN ? IV_MIN : (IV) f;
if (f < UV_MAX_P1) {
@@ -88,9 +85,8 @@ Perl_cast_iv(pTHX_ NV f)
}
UV
-Perl_cast_uv(pTHX_ NV f)
+Perl_cast_uv(NV f)
{
- PERL_UNUSED_CONTEXT;
if (f < 0.0)
return f < IV_MIN ? (UV) IV_MIN : (UV)(IV) f;
if (f < UV_MAX_P1) {