Skip to content

Commit 812d89e

Browse files
committed
type usage fixes.
1 parent fb1e92c commit 812d89e

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

include/fast_float/ascii_number.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
561561
auto const *const start_digits = p;
562562

563563
FASTFLOAT_IF_CONSTEXPR17((std::is_same<T, std::uint8_t>::value)) {
564-
const auto len = static_cast<am_digits>(pend - p);
564+
const auto len = static_cast<limb_t>(pend - p);
565565
if (len == 0) {
566566
if (has_leading_zeros) {
567567
value = 0;
@@ -602,8 +602,8 @@ parse_int_string(UC const *p, UC const *pend, T &value,
602602
((digits.as_int + 0x46464646u) | (digits.as_int - 0x30303030u)) &
603603
0x80808080u;
604604
const auto tz =
605-
static_cast<am_digits>(countr_zero_32(magic)); // 7, 15, 23, 31, or 32
606-
am_digits nd = (tz == 32) ? 4 : (tz >> 3);
605+
static_cast<limb_t>(countr_zero_32(magic)); // 7, 15, 23, 31, or 32
606+
limb_t nd = (tz == 32) ? 4 : (tz >> 3);
607607
nd = std::min(nd, len);
608608
if (nd == 0) {
609609
if (has_leading_zeros) {
@@ -618,7 +618,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
618618
}
619619
if (nd > 3) {
620620
const UC *q = p + nd;
621-
am_digits rem = len - nd;
621+
limb_t rem = len - nd;
622622
while (rem) {
623623
if (*q < UC('0') || *q > UC('9'))
624624
break;

include/fast_float/digit_comparison.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ template <typename callback>
138138
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void
139139
round_nearest_tie_even(adjusted_mantissa &am, am_pow_t shift,
140140
callback cb) noexcept {
141-
am_mant_t const mask =
142-
(shift == 64) ? std::numeric_limits<am_mant_t>::max() : (am_mant_t(1) << shift) - 1;
141+
am_mant_t const mask = (shift == 64) ? std::numeric_limits<am_mant_t>::max()
142+
: (am_mant_t(1) << shift) - 1;
143143
am_mant_t const halfway = (shift == 0) ? 0 : am_mant_t(1) << (shift - 1);
144144
am_mant_t truncated_bits = am.mantissa & mask;
145145
bool is_above = truncated_bits > halfway;

include/fast_float/float_common.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ leading_zeroes(uint64_t input_num) noexcept {
405405
}
406406

407407
/* Helper C++14 constexpr generic implementation of countr_zero for 32-bit */
408-
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 uint32_t
408+
fastfloat_really_inline FASTFLOAT_CONSTEXPR14 limb_t
409409
countr_zero_generic_32(uint32_t input_num) {
410410
if (input_num == 0) {
411411
return 32;
@@ -430,23 +430,23 @@ countr_zero_generic_32(uint32_t input_num) {
430430
if (!(input_num & 0x1)) {
431431
last_bit |= 1;
432432
}
433-
return last_bit;
433+
return static_cast<limb_t>(last_bit);
434434
}
435435

436436
/* count trailing zeroes for 32-bit integers */
437-
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 int
437+
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 limb_t
438438
countr_zero_32(uint32_t input_num) {
439439
if (cpp20_and_in_constexpr()) {
440440
return countr_zero_generic_32(input_num);
441441
}
442442
#ifdef FASTFLOAT_VISUAL_STUDIO
443443
unsigned long trailing_zero = 0;
444444
if (_BitScanForward(&trailing_zero, input_num)) {
445-
return (int)trailing_zero;
445+
return static_cast<limb_t>(trailing_zero);
446446
}
447447
return 32;
448448
#else
449-
return input_num == 0 ? 32 : __builtin_ctz(input_num);
449+
return input_num == 0 ? 32 : static_cast<limb_t>(__builtin_ctz(input_num));
450450
#endif
451451
}
452452

include/fast_float/parse_number.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ from_chars_result_t<UC>
3333

3434
bool const minusSign = (*first == UC('-'));
3535
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
36-
if (minusSign ||
37-
((chars_format_t(fmt & chars_format::allow_leading_plus)) &&
38-
(*first == UC('+')))) {
36+
if (minusSign || ((chars_format_t(fmt & chars_format::allow_leading_plus)) &&
37+
(*first == UC('+')))) {
3938
++first;
4039
}
4140

@@ -481,7 +480,8 @@ template <typename Int>
481480
FASTFLOAT_CONSTEXPR20 typename std::enable_if<
482481
std::is_integral<Int>::value && !std::is_signed<Int>::value, double>::type
483482
integer_times_pow10(Int mantissa, am_pow_t decimal_exponent) noexcept {
484-
return integer_times_pow10(static_cast<am_mant_t>(mantissa), decimal_exponent);
483+
return integer_times_pow10(static_cast<am_mant_t>(mantissa),
484+
decimal_exponent);
485485
}
486486

487487
template <typename Int>

0 commit comments

Comments
 (0)