[libc++][NFC] _VSTD -> std in ryu
Those ones are extremely mechanical and since that's not libc++ code
in the first place, there's even more of an incentive to do the rename.
NOKEYCHECK=True
GitOrigin-RevId: 6e67928642c25822c101316c5e03bb2a18b56715
diff --git a/src/include/ryu/common.h b/src/include/ryu/common.h
index c24115c..a29b243 100644
--- a/src/include/ryu/common.h
+++ b/src/include/ryu/common.h
@@ -91,13 +91,13 @@
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __float_to_bits(const float __f) {
uint32_t __bits = 0;
- _VSTD::memcpy(&__bits, &__f, sizeof(float));
+ std::memcpy(&__bits, &__f, sizeof(float));
return __bits;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __double_to_bits(const double __d) {
uint64_t __bits = 0;
- _VSTD::memcpy(&__bits, &__d, sizeof(double));
+ std::memcpy(&__bits, &__d, sizeof(double));
return __bits;
}
diff --git a/src/ryu/d2fixed.cpp b/src/ryu/d2fixed.cpp
index c1a1f6c..305fbb4 100644
--- a/src/ryu/d2fixed.cpp
+++ b/src/ryu/d2fixed.cpp
@@ -135,19 +135,19 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
const uint32_t __c = __digits << 1;
- _VSTD::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 2, __DIGIT_TABLE + __c, 2);
} else {
__result[0] = static_cast<char>('0' + __digits);
}
@@ -164,14 +164,14 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength + 1 - __i - 4, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__digits >= 100) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength + 1 - __i - 2, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__digits >= 10) {
@@ -190,7 +190,7 @@
for (; __i < __count - 1; __i += 2) {
const uint32_t __c = (__digits % 100) << 1;
__digits /= 100;
- _VSTD::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __count - __i - 2, __DIGIT_TABLE + __c, 2);
}
if (__i < __count) {
const char __c = static_cast<char>('0' + (__digits % 10));
@@ -200,7 +200,7 @@
void __append_nine_digits(uint32_t __digits, char* const __result) {
if (__digits == 0) {
- _VSTD::memset(__result, '0', 9);
+ std::memset(__result, '0', 9);
return;
}
@@ -213,8 +213,8 @@
__digits /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + 7 - __i, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + 5 - __i, __DIGIT_TABLE + __c1, 2);
}
__result[0] = static_cast<char>('0' + __digits);
}
@@ -251,7 +251,7 @@
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -322,14 +322,14 @@
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
} else if (__i < __MIN_BLOCK_2[__idx]) {
__i = __MIN_BLOCK_2[__idx];
if (_Last - _First < static_cast<ptrdiff_t>(9 * __i)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', 9 * __i);
+ std::memset(_First, '0', 9 * __i);
_First += 9 * __i;
}
for (; __i < __blocks; ++__i) {
@@ -342,7 +342,7 @@
if (_Last - _First < static_cast<ptrdiff_t>(__fill)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __fill);
+ std::memset(_First, '0', __fill);
_First += __fill;
break;
}
@@ -416,7 +416,7 @@
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
return { _Last, errc::value_too_large };
}
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
return { _First, errc{} };
@@ -440,10 +440,10 @@
*_First++ = '0';
if (__precision > 0) {
*_First++ = '.';
- _VSTD::memset(_First, '0', __precision);
+ std::memset(_First, '0', __precision);
_First += __precision;
}
- _VSTD::memcpy(_First, "e+00", 4);
+ std::memcpy(_First, "e+00", 4);
_First += 4;
return { _First, errc{} };
}
@@ -589,7 +589,7 @@
return { _Last, errc::value_too_large };
}
if (__digits == 0) {
- _VSTD::memset(_First, '0', __maximum);
+ std::memset(_First, '0', __maximum);
} else {
__append_c_digits(__maximum, __digits, _First);
}
@@ -654,11 +654,11 @@
if (__exp >= 100) {
const int32_t __c = __exp % 10;
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * (__exp / 10), 2);
_First[2] = static_cast<char>('0' + __c);
_First += 3;
} else {
- _VSTD::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
+ std::memcpy(_First, __DIGIT_TABLE + 2 * __exp, 2);
_First += 2;
}
diff --git a/src/ryu/d2s.cpp b/src/ryu/d2s.cpp
index 245c2eb..ede2607 100644
--- a/src/ryu/d2s.cpp
+++ b/src/ryu/d2s.cpp
@@ -527,10 +527,10 @@
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
while (__output2 >= 10000) {
@@ -542,35 +542,35 @@
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (__output2 >= 10) {
const uint32_t __c = __output2 << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + __output2);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -602,10 +602,10 @@
const uint32_t __c1 = (__c / 100) << 1;
const uint32_t __d0 = (__d % 100) << 1;
const uint32_t __d1 = (__d / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 5, __DIGIT_TABLE + __d0, 2);
+ std::memcpy(__result + __olength - __i - 7, __DIGIT_TABLE + __d1, 2);
__i += 8;
}
uint32_t __output2 = static_cast<uint32_t>(_Output);
@@ -618,14 +618,14 @@
__output2 /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (__output2 >= 100) {
const uint32_t __c = (__output2 % 100) << 1;
__output2 /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (__output2 >= 10) {
@@ -657,11 +657,11 @@
if (_Scientific_exponent >= 100) {
const int32_t __c = _Scientific_exponent % 10;
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * (_Scientific_exponent / 10), 2);
__result[__index + 2] = static_cast<char>('0' + __c);
__index += 3;
} else {
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
}
@@ -713,7 +713,7 @@
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}
diff --git a/src/ryu/f2s.cpp b/src/ryu/f2s.cpp
index 3bcfe46..db93a48 100644
--- a/src/ryu/f2s.cpp
+++ b/src/ryu/f2s.cpp
@@ -565,35 +565,35 @@
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
}
if (_Output >= 10) {
const uint32_t __c = _Output << 1;
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
+ std::memcpy(_Mid -= 2, __DIGIT_TABLE + __c, 2);
} else {
*--_Mid = static_cast<char>('0' + _Output);
}
if (_Ryu_exponent > 0) { // case "172900" with _Can_use_ryu
// Performance note: it might be more efficient to do this immediately after setting _Mid.
- _VSTD::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
+ std::memset(_First + __olength, '0', static_cast<size_t>(_Ryu_exponent));
} else if (_Ryu_exponent == 0) { // case "1729"
// Done!
} else if (_Whole_digits > 0) { // case "17.29"
// Performance note: moving digits might not be optimal.
- _VSTD::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
+ std::memmove(_First, _First + 1, static_cast<size_t>(_Whole_digits));
_First[_Whole_digits] = '.';
} else { // case "0.001729"
// Performance note: a larger memset() followed by overwriting '.' might be more efficient.
_First[0] = '0';
_First[1] = '.';
- _VSTD::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
+ std::memset(_First + 2, '0', static_cast<size_t>(-_Whole_digits));
}
return { _First + _Total_fixed_length, errc{} };
@@ -617,14 +617,14 @@
_Output /= 10000;
const uint32_t __c0 = (__c % 100) << 1;
const uint32_t __c1 = (__c / 100) << 1;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c0, 2);
+ std::memcpy(__result + __olength - __i - 3, __DIGIT_TABLE + __c1, 2);
__i += 4;
}
if (_Output >= 100) {
const uint32_t __c = (_Output % 100) << 1;
_Output /= 100;
- _VSTD::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
+ std::memcpy(__result + __olength - __i - 1, __DIGIT_TABLE + __c, 2);
__i += 2;
}
if (_Output >= 10) {
@@ -654,7 +654,7 @@
__result[__index++] = '+';
}
- _VSTD::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
+ std::memcpy(__result + __index, __DIGIT_TABLE + 2 * _Scientific_exponent, 2);
__index += 2;
return { _First + _Total_scientific_length, errc{} };
@@ -673,7 +673,7 @@
return { _Last, errc::value_too_large };
}
- _VSTD::memcpy(_First, "0e+00", 5);
+ std::memcpy(_First, "0e+00", 5);
return { _First + 5, errc{} };
}