]> git.ipfire.org Git - thirdparty/make.git/commit
Convert word, wordlist, and intcmp functions to use long long
authorPaul Smith <psmith@gnu.org>
Sun, 28 Nov 2021 14:50:10 +0000 (09:50 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 28 Nov 2021 19:27:10 +0000 (14:27 -0500)
commit116767901f9fc22f837f2830dbd42ad57d70fcb1
tree3e91c2650200daa969ed6db87e74af2a3472cd31
parent71eb0a80384617b553546228648f1f1926f43977
Convert word, wordlist, and intcmp functions to use long long

Modify make functions that parse integer values to use long long
values instead of long: on Windows long is the same as int (4 bytes)
and we don't want behavior to differ between different platforms.

* bootstrap.conf: Change strtol module to strtoll module.
* src/function.c (parse_numeric): Use strtoll() and return long long.
(func_word): Use long long.
(func_wordlist): Use long long.  Verify second argument is >= 0.
(func_intcmp): Use long long.
* src/config.ami.template: Don't define HAVE_STRTOLL.
* src/config-vms.template: Define HAVE_STRTOLL.
* src/config.W32.template: Define HAVE_STRTOLL.
* tests/run_make_tests.pl: Set $ERR_out_of_range to the proper string.
* tests/scripts/functions/word: Rework to use the new style and avoid
TAB characters.  Verify trailing whitespace is ignored.  Add a test
for a negative second argument to wordlist.  Add tests for max signed
integer values.  Use $ERR_out_of_range for the error string.
* tests/scripts/functions/intcmp: Add tests for min and max signed
integer values.  Use $ERR_out_of_range for the error string.
bootstrap.conf
src/config.ami.template
src/config.h-vms.template
src/config.h.W32.template
src/function.c
src/makeint.h
tests/run_make_tests.pl
tests/scripts/functions/intcmp
tests/scripts/functions/word