Improve performance by avoiding strtoumax
commit178d0cb5f530e6d7eb36eb9987ff405c854ccdb3
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2017 23:03:12 +0000 (1 16:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2017 23:06:38 +0000 (1 16:06 -0700)
treed5c8c63dc97ed4635b354bb16803cbfd1d953470
parent53247108411a1e9d1aa5352c231fa049f3f918aa
Improve performance by avoiding strtoumax

This made (string-to-number "10") 20% faster on my old desktop,
an AMD Phenom II X4 910e running Fedora 25 x86-64.
* admin/merge-gnulib (GNULIB_MODULES): Remove strtoumax.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/strtoul.c, lib/strtoull.c, lib/strtoumax.c, m4/strtoull.m4:
* m4/strtoumax.m4: Remove.
* src/editfns.c (str2num): New function.
(styled_format): Use it instead of strtoumax.  Use ptrdiff_t
instead of uintmax_t.  Check for integer overflow.
* src/lread.c (LEAD_INT, DOT_CHAR, TRAIL_INT, E_EXP):
Move to private scope and make them enums.
(string_to_number): Compute integer value directly during
first pass instead of revisiting it with strtoumax later.
admin/merge-gnulib
lib/gnulib.mk.in
lib/strtoul.c [deleted file]
lib/strtoull.c [deleted file]
lib/strtoumax.c [deleted file]
m4/gnulib-comp.m4
m4/strtoull.m4 [deleted file]
m4/strtoumax.m4 [deleted file]
src/editfns.c
src/lread.c