summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-18 18:00:56 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-18 18:00:56 +0000
commit47031da69d9704a7f7f2f86084deec4a32cbaf6e (patch)
tree783af4f84a5bb20634ac866b52d8815e7c1adfb9
parent51356d76dfe15ade87ec05687ff8665c7e8f3fb4 (diff)
downloadperl-47031da69d9704a7f7f2f86084deec4a32cbaf6e.tar.gz
Avoid an unused argument in S_sv_2iuv_non_preserve() by using
conditional compilation to only pass it in if it's needed. p4raw-id: //depot/perl@33004
-rw-r--r--embed.fnc4
-rw-r--r--embed.h12
-rw-r--r--proto.h6
-rw-r--r--sv.c11
4 files changed, 31 insertions, 2 deletions
diff --git a/embed.fnc b/embed.fnc
index abfc59e7f7..972e541767 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1503,7 +1503,11 @@ sR |SV * |varname |NULLOK GV *gv|const char gvtype|PADOFFSET targ \
s |void |del_sv |NN SV *p
# endif
# if !defined(NV_PRESERVES_UV)
+# ifdef DEBUGGING
s |int |sv_2iuv_non_preserve |NN SV *sv|I32 numtype
+# else
+s |int |sv_2iuv_non_preserve |NN SV *sv
+# endif
# endif
sR |I32 |expect_number |NN char** pattern
#
diff --git a/embed.h b/embed.h
index 35a7971772..e2fb594afb 100644
--- a/embed.h
+++ b/embed.h
@@ -1481,9 +1481,15 @@
#endif
# endif
# if !defined(NV_PRESERVES_UV)
+# ifdef DEBUGGING
#ifdef PERL_CORE
#define sv_2iuv_non_preserve S_sv_2iuv_non_preserve
#endif
+# else
+#ifdef PERL_CORE
+#define sv_2iuv_non_preserve S_sv_2iuv_non_preserve
+#endif
+# endif
# endif
#ifdef PERL_CORE
#define expect_number S_expect_number
@@ -3792,9 +3798,15 @@
#endif
# endif
# if !defined(NV_PRESERVES_UV)
+# ifdef DEBUGGING
#ifdef PERL_CORE
#define sv_2iuv_non_preserve(a,b) S_sv_2iuv_non_preserve(aTHX_ a,b)
#endif
+# else
+#ifdef PERL_CORE
+#define sv_2iuv_non_preserve(a) S_sv_2iuv_non_preserve(aTHX_ a)
+#endif
+# endif
# endif
#ifdef PERL_CORE
#define expect_number(a) S_expect_number(aTHX_ a)
diff --git a/proto.h b/proto.h
index a226feaf1e..e1a3647b0e 100644
--- a/proto.h
+++ b/proto.h
@@ -3972,9 +3972,15 @@ STATIC void S_del_sv(pTHX_ SV *p)
# endif
# if !defined(NV_PRESERVES_UV)
+# ifdef DEBUGGING
STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv, I32 numtype)
__attribute__nonnull__(pTHX_1);
+# else
+STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv)
+ __attribute__nonnull__(pTHX_1);
+
+# endif
# endif
STATIC I32 S_expect_number(pTHX_ char** pattern)
__attribute__warn_unused_result__
diff --git a/sv.c b/sv.c
index e801249a8c..d9c9ef87b0 100644
--- a/sv.c
+++ b/sv.c
@@ -1862,10 +1862,13 @@ S_glob_2pv(pTHX_ GV * const gv, STRLEN * const len)
/* For sv_2nv these three cases are "SvNOK and don't bother casting" */
STATIC int
-S_sv_2iuv_non_preserve(pTHX_ register SV *sv, I32 numtype)
+S_sv_2iuv_non_preserve(pTHX_ register SV *sv
+# ifdef DEBUGGING
+ , I32 numtype
+# endif
+ )
{
dVAR;
- PERL_UNUSED_ARG(numtype); /* Used only under DEBUGGING? */
DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_2iuv_non '%s', IV=0x%"UVxf" NV=%"NVgf" inttype=%"UVXf"\n", SvPVX_const(sv), SvIVX(sv), SvNVX(sv), (UV)numtype));
if (SvNVX(sv) < (NV)IV_MIN) {
(void)SvIOKp_on(sv);
@@ -2143,7 +2146,11 @@ S_sv_2iuv_common(pTHX_ SV *sv) {
1 1 already read UV.
so there's no point in sv_2iuv_non_preserve() attempting
to use atol, strtol, strtoul etc. */
+# ifdef DEBUGGING
sv_2iuv_non_preserve (sv, numtype);
+# else
+ sv_2iuv_non_preserve (sv);
+# endif
}
}
#endif /* NV_PRESERVES_UV */