From 41d9632abc0b13b9c46837d257a8628431ad94e4 Mon Sep 17 00:00:00 2001 From: IRainman Date: Mon, 29 Dec 2025 21:12:11 +0300 Subject: [PATCH] interface cleanup. --- include/fast_float/fast_float.h | 8 ++++---- include/fast_float/float_common.h | 2 -- include/fast_float/parse_number.h | 18 ++++++++---------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/fast_float/fast_float.h b/include/fast_float/fast_float.h index 38c34e4..b478e65 100644 --- a/include/fast_float/fast_float.h +++ b/include/fast_float/fast_float.h @@ -59,10 +59,10 @@ from_chars_advanced(UC const *first, UC const *last, T &value, * `new` or `malloc`). */ FASTFLOAT_CONSTEXPR20 inline double -integer_times_pow10(am_mant_t const mantissa, +integer_times_pow10(uint64_t const mantissa, am_pow_t const decimal_exponent) noexcept; FASTFLOAT_CONSTEXPR20 inline double -integer_times_pow10(am_sign_mant_t const mantissa, +integer_times_pow10(int64_t const mantissa, am_pow_t const decimal_exponent) noexcept; /** @@ -73,12 +73,12 @@ integer_times_pow10(am_sign_mant_t const mantissa, template FASTFLOAT_CONSTEXPR20 typename std::enable_if::value, T>::type - integer_times_pow10(am_mant_t const mantissa, + integer_times_pow10(uint64_t const mantissa, am_pow_t const decimal_exponent) noexcept; template FASTFLOAT_CONSTEXPR20 typename std::enable_if::value, T>::type - integer_times_pow10(am_sign_mant_t const mantissa, + integer_times_pow10(int64_t const mantissa, am_pow_t const decimal_exponent) noexcept; /** diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 16071bd..149eb36 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -34,8 +34,6 @@ namespace fast_float { // 64 bit integer is used because mantissa can be up to 53 bits for double. -// Value of the int mantissa in the API. -typedef int_fast64_t am_sign_mant_t; // An unsigned int avoids signed overflows (which are bad) typedef uint_fast64_t am_mant_t; diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index 2c7e9d4..4a04ff1 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -391,7 +391,7 @@ from_chars(UC const *first, UC const *last, T &value, template FASTFLOAT_CONSTEXPR20 typename std::enable_if::value, T>::type - integer_times_pow10(am_mant_t const mantissa, + integer_times_pow10(uint64_t const mantissa, am_pow_t const decimal_exponent) noexcept { T value; if (clinger_fast_path_impl(mantissa, decimal_exponent, @@ -414,7 +414,7 @@ FASTFLOAT_CONSTEXPR20 template FASTFLOAT_CONSTEXPR20 typename std::enable_if::value, T>::type - integer_times_pow10(am_sign_mant_t const mantissa, + integer_times_pow10(int64_t const mantissa, am_pow_t const decimal_exponent) noexcept { #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN const auto is_negative = mantissa < 0; @@ -443,13 +443,13 @@ FASTFLOAT_CONSTEXPR20 } FASTFLOAT_CONSTEXPR20 inline double -integer_times_pow10(am_mant_t const mantissa, +integer_times_pow10(uint64_t const mantissa, am_pow_t const decimal_exponent) noexcept { return integer_times_pow10(mantissa, decimal_exponent); } FASTFLOAT_CONSTEXPR20 inline double -integer_times_pow10(am_sign_mant_t const mantissa, +integer_times_pow10(int64_t const mantissa, am_pow_t const decimal_exponent) noexcept { return integer_times_pow10(mantissa, decimal_exponent); } @@ -464,7 +464,7 @@ FASTFLOAT_CONSTEXPR20 T>::type integer_times_pow10(Int const mantissa, am_pow_t const decimal_exponent) noexcept { - return integer_times_pow10(static_cast(mantissa), + return integer_times_pow10(static_cast(mantissa), decimal_exponent); } @@ -476,7 +476,7 @@ FASTFLOAT_CONSTEXPR20 T>::type integer_times_pow10(Int const mantissa, am_pow_t const decimal_exponent) noexcept { - return integer_times_pow10(static_cast(mantissa), + return integer_times_pow10(static_cast(mantissa), decimal_exponent); } @@ -485,8 +485,7 @@ FASTFLOAT_CONSTEXPR20 typename std::enable_if< std::is_integral::value && !std::is_signed::value, double>::type integer_times_pow10(Int const mantissa, am_pow_t const decimal_exponent) noexcept { - return integer_times_pow10(static_cast(mantissa), - decimal_exponent); + return integer_times_pow10(static_cast(mantissa), decimal_exponent); } template @@ -494,8 +493,7 @@ FASTFLOAT_CONSTEXPR20 typename std::enable_if< std::is_integral::value && std::is_signed::value, double>::type integer_times_pow10(Int const mantissa, am_pow_t const decimal_exponent) noexcept { - return integer_times_pow10(static_cast(mantissa), - decimal_exponent); + return integer_times_pow10(static_cast(mantissa), decimal_exponent); } template