mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
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.
This commit is contained in:
parent
c1becd7fcc
commit
62f47072c9
18
toke.c
18
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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user