@@ -376,33 +376,33 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
376376
377377template <typename T, typename UC, typename >
378378FASTFLOAT_CONSTEXPR20 from_chars_result_t <UC>
379- from_chars (UC const *first, UC const *last, T &value,
380- base_t const base) noexcept {
379+ from_chars (UC const *first, UC const *last, T &value, int const base) noexcept {
381380
382381 static_assert (is_supported_integer_type<T>::value,
383382 " only integer types are supported" );
384383 static_assert (is_supported_char_type<UC>::value,
385384 " only char, wchar_t, char16_t and char32_t are supported" );
386385
387- parse_options_t <UC> const options (chars_format::general, UC (' .' ), base);
386+ parse_options_t <UC> const options (chars_format::general, UC (' .' ),
387+ static_cast <base_t >(base));
388388 return from_chars_advanced (first, last, value, options);
389389}
390390
391391template <typename T>
392392FASTFLOAT_CONSTEXPR20
393393 typename std::enable_if<is_supported_float_type<T>::value, T>::type
394394 integer_times_pow10 (uint64_t const mantissa,
395- am_pow_t const decimal_exponent) noexcept {
395+ int const decimal_exponent) noexcept {
396396 T value;
397- if (clinger_fast_path_impl (mantissa, decimal_exponent,
397+ const auto exponent = static_cast <am_pow_t >(decimal_exponent);
398+ if (clinger_fast_path_impl (mantissa, exponent,
398399#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
399400 false ,
400401#endif
401402 value))
402403 return value;
403404
404- adjusted_mantissa am =
405- compute_float<binary_format<T>>(decimal_exponent, mantissa);
405+ adjusted_mantissa am = compute_float<binary_format<T>>(exponent, mantissa);
406406 to_float (
407407#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
408408 false ,
@@ -415,24 +415,25 @@ template <typename T>
415415FASTFLOAT_CONSTEXPR20
416416 typename std::enable_if<is_supported_float_type<T>::value, T>::type
417417 integer_times_pow10 (int64_t const mantissa,
418- am_pow_t const decimal_exponent) noexcept {
418+ int const decimal_exponent) noexcept {
419419#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
420420 const auto is_negative = mantissa < 0 ;
421421 const auto m = static_cast <am_mant_t >(is_negative ? -mantissa : mantissa);
422422#else
423423 FASTFLOAT_ASSUME (mantissa >= 0 );
424424 const auto m = static_cast <am_mant_t >(mantissa);
425425#endif
426+ const auto exponent = static_cast <am_pow_t >(decimal_exponent);
426427 T value;
427- if (clinger_fast_path_impl (m, decimal_exponent ,
428+ if (clinger_fast_path_impl (m, exponent ,
428429#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
429430 is_negative,
430431#endif
431432 value))
432433 return value;
433434
434435 adjusted_mantissa const am =
435- compute_float<binary_format<double >>(decimal_exponent , m);
436+ compute_float<binary_format<double >>(exponent , m);
436437
437438 to_float (
438439#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
@@ -444,13 +445,13 @@ FASTFLOAT_CONSTEXPR20
444445
445446FASTFLOAT_CONSTEXPR20 inline double
446447integer_times_pow10 (uint64_t const mantissa,
447- am_pow_t const decimal_exponent) noexcept {
448+ int const decimal_exponent) noexcept {
448449 return integer_times_pow10<double >(mantissa, decimal_exponent);
449450}
450451
451452FASTFLOAT_CONSTEXPR20 inline double
452453integer_times_pow10 (int64_t const mantissa,
453- am_pow_t const decimal_exponent) noexcept {
454+ int const decimal_exponent) noexcept {
454455 return integer_times_pow10<double >(mantissa, decimal_exponent);
455456}
456457
@@ -463,7 +464,7 @@ FASTFLOAT_CONSTEXPR20
463464 !std::is_signed<Int>::value,
464465 T>::type
465466 integer_times_pow10 (Int const mantissa,
466- am_pow_t const decimal_exponent) noexcept {
467+ int const decimal_exponent) noexcept {
467468 return integer_times_pow10<T>(static_cast <uint64_t >(mantissa),
468469 decimal_exponent);
469470}
@@ -475,24 +476,22 @@ FASTFLOAT_CONSTEXPR20
475476 std::is_signed<Int>::value,
476477 T>::type
477478 integer_times_pow10 (Int const mantissa,
478- am_pow_t const decimal_exponent) noexcept {
479+ int const decimal_exponent) noexcept {
479480 return integer_times_pow10<T>(static_cast <int64_t >(mantissa),
480481 decimal_exponent);
481482}
482483
483484template <typename Int>
484485FASTFLOAT_CONSTEXPR20 typename std::enable_if<
485486 std::is_integral<Int>::value && !std::is_signed<Int>::value, double >::type
486- integer_times_pow10 (Int const mantissa,
487- am_pow_t const decimal_exponent) noexcept {
487+ integer_times_pow10 (Int const mantissa, int const decimal_exponent) noexcept {
488488 return integer_times_pow10 (static_cast <uint64_t >(mantissa), decimal_exponent);
489489}
490490
491491template <typename Int>
492492FASTFLOAT_CONSTEXPR20 typename std::enable_if<
493493 std::is_integral<Int>::value && std::is_signed<Int>::value, double >::type
494- integer_times_pow10 (Int const mantissa,
495- am_pow_t const decimal_exponent) noexcept {
494+ integer_times_pow10 (Int const mantissa, int const decimal_exponent) noexcept {
496495 return integer_times_pow10 (static_cast <int64_t >(mantissa), decimal_exponent);
497496}
498497
0 commit comments