diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index bb8511f..0462020 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -334,7 +334,8 @@ parse_number_string(UC const *p, UC const *pend, // multiplication answer.mantissa = static_cast( answer.mantissa * 10 + - UC(*p - UC('0'))); // might overflow, we will handle the overflow later + static_cast( + *p - UC('0'))); // might overflow, we will handle the overflow later ++p; } UC const *const end_of_integer_part = p; @@ -391,9 +392,9 @@ 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)) + ((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) || @@ -421,9 +422,9 @@ parse_number_string(UC const *p, UC const *pend, } if ((p == pend) || !is_integer(*p)) { if (!chars_format_t(options.format & chars_format::fixed)) { - // The exponential part is invalid for scientific notation, so it must - // be a trailing token for fixed notation. However, fixed notation is - // disabled, so report a scientific notation error. + // The exponential part is invalid for scientific notation, so it + // must be a trailing token for fixed notation. However, fixed + // notation is disabled, so report a scientific notation error. return report_parse_error(p, parse_error::missing_exponential_part); } // Otherwise, we will be ignoring the 'e'. diff --git a/include/fast_float/bigint.h b/include/fast_float/bigint.h index 48567e6..3fb1846 100644 --- a/include/fast_float/bigint.h +++ b/include/fast_float/bigint.h @@ -67,7 +67,7 @@ template struct stackvec { // index from the end of the container FASTFLOAT_CONSTEXPR14 const limb &rindex(limb_t index) const noexcept { FASTFLOAT_DEBUG_ASSERT(index < length); - limb_t rindex = length - index - 1; + limb_t rindex = static_cast(length - index - 1); return data[rindex]; } @@ -590,7 +590,9 @@ struct bigint : pow5_tables<> { FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); } // multiply as if by 2 raised to a power. - FASTFLOAT_CONSTEXPR20 bool pow2(am_pow_t exp) noexcept { return shl(exp); } + FASTFLOAT_CONSTEXPR20 bool pow2(am_pow_t exp) noexcept { + return shl(static_cast(exp)); + } // multiply as if by 5 raised to a power. FASTFLOAT_CONSTEXPR20 bool pow5(am_pow_t exp) noexcept { diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index 7111eab..e6dedba 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -457,7 +457,7 @@ 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 = sci_exp + 1 - digits; + am_pow_t const exponent = static_cast(sci_exp + 1 - digits); if (exponent >= 0) { return positive_digit_comp(bigmant, am, exponent); } else {