From d5c05e51af293ca2f16666861f5d27493f4cc1f0 Mon Sep 17 00:00:00 2001 From: IRainman Date: Tue, 6 May 2025 17:44:31 +0300 Subject: [PATCH] additional type usage fixes and constexpr. --- include/fast_float/digit_comparison.h | 4 ++-- include/fast_float/float_common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index b6983d8..be33771 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -39,7 +39,7 @@ constexpr static uint64_t powers_of_ten_uint64[] = {1UL, // effect on performance: in order to have a faster algorithm, we'd need // to slow down performance for faster algorithms, and this is still fast. template -fastfloat_really_inline FASTFLOAT_CONSTEXPR14 int_fast16_t +fastfloat_really_inline FASTFLOAT_CONSTEXPR14 am_pow_t scientific_exponent(parsed_number_string_t const &num) noexcept { am_mant_t mantissa = num.mantissa; am_pow_t exponent = num.exponent; @@ -268,7 +268,7 @@ parse_mantissa(bigint &result, const parsed_number_string_t &num) noexcept { // try to minimize the number of big integer and scalar multiplication. // therefore, try to parse 8 digits at a time, and multiply by the largest // scalar value (9 or 19 digits) for each step. - am_digits const max_digits = binary_format::max_digits(); + constexpr am_digits max_digits = binary_format::max_digits(); am_digits counter = 0; am_digits digits = 0; limb value = 0; diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index e161b6e..c0bf8a1 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -336,7 +336,7 @@ struct value128 { /* Helper C++14 constexpr generic implementation of leading_zeroes */ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 limb_t -leading_zeroes_generic(uint64_t input_num, uint64_t last_bit = 0) noexcept { +leading_zeroes_generic(uint64_t input_num, uint32_t last_bit = 0) noexcept { if (input_num & uint64_t(0xffffffff00000000)) { input_num >>= 32; last_bit |= 32;