Skip to content

Commit da3b02f

Browse files
michaelrj-googlemordante
authored andcommitted
fix lint warnings and linkage errors
1 parent 78842bc commit da3b02f

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

libcxx/include/__charconv/from_chars_floating_point.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3232
#if _LIBCPP_STD_VER >= 17
3333

3434
from_chars_result from_chars_floating_point(
35-
const char* __first, const char* __last, float& value, chars_format fmt = chars_format::general);
35+
const char* __first, const char* __last, float& __value, chars_format __fmt = chars_format::general);
3636

3737
from_chars_result from_chars_floating_point(
38-
const char* __first, const char* __last, double& value, chars_format fmt = chars_format::general);
38+
const char* __first, const char* __last, double& __value, chars_format __fmt = chars_format::general);
3939

4040
// template <typename _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0>
4141
// inline from_chars_result

libcxx/src/charconv.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,24 @@ to_chars_result to_chars(char* __first, char* __last, long double __value, chars
7575
__first, __last, static_cast<double>(__value), __fmt, __precision);
7676
}
7777

78-
from_chars_result from_chars_floating_point(const char* __first, const char* __last, float& value, chars_format fmt) {
79-
return from_chars_floating_point<float>(__first, __last, value, fmt);
78+
from_chars_result
79+
from_chars_floating_point(const char* __first, const char* __last, float& __value, chars_format __fmt) {
80+
return from_chars_floating_point<float>(__first, __last, __value, __fmt);
8081
}
8182

82-
from_chars_result from_chars_floating_point(const char* __first, const char* __last, double& value, chars_format fmt) {
83-
return from_chars_floating_point<double>(__first, __last, value, fmt);
83+
from_chars_result
84+
from_chars_floating_point(const char* __first, const char* __last, double& __value, chars_format __fmt) {
85+
return from_chars_floating_point<double>(__first, __last, __value, __fmt);
8486
}
8587

86-
from_chars_result from_chars(const char* __first, const char* __last, float& __value, chars_format fmt) {
87-
return std::from_chars_floating_point(__first, __last, __value, fmt);
88+
_LIBCPP_EXPORTED_FROM_ABI from_chars_result
89+
from_chars(const char* __first, const char* __last, float& __value, chars_format __fmt) {
90+
return from_chars_floating_point(__first, __last, __value, __fmt);
8891
}
8992

90-
from_chars_result from_chars(const char* __first, const char* __last, double& __value, chars_format fmt) {
91-
return std::from_chars_floating_point(__first, __last, __value, fmt);
93+
_LIBCPP_EXPORTED_FROM_ABI from_chars_result
94+
from_chars(const char* __first, const char* __last, double& __value, chars_format __fmt) {
95+
return from_chars_floating_point(__first, __last, __value, __fmt);
9296
}
9397

9498
_LIBCPP_END_NAMESPACE_STD

libcxx/src/include/from_chars_floating_point.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
_LIBCPP_BEGIN_NAMESPACE_STD
2828

2929
template <typename _Tp, __enable_if_t<std::is_floating_point<_Tp>::value, int> = 0>
30-
from_chars_result from_chars_floating_point(const char* __first, const char* __last, _Tp& value, chars_format fmt) {
30+
from_chars_result from_chars_floating_point(const char* __first, const char* __last, _Tp& __value, chars_format __fmt) {
3131
using _Traits = _Floating_type_traits<_Tp>;
3232
using _Uint_type = typename _Traits::_Uint_type;
3333
ptrdiff_t length = __last - __first;
3434
_LIBCPP_ASSERT_INTERNAL(length > 0, "");
3535

3636
// hacky parsing code as example. Not intended for actual use. I'm just going to handle the base 10
3737
// chars_format::general case. Also, no sign, inf, or nan handling.
38-
_LIBCPP_ASSERT_INTERNAL(fmt == std::chars_format::general, "");
38+
_LIBCPP_ASSERT_INTERNAL(__fmt == std::chars_format::general, "");
3939

4040
const char* src = __first; // rename to match the libc code copied for this section.
4141

@@ -126,7 +126,7 @@ from_chars_result from_chars_floating_point(const char* __first, const char* __l
126126
auto result = LIBC_NAMESPACE::fputil::FPBits<_Tp>();
127127
result.set_mantissa(expanded_float.mantissa);
128128
result.set_biased_exponent(expanded_float.exponent);
129-
value = result.get_val();
129+
__value = result.get_val();
130130
return {src + index, {}};
131131
}
132132

libcxx/test/std/utilities/charconv/charconv.from.chars/float.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
template <typename T>
2121
struct test_basics {
22-
TEST_CONSTEXPR_CXX23 void operator()() {
22+
void operator()() {
2323
std::from_chars_result r;
2424
T x;
2525

@@ -57,7 +57,7 @@ struct test_basics {
5757
}
5858
};
5959

60-
TEST_CONSTEXPR_CXX23 bool test() {
60+
bool test() {
6161
run<test_basics>(all_floats);
6262

6363
return true;

0 commit comments

Comments
 (0)