From 7b9159ae510ae6765ef3844d495cdc7717aef028 Mon Sep 17 00:00:00 2001 From: IRainman Date: Tue, 7 Jul 2026 16:37:17 +0300 Subject: [PATCH] * signed/unsigned mismatch fix. --- include/fast_float/ascii_number.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 86bbefe..566b6d3 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -228,7 +228,7 @@ template ::value) = 0> fastfloat_really_inline FASTFLOAT_CONSTEXPR20 void loop_parse_if_digits(UC const *&p, UC const *const pend, uint64_t &i) { FASTFLOAT_IF_CONSTEXPR17(!has_simd_opt()) { return; } - while (std::distance(p, pend) >= sizeof(uint64_t) && + while (std::distance(p, pend) >= 8 /*sizeof(uint64_t)*/ && simd_parse_if_eight_digits_unrolled(p, i)) { // may overflow, that's ok p += sizeof(uint64_t); } @@ -237,7 +237,7 @@ loop_parse_if_digits(UC const *&p, UC const *const pend, uint64_t &i) { fastfloat_really_inline FASTFLOAT_CONSTEXPR20 void loop_parse_if_digits(char const *&p, char const *const pend, uint64_t &i) { // optimizes better than parse_if_eight_digits_unrolled() for UC = char. - while (std::distance(p, pend) >= sizeof(uint64_t)) { + while (std::distance(p, pend) >= 8 /*sizeof(uint64_t)*/) { auto const val = read_chars_to_unsigned(p); if (is_made_of_eight_digits_fast(val)) { i = i * 100000000 /*10 ^ sizeof(uint64_t)*/ + @@ -250,7 +250,7 @@ loop_parse_if_digits(char const *&p, char const *const pend, uint64_t &i) { // Consume a remaining 4-7 digit run in a single SWAR step instead of // byte-by-byte (reuses the existing 4-digit helpers). The parsed result is // identical either way. - if (std::distance(p, pend) >= sizeof(uint32_t)) { + if (std::distance(p, pend) >= 4 /*sizeof(uint32_t)*/) { auto const val = read_chars_to_unsigned(p); if (is_made_of_four_digits_fast(val)) { i = i * 10000 /*10 ^ sizeof(uint32_t)*/ +