summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-03-11 19:03:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-03-11 19:03:32 +0000
commit55eb892c8d1c2d0317b54696f56f6afb30a62cd1 (patch)
tree87a1b8ce423e4caff575d4db7023614cfa05f47b /toke.c
parent2b8ee12442001da9730d16040580477c79f88fb0 (diff)
downloadperl-55eb892c8d1c2d0317b54696f56f6afb30a62cd1.tar.gz
Use Atof() instead of bare strtod(); ditto for Atol()/Atoul()
(introduce the latter) instead of bare strtoll()/strtoll(). p4raw-id: //depot/cfgperl@5661
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/toke.c b/toke.c
index 574044241e..2e6120d731 100644
--- a/toke.c
+++ b/toke.c
@@ -6978,22 +6978,14 @@ Perl_scan_num(pTHX_ char *start)
*/
if (!floatit) {
- char *tp;
IV iv;
UV uv;
errno = 0;
-#ifdef USE_64_BIT_INT
- if (*PL_tokenbuf == '-')
- iv = strtoll(PL_tokenbuf,&tp,10);
- else
- uv = strtoull(PL_tokenbuf,&tp,10);
-#else
if (*PL_tokenbuf == '-')
- iv = strtol(PL_tokenbuf,&tp,10);
+ iv = Atol(PL_tokenbuf);
else
- uv = strtoul(PL_tokenbuf,&tp,10);
-#endif
- if (*tp || errno)
+ uv = Atoul(PL_tokenbuf);
+ if (errno)
floatit = TRUE; /* probably just too large */
else if (*PL_tokenbuf == '-')
sv_setiv(sv, iv);
@@ -7003,13 +6995,8 @@ Perl_scan_num(pTHX_ char *start)
if (floatit) {
char *tp;
errno = 0;
-/* For some reason VMS doesn't have strrold at the moment. Dunno why */
-#if defined(USE_LONG_DOUBLE) && (defined(HAS_STRTOLD) || !defined(VMS))
- value = strtold(PL_tokenbuf,&tp);
-#else
- value = strtod(PL_tokenbuf,&tp);
-#endif
- if (*tp || errno)
+ value = Atof(PL_tokenbuf);
+ if (errno)
Perl_die(aTHX_ "unparseable float");
else
sv_setnv(sv, value);