Skip to content

Commit 259c9e5

Browse files
committed
add line breaks and minor simplification
1 parent de5b781 commit 259c9e5

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

libc/src/__support/str_to_float.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,14 +863,13 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num,
863863
// Checks if the first characters of the string pointer are the start of a
864864
// hexadecimal floating point number. Does not advance the string pointer.
865865
template <typename CharType>
866-
LIBC_INLINE static bool is_float_hex_start(const CharType *__restrict src,
867-
CharType decimal_point) {
866+
LIBC_INLINE static bool is_float_hex_start(const CharType *__restrict src) {
868867
if (!is_char_or_wchar(src[0], '0', L'0') ||
869868
!is_char_or_wchar(tolower(src[1]), 'x', L'x')) {
870869
return false;
871870
}
872871
size_t first_digit = 2;
873-
if (src[2] == decimal_point) {
872+
if (src[2] == constants<CharType>::DECIMAL_POINT) {
874873
++first_digit;
875874
}
876875
return isalnum(src[first_digit]) && b36_char_to_int(src[first_digit]) < 16;
@@ -1140,7 +1139,7 @@ strtofloatingpoint(const CharType *__restrict src) {
11401139
if (isdigit(src[index]) ||
11411140
src[index] == constants<CharType>::DECIMAL_POINT) { // regular number
11421141
int base = 10;
1143-
if (is_float_hex_start(src + index, constants<CharType>::DECIMAL_POINT)) {
1142+
if (is_float_hex_start(src + index)) {
11441143
base = 16;
11451144
index += 2;
11461145
seen_digit = true;

libc/test/src/wchar/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,4 +539,4 @@ add_libc_test(
539539
libc.src.wchar.wcstof
540540
libc.test.UnitTest.ErrnoCheckingTest
541541
libc.test.UnitTest.LibcFPTestHelpers
542-
)
542+
)

libc/test/src/wchar/wcstof_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,4 @@ TEST_F(LlvmLibcWcstofTest, NaNWithParenthesesValidSequenceInvalidNumberTests) {
196196
run_test(
197197
L"NaN(1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_)",
198198
68, 0x7fc00000);
199-
}
199+
}

0 commit comments

Comments
 (0)