diff options
author | jwillcox-telework <65623287+jwillcox-telework@users.noreply.github.com> | 2022-08-22 18:46:45 +0300 |
---|---|---|
committer | Milo Yip <miloyip@gmail.com> | 2022-08-23 05:52:40 +0300 |
commit | 06d58b9e848c650114556a23294d0b6440078c61 (patch) | |
tree | 69eeeebf1d113e6edf8db057af7e23a670817181 | |
parent | 22a62fcc2c2fa2418f5d358cdf65c1df73b418ae (diff) |
Fixed DigitGen to use proper suffix for uint64_t numeric types. Change from U suffix to ULL suffix.
On SLED 11.0 compiler, code would not compile.
cd rapidjson-master
g++ -Wall -m32 -ggdb -Iinclude -O1 ./example/simpledom/simpledom.cpp -o simpledom 2>&1 | tee out.txt
-rw-r--r-- | include/rapidjson/internal/dtoa.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/rapidjson/internal/dtoa.h b/include/rapidjson/internal/dtoa.h index 9f6ae3b3..cd456721 100644 --- a/include/rapidjson/internal/dtoa.h +++ b/include/rapidjson/internal/dtoa.h @@ -58,11 +58,11 @@ inline int CountDecimalDigit32(uint32_t n) { } inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { - static const uint64_t kPow10[] = { 1U, 10U, 100U, 1000U, 10000U, 100000U, 1000000U, 10000000U, 100000000U, - 1000000000U, 10000000000U, 100000000000U, 1000000000000U, - 10000000000000U, 100000000000000U, 1000000000000000U, - 10000000000000000U, 100000000000000000U, 1000000000000000000U, - 10000000000000000000U }; + static const uint64_t kPow10[] = { 1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL, 100000ULL, 1000000ULL, 10000000ULL, 100000000ULL, + 1000000000ULL, 10000000000ULL, 100000000000ULL, 1000000000000ULL, + 10000000000000ULL, 100000000000000ULL, 1000000000000000ULL, + 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL, + 10000000000000000000ULL }; const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); const DiyFp wp_w = Mp - W; uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e); |