vm: Fix C++ warning for comparing a signed to less-than 0.
Still a bit more duplication than I would like.
Found with:
c++ --version
c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Warning:
vm/bignum.cpp: In member function ‘factor::bignum* factor::factor_vm::cell_to_bignum(factor::cell)’:
vm/bignum.cpp:332:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
332 | if (n < (type) 0 && n == (type) - 1) \
| ~~^~~~~~~~~~
vm/bignum.cpp:361:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
361 | FOO_TO_BIGNUM(cell, cell, fixnum, cell)
| ^~~~~~~~~~~~~
vm/bignum.cpp:336:29: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
336 | ((negative_p = (n < (type) 0)) ? ((type)(-(stype) n)) : n); \
| ~~^~~~~~~~~~
vm/bignum.cpp:361:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
361 | FOO_TO_BIGNUM(cell, cell, fixnum, cell)
| ^~~~~~~~~~~~~
vm/bignum.cpp: In member function ‘factor::bignum* factor::factor_vm::ulong_long_to_bignum(uint64_t)’:
vm/bignum.cpp:332:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
332 | if (n < (type) 0 && n == (type) - 1) \
| ~~^~~~~~~~~~
vm/bignum.cpp:364:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
364 | FOO_TO_BIGNUM(ulong_long, uint64_t, int64_t, uint64_t)
| ^~~~~~~~~~~~~
vm/bignum.cpp:336:29: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
336 | ((negative_p = (n < (type) 0)) ? ((type)(-(stype) n)) : n); \
| ~~^~~~~~~~~~
vm/bignum.cpp:364:1: note: in expansion of macro ‘FOO_TO_BIGNUM’
364 | FOO_TO_BIGNUM(ulong_long, uint64_t, int64_t, uint64_t)
| ^~~~~~~~~~~~~