From 1ec5f0880cd42f44344834a80101774c48ddf687 Mon Sep 17 00:00:00 2001 From: IRainman Date: Tue, 6 May 2025 22:53:10 +0300 Subject: [PATCH] compilation fix --- include/fast_float/ascii_number.h | 24 +++++++++++++----------- include/fast_float/digit_comparison.h | 3 ++- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 0462020..62b6fbc 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -367,7 +367,8 @@ parse_number_string(UC const *p, UC const *pend, UC const digit = UC(*p - UC('0')); answer.mantissa = static_cast( answer.mantissa * 10 + - digit); // in rare cases, this will overflow, but that's ok + static_cast( + digit)); // in rare cases, this will overflow, but that's ok ++p; } answer.exponent = static_cast(before - p); @@ -391,16 +392,15 @@ parse_number_string(UC const *p, UC const *pend, // Now we can parse the explicit exponential part. am_pow_t exp_number = 0; // explicit exponential part - if ((p != pend) && - ((chars_format_t(options.format & chars_format::scientific) && - (UC('e') == *p) || - (UC('E') == *p))) + if (((p != pend) && + (((chars_format_t(options.format & chars_format::scientific) && + ((UC('e') == *p) || (UC('E') == *p)))) #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN - || (chars_format_t(options.format & detail::basic_fortran_fmt) && - ((UC('+') == *p) || (UC('-') == *p) || (UC('d') == *p) || - (UC('D') == *p))) + || (chars_format_t(options.format & detail::basic_fortran_fmt) && + ((UC('+') == *p) || (UC('-') == *p) || (UC('d') == *p) || + (UC('D') == *p))) #endif - ) { + ))) { UC const *location_of_e = p; #ifdef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN ++p; @@ -483,7 +483,8 @@ parse_number_string(UC const *p, UC const *pend, am_mant_t const minimal_nineteen_digit_integer{1000000000000000000}; while ((answer.mantissa < minimal_nineteen_digit_integer) && (p != int_end)) { - answer.mantissa = answer.mantissa * 10 + UC(*p - UC('0')); + answer.mantissa = static_cast( + answer.mantissa * 10 + static_cast(*p - UC('0'))); ++p; } if (answer.mantissa >= @@ -494,7 +495,8 @@ parse_number_string(UC const *p, UC const *pend, UC const *frac_end = p + answer.fraction.len(); while ((answer.mantissa < minimal_nineteen_digit_integer) && (p != frac_end)) { - answer.mantissa = answer.mantissa * 10 + UC(*p - UC('0')); + answer.mantissa = static_cast( + answer.mantissa * 10 + static_cast(*p - UC('0'))); ++p; } answer.exponent = am_pow_t(answer.fraction.ptr - p) + exp_number; diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index e6dedba..cc3e0dd 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -457,7 +457,8 @@ inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa digit_comp( am_digits const digits = parse_mantissa(bigmant, num); // can't underflow, since digits is at most max_digits. - am_pow_t const exponent = static_cast(sci_exp + 1 - digits); + am_pow_t const exponent = + static_cast(sci_exp + 1 - static_cast(digits)); if (exponent >= 0) { return positive_digit_comp(bigmant, am, exponent); } else {