Skip to content

Commit dd2ed02

Browse files
clang-format
1 parent eac2f32 commit dd2ed02

File tree

6 files changed

+32
-17
lines changed

6 files changed

+32
-17
lines changed

libc/src/__support/CPP/span.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ template <typename T> class span {
4949
using const_reference = const T &;
5050
using iterator = T *;
5151

52-
LIBC_INLINE_VAR static constexpr size_type dynamic_extent = cpp::numeric_limits<size_type>::max();
52+
LIBC_INLINE_VAR static constexpr size_type dynamic_extent =
53+
cpp::numeric_limits<size_type>::max();
5354

5455
LIBC_INLINE constexpr span() : span_data(nullptr), span_size(0) {}
5556

libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ struct FEnv {
114114
};
115115

116116
LIBC_INLINE int enable_except(int excepts) {
117-
uint32_t new_excepts = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
117+
uint32_t new_excepts =
118+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
118119
uint32_t control_word = FEnv::get_control_word();
119120
uint32_t old_excepts = FEnv::exception_value_from_control(control_word);
120121
if (new_excepts != old_excepts) {
@@ -125,7 +126,8 @@ LIBC_INLINE int enable_except(int excepts) {
125126
}
126127

127128
LIBC_INLINE int disable_except(int excepts) {
128-
uint32_t disabled_excepts = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
129+
uint32_t disabled_excepts =
130+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
129131
uint32_t control_word = FEnv::get_control_word();
130132
uint32_t old_excepts = FEnv::exception_value_from_control(control_word);
131133
control_word &= ~FEnv::exception_value_to_control(disabled_excepts);
@@ -141,21 +143,25 @@ LIBC_INLINE int get_except() {
141143

142144
LIBC_INLINE int clear_except(int excepts) {
143145
uint32_t status_word = FEnv::get_status_word();
144-
uint32_t except_value = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
146+
uint32_t except_value =
147+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
145148
status_word &= ~FEnv::exception_value_to_status(except_value);
146149
FEnv::set_status_word(status_word);
147150
return 0;
148151
}
149152

150153
LIBC_INLINE int test_except(int excepts) {
151154
uint32_t statusWord = FEnv::get_status_word();
152-
uint32_t ex_value = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
153-
return static_cast<int>(statusWord & FEnv::exception_value_to_status(ex_value));
155+
uint32_t ex_value =
156+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
157+
return static_cast<int>(statusWord &
158+
FEnv::exception_value_to_status(ex_value));
154159
}
155160

156161
LIBC_INLINE int set_except(int excepts) {
157162
uint32_t status_word = FEnv::get_status_word();
158-
uint32_t new_exceptions = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
163+
uint32_t new_exceptions =
164+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
159165
status_word |= FEnv::exception_value_to_status(new_exceptions);
160166
FEnv::set_status_word(status_word);
161167
return 0;
@@ -175,7 +181,8 @@ LIBC_INLINE int raise_except(int excepts) {
175181
: "s0", "s1" /* s0 and s1 are clobbered */);
176182
};
177183

178-
uint32_t to_raise = FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
184+
uint32_t to_raise =
185+
FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
179186
int result = 0;
180187

181188
if (to_raise & FEnv::EX_INVALID) {

libc/src/__support/big_int.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ struct BigInt {
697697
}
698698
BigInt quotient;
699699
WordType x_word = static_cast<WordType>(x);
700-
constexpr size_t LOG2_WORD_SIZE = static_cast<size_t>(cpp::bit_width(WORD_SIZE) - 1);
700+
constexpr size_t LOG2_WORD_SIZE =
701+
static_cast<size_t>(cpp::bit_width(WORD_SIZE) - 1);
701702
constexpr size_t HALF_WORD_SIZE = WORD_SIZE >> 1;
702703
constexpr WordType HALF_MASK = ((WordType(1) << HALF_WORD_SIZE) - 1);
703704
// lower = smallest multiple of WORD_SIZE that is >= e.
@@ -1007,8 +1008,9 @@ struct BigInt {
10071008
BigInt quotient;
10081009
if (remainder >= divider) {
10091010
BigInt subtractor = divider;
1010-
size_t cur_bit = static_cast<size_t>(multiword::countl_zero(subtractor.val) -
1011-
multiword::countl_zero(remainder.val));
1011+
size_t cur_bit =
1012+
static_cast<size_t>(multiword::countl_zero(subtractor.val) -
1013+
multiword::countl_zero(remainder.val));
10121014
subtractor <<= cur_bit;
10131015
for (; cur_bit >= 0 && remainder > 0; --cur_bit, subtractor >>= 1) {
10141016
if (remainder < subtractor)
@@ -1282,7 +1284,8 @@ rotl(T value, int rotate) {
12821284
return value;
12831285
if (rotate < 0)
12841286
return cpp::rotr<T>(value, -rotate);
1285-
return (value << static_cast<size_t>(rotate)) | (value >> (N - static_cast<size_t>(rotate)));
1287+
return (value << static_cast<size_t>(rotate)) |
1288+
(value >> (N - static_cast<size_t>(rotate)));
12861289
}
12871290

12881291
// Specialization of cpp::rotr ('bit.h') for BigInt.
@@ -1295,7 +1298,8 @@ rotr(T value, int rotate) {
12951298
return value;
12961299
if (rotate < 0)
12971300
return cpp::rotl<T>(value, -rotate);
1298-
return (value >> static_cast<size_t>(rotate)) | (value << (N - static_cast<size_t>(rotate)));
1301+
return (value >> static_cast<size_t>(rotate)) |
1302+
(value << (N - static_cast<size_t>(rotate)));
12991303
}
13001304

13011305
} // namespace cpp

libc/src/__support/integer_to_string.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ template <typename T, typename Fmt = radix::Dec> class IntegerToString {
422422
if (value == cpp::numeric_limits<T>::min()) {
423423
return cpp::bit_cast<UNSIGNED_T>(value);
424424
} else {
425-
return static_cast<UNSIGNED_T>(-value); // legal and representable both as T and UNSIGNED_T.`
425+
return static_cast<UNSIGNED_T>(
426+
-value); // legal and representable both as T and UNSIGNED_T.`
426427
}
427428
}
428429

libc/src/string/string_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ LIBC_INLINE char *string_token(char *__restrict src,
189189
if (LIBC_UNLIKELY(src == nullptr && ((src = *saveptr) == nullptr)))
190190
return nullptr;
191191

192-
static_assert(sizeof(char) == sizeof(cpp::byte), "bitset of 256 assumes char is 8 bits");
192+
static_assert(sizeof(char) == sizeof(cpp::byte),
193+
"bitset of 256 assumes char is 8 bits");
193194
cpp::bitset<256> delimiter_set;
194195
for (; *delimiter_string != '\0'; ++delimiter_string)
195196
delimiter_set.set(static_cast<size_t>(*delimiter_string));

libc/test/src/__support/CPP/bit_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ TEST(LlvmLibcBitTest, Rotr) {
227227
TYPED_TEST(LlvmLibcBitTest, CountOnes, UnsignedTypes) {
228228
EXPECT_EQ(popcount(T(0)), 0);
229229
for (int i = 0; i != cpp::numeric_limits<T>::digits; ++i)
230-
EXPECT_EQ(popcount<T>(cpp::numeric_limits<T>::max() >> static_cast<size_t>(i)),
231-
cpp::numeric_limits<T>::digits - i);
230+
EXPECT_EQ(
231+
popcount<T>(cpp::numeric_limits<T>::max() >> static_cast<size_t>(i)),
232+
cpp::numeric_limits<T>::digits - i);
232233
}
233234

234235
} // namespace cpp

0 commit comments

Comments
 (0)