This commit is contained in:
Daniel Lemire 2025-09-18 08:30:28 -06:00
parent bb956b29db
commit 0b6d911220

View File

@ -1134,8 +1134,10 @@ template <typename UC>
fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) {
// wchar_t and char can be signed, so we need to be careful. // wchar_t and char can be signed, so we need to be careful.
using UnsignedUC = typename std::make_unsigned<UC>::type; using UnsignedUC = typename std::make_unsigned<UC>::type;
return int_luts<>::chdigit[static_cast<unsigned char>(static_cast<UnsignedUC>(c) return int_luts<>::chdigit[static_cast<unsigned char>(
& static_cast<UnsignedUC>(-((static_cast<UnsignedUC>(c) & ~0xFFull) == 0)))]; static_cast<UnsignedUC>(c) &
static_cast<UnsignedUC>(
-((static_cast<UnsignedUC>(c) & ~0xFFull) == 0)))];
} }
fastfloat_really_inline constexpr size_t max_digits_u64(int base) { fastfloat_really_inline constexpr size_t max_digits_u64(int base) {