From 62f47072c9b8176589a735cc0cd3d025b8fe7f55 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 12 Nov 2025 06:07:02 -0700 Subject: [PATCH] scan_num: Replace code by equivalent function call The previous commit has made this function, long in numeric.c, available to the rest of core. The code removed here duplicated what it does. Two variables are now unused, and are removed. --- toke.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/toke.c b/toke.c index b99a489f8a..19cd371375 100644 --- a/toke.c +++ b/toke.c @@ -12531,14 +12531,6 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) static const NV nvshift[5] = { 1.0, 2.0, 4.0, 8.0, 16.0 }; static const char* const bases[5] = { "", "binary", "", "octal", "hexadecimal" }; - static const char* const Bases[5] = - { "", "Binary", "", "Octal", "Hexadecimal" }; - static const char* const maxima[5] = - { "", - "0b11111111111111111111111111111111", - "", - "037777777777", - "0xffffffff" }; /* check for hex */ if (isALPHA_FOLD_EQ(s[1], 'x')) { @@ -12842,19 +12834,13 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) if (overflowed) { if (n > 4294967295.0) - ck_warner(packWARN(WARN_PORTABLE), - "%s number > %s non-portable", - Bases[shift], - new_octal ? "0o37777777777" : maxima[shift]); + output_non_portable(1 << shift); sv = newSVnv(n); } else { #if UVSIZE > 4 if (u > 0xffffffff) - ck_warner(packWARN(WARN_PORTABLE), - "%s number > %s non-portable", - Bases[shift], - new_octal ? "0o37777777777" : maxima[shift]); + output_non_portable(1 << shift); #endif sv = newSVuv(u); }