From 9eda1ea6670ffea7d0f59d985c0ad45d7b53cdb8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 1 Aug 2017 12:41:12 -0600 Subject: numeric.c: Refactor #if #else in Perl_my_aotf This simplifies things, eliminating nested #if's --- numeric.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index f9c6778469..7065486497 100644 --- a/numeric.c +++ b/numeric.c @@ -1212,11 +1212,18 @@ Perl_my_atof(pTHX_ const char* s) /* 's' must be NUL terminated */ NV x = 0.0; + + PERL_ARGS_ASSERT_MY_ATOF; + #ifdef USE_QUADMATH + Perl_my_atof2(aTHX_ s, &x); - return x; -#elif defined(USE_LOCALE_NUMERIC) - PERL_ARGS_ASSERT_MY_ATOF; + +#elif ! defined(USE_LOCALE_NUMERIC) + + Perl_atof2(s, x); + +#else { DECLARATION_FOR_LC_NUMERIC_MANIPULATION; @@ -1247,9 +1254,9 @@ Perl_my_atof(pTHX_ const char* s) Perl_atof2(s, x); RESTORE_LC_NUMERIC(); } -#else - Perl_atof2(s, x); + #endif + return x; } -- cgit v1.2.1