mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-08 10:46:52 +08:00
type usage fixes.
This commit is contained in:
parent
c1265cf9ed
commit
62bc4b4458
@ -561,7 +561,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
|
|||||||
auto const *const start_digits = p;
|
auto const *const start_digits = p;
|
||||||
|
|
||||||
FASTFLOAT_IF_CONSTEXPR17((std::is_same<T, std::uint8_t>::value)) {
|
FASTFLOAT_IF_CONSTEXPR17((std::is_same<T, std::uint8_t>::value)) {
|
||||||
const auto len = static_cast<limb_t>(pend - p);
|
const auto len = static_cast<am_digits>(pend - p);
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
if (has_leading_zeros) {
|
if (has_leading_zeros) {
|
||||||
value = 0;
|
value = 0;
|
||||||
@ -605,7 +605,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
|
|||||||
const uint32_t magic =
|
const uint32_t magic =
|
||||||
((digits + 0x46464646u) | (digits - 0x30303030u)) & 0x80808080u;
|
((digits + 0x46464646u) | (digits - 0x30303030u)) & 0x80808080u;
|
||||||
const auto tz =
|
const auto tz =
|
||||||
static_cast<limb_t>(countr_zero_32(magic)); // 7, 15, 23, 31, or 32
|
static_cast<am_digits>(countr_zero_32(magic)); // 7, 15, 23, 31, or 32
|
||||||
limb_t nd = (tz == 32) ? 4 : (tz >> 3);
|
limb_t nd = (tz == 32) ? 4 : (tz >> 3);
|
||||||
nd = std::min(nd, len);
|
nd = std::min(nd, len);
|
||||||
if (nd == 0) {
|
if (nd == 0) {
|
||||||
@ -621,7 +621,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
|
|||||||
}
|
}
|
||||||
if (nd > 3) {
|
if (nd > 3) {
|
||||||
const UC *q = p + nd;
|
const UC *q = p + nd;
|
||||||
limb_t rem = len - nd;
|
am_digits rem = len - nd;
|
||||||
while (rem) {
|
while (rem) {
|
||||||
if (*q < UC('0') || *q > UC('9'))
|
if (*q < UC('0') || *q > UC('9'))
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -410,7 +410,7 @@ countr_zero_generic_32(uint32_t input_num) {
|
|||||||
if (input_num == 0) {
|
if (input_num == 0) {
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
uint32_t last_bit = 0;
|
uint_fast16_t last_bit = 0;
|
||||||
if (!(input_num & 0x0000FFFF)) {
|
if (!(input_num & 0x0000FFFF)) {
|
||||||
input_num >>= 16;
|
input_num >>= 16;
|
||||||
last_bit |= 16;
|
last_bit |= 16;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user