Skip to content

Commit 7ff05df

Browse files
clang-format
1 parent 2376dc8 commit 7ff05df

File tree

14 files changed

+71
-41
lines changed

14 files changed

+71
-41
lines changed

libc/src/__support/OSUtil/darwin/io.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace LIBC_NAMESPACE_DECL {
1717

1818
LIBC_INLINE void write_to_stderr(cpp::string_view msg) {
1919
LIBC_NAMESPACE::syscall_impl(4 /*SYS_write*/, 2 /* stderr */,
20-
reinterpret_cast<long>(msg.data()), static_cast<long>(msg.size()));
20+
reinterpret_cast<long>(msg.data()),
21+
static_cast<long>(msg.size()));
2122
}
2223

2324
} // namespace LIBC_NAMESPACE_DECL

libc/src/__support/high_precision_decimal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ class HighPrecisionDecimal {
424424
result *= 10;
425425
++cur_digit;
426426
}
427-
return result + static_cast<T>(
428-
this->should_round_up(this->decimal_point, round));
427+
return result +
428+
static_cast<T>(this->should_round_up(this->decimal_point, round));
429429
}
430430

431431
// Extra functions for testing.

libc/src/__support/memory_size.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class SafeMemSize {
7777
if (!cpp::has_single_bit(alignment) || alignment > MAX_MEM_SIZE || !valid())
7878
return SafeMemSize{type{-1}};
7979

80-
type offset = static_cast<type>(offset_to(static_cast<size_t>(value), alignment));
80+
type offset =
81+
static_cast<type>(offset_to(static_cast<size_t>(value), alignment));
8182

8283
if (LIBC_UNLIKELY(offset > static_cast<type>(MAX_MEM_SIZE) - value))
8384
return SafeMemSize{type{-1}};

libc/src/__support/str_to_float.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ eisel_lemire(ExpandedFloat<T> init_num,
111111
uint32_t clz = static_cast<uint32_t>(cpp::countl_zero<StorageType>(mantissa));
112112
mantissa <<= clz;
113113

114-
int32_t exp2 =
115-
exp10_to_exp2(exp10) + FPBits::STORAGE_LEN + FPBits::EXP_BIAS - static_cast<int32_t>(clz);
114+
int32_t exp2 = exp10_to_exp2(exp10) + FPBits::STORAGE_LEN + FPBits::EXP_BIAS -
115+
static_cast<int32_t>(clz);
116116

117117
// Multiplication
118118
const uint64_t *power_of_ten =

libc/src/stdio/printf_core/parser.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ template <typename T> using int_type_of_v = typename int_type_of<T>::type;
5757
if (!temp.has_value()) { \
5858
section.has_conv = false; \
5959
} else { \
60-
dst = static_cast<decltype(dst)>(cpp::bit_cast<int_type_of_v<arg_type>>(temp.value())); \
60+
dst = static_cast<decltype(dst)>( \
61+
cpp::bit_cast<int_type_of_v<arg_type>>(temp.value())); \
6162
} \
6263
}
6364
#else
@@ -265,7 +266,8 @@ template <typename ArgProvider> class Parser {
265266
case ('m'):
266267
// %m is an odd conversion in that it doesn't consume an argument, it
267268
// just takes the current value of errno as its argument.
268-
section.conv_val_raw = static_cast<fputil::FPBits<double>::StorageType>(libc_errno);
269+
section.conv_val_raw =
270+
static_cast<fputil::FPBits<double>::StorageType>(libc_errno);
269271
break;
270272
#endif // LIBC_COPT_PRINTF_DISABLE_STRERROR
271273
#ifndef LIBC_COPT_PRINTF_DISABLE_WRITE_INT

libc/src/stdio/printf_core/writer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ class Writer final {
135135
chars_written += static_cast<int>(length);
136136

137137
if (LIBC_LIKELY(wb->buff_cur + length <= wb->buff_len)) {
138-
inline_memset(wb->buff + wb->buff_cur, static_cast<unsigned char>(new_char), length);
138+
inline_memset(wb->buff + wb->buff_cur,
139+
static_cast<unsigned char>(new_char), length);
139140
wb->buff_cur += length;
140141
return WRITE_OK;
141142
}

libc/src/stdio/scanf_core/parser.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ template <typename ArgProvider> class Parser {
150150
char b = str[cur_pos + 1];
151151
char start = (a < b ? a : b);
152152
char end = (a < b ? b : a);
153-
scan_set.set_range(static_cast<size_t>(start), static_cast<size_t>(end));
153+
scan_set.set_range(static_cast<size_t>(start),
154+
static_cast<size_t>(end));
154155
cur_pos += 2;
155156
} else {
156157
scan_set.set(static_cast<size_t>(str[cur_pos]));

libc/src/stdlib/quick_sort.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ LIBC_INLINE void quick_sort_impl(A &array, const void *ancestor_pivot,
167167
}
168168
}
169169

170-
constexpr size_t ilog2(size_t n) { return static_cast<size_t>(cpp::bit_width(n)) - 1; }
170+
constexpr size_t ilog2(size_t n) {
171+
return static_cast<size_t>(cpp::bit_width(n)) - 1;
172+
}
171173

172174
template <typename A, typename F>
173175
LIBC_INLINE void quick_sort(A &array, const F &is_less) {

libc/test/src/__support/integer_to_string_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ TEST(LlvmLibcIntegerToStringTest, UINT64_Base_8) {
181181
EXPECT(type, 0, "0");
182182
EXPECT(type, 012345, "12345");
183183
EXPECT(type, 0123456701234567012345, "123456701234567012345");
184-
EXPECT(type, static_cast<int64_t>(01777777777777777777777), "1777777777777777777777");
184+
EXPECT(type, static_cast<int64_t>(01777777777777777777777),
185+
"1777777777777777777777");
185186
}
186187

187188
TEST(LlvmLibcIntegerToStringTest, UINT64_Base_16) {

libc/test/src/__support/math_extras_test.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,15 @@ TYPED_TEST(LlvmLibcBitTest, FirstLeadingZero, UnsignedTypesNoBigInt) {
7474
EXPECT_EQ(first_leading_zero<T>(cpp::numeric_limits<T>::max()), 0);
7575
for (int i = 0U; i != cpp::numeric_limits<T>::digits; ++i) {
7676
auto lhs = T(~(T(1) << size_t(i)));
77-
EXPECT_EQ(first_leading_zero<T>(lhs),
78-
cpp::numeric_limits<T>::digits - i);
77+
EXPECT_EQ(first_leading_zero<T>(lhs), cpp::numeric_limits<T>::digits - i);
7978
}
8079
}
8180

8281
TYPED_TEST(LlvmLibcBitTest, FirstLeadingOne, UnsignedTypesNoBigInt) {
8382
EXPECT_EQ(first_leading_one<T>(static_cast<T>(0)), 0);
8483
for (int i = 0U; i != cpp::numeric_limits<T>::digits; ++i) {
8584
auto lhs = T(T(1) << size_t(i));
86-
EXPECT_EQ(first_leading_one<T>(lhs),
87-
cpp::numeric_limits<T>::digits - i);
88-
85+
EXPECT_EQ(first_leading_one<T>(lhs), cpp::numeric_limits<T>::digits - i);
8986
}
9087
}
9188

0 commit comments

Comments
 (0)