mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-09-14 14:42:26 +08:00
try to apply std everywhere is possible.
This commit is contained in:
parent
fe15d1a0a8
commit
2aa1746bb9
@ -172,7 +172,7 @@ skip_zeros(UC const *&first, UC const *last) noexcept {
|
||||
if (!is_constant_evaluated()) {
|
||||
while (std::distance(first, last) >= int_cmp_len<UC>()) {
|
||||
uint64_t val;
|
||||
::memcpy(&val, first, sizeof(uint64_t));
|
||||
std::memcpy(&val, first, sizeof(uint64_t));
|
||||
if (val != int_cmp_zeros<UC>()) {
|
||||
break;
|
||||
}
|
||||
@ -196,7 +196,7 @@ is_truncated(UC const *first, UC const *last) noexcept {
|
||||
if (!is_constant_evaluated()) {
|
||||
while (std::distance(first, last) >= int_cmp_len<UC>()) {
|
||||
uint64_t val;
|
||||
::memcpy(&val, first, sizeof(uint64_t));
|
||||
std::memcpy(&val, first, sizeof(uint64_t));
|
||||
if (val != int_cmp_zeros<UC>()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -384,14 +384,14 @@ fastfloat_strncasecmp3(UC const *actual_mixedcase,
|
||||
mask = 0x0000002000000020;
|
||||
}
|
||||
if FASTFLOAT_CONSTEXPR17 (sizeof(UC) == 1 || sizeof(UC) == 2) {
|
||||
::memcpy(&val1, actual_mixedcase, 3 * sizeof(UC));
|
||||
::memcpy(&val2, expected_lowercase, 3 * sizeof(UC));
|
||||
std::memcpy(&val1, actual_mixedcase, 3 * sizeof(UC));
|
||||
std::memcpy(&val2, expected_lowercase, 3 * sizeof(UC));
|
||||
val1 |= mask;
|
||||
val2 |= mask;
|
||||
return val1 == val2;
|
||||
} else if FASTFLOAT_CONSTEXPR17 (sizeof(UC) == 4) {
|
||||
::memcpy(&val1, actual_mixedcase, 2 * sizeof(UC));
|
||||
::memcpy(&val2, expected_lowercase, 2 * sizeof(UC));
|
||||
std::memcpy(&val1, actual_mixedcase, 2 * sizeof(UC));
|
||||
std::memcpy(&val2, expected_lowercase, 2 * sizeof(UC));
|
||||
val1 |= mask;
|
||||
if (val1 != val2) {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user