Skip to content

Commit 3e33b6f

Browse files
committed
[libc++][NFC] Reformat a few files that had gotten mis-formatted
Those appear to be oversights when committing patches in the last few months.
1 parent cd18342 commit 3e33b6f

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

libcxx/include/ostream

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,11 +1090,10 @@ _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os);
10901090

10911091
# ifndef _LIBCPP_HAS_NO_UNICODE
10921092
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
1093-
_LIBCPP_HIDE_FROM_ABI void
1094-
__vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) {
1095-
#if _LIBCPP_AVAILABILITY_HAS_PRINT == 0
1093+
_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) {
1094+
# if _LIBCPP_AVAILABILITY_HAS_PRINT == 0
10961095
return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl);
1097-
#else
1096+
# else
10981097
FILE* __file = std::__get_ostream_file(__os);
10991098
if (!__file || !__print::__is_terminal(__file))
11001099
return std::__vprint_nonunicode(__os, __fmt, __args, __write_nl);
@@ -1110,38 +1109,36 @@ __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __wr
11101109
// This is the path for the native API, start with flushing.
11111110
__os.flush();
11121111

1113-
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
1112+
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
11141113
try {
1115-
# endif // _LIBCPP_HAS_NO_EXCEPTIONS
1114+
# endif // _LIBCPP_HAS_NO_EXCEPTIONS
11161115
ostream::sentry __s(__os);
11171116
if (__s) {
1118-
# ifndef _LIBCPP_WIN32API
1117+
# ifndef _LIBCPP_WIN32API
11191118
__print::__vprint_unicode_posix(__file, __fmt, __args, __write_nl, true);
1120-
# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
1119+
# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
11211120
__print::__vprint_unicode_windows(__file, __fmt, __args, __write_nl, true);
1122-
# else
1123-
# error "Windows builds with wchar_t disabled are not supported."
1124-
# endif
1121+
# else
1122+
# error "Windows builds with wchar_t disabled are not supported."
1123+
# endif
11251124
}
11261125

1127-
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
1126+
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
11281127
} catch (...) {
11291128
__os.__set_badbit_and_consider_rethrow();
11301129
}
1131-
# endif // _LIBCPP_HAS_NO_EXCEPTIONS
1132-
#endif // _LIBCPP_AVAILABILITY_HAS_PRINT
1130+
# endif // _LIBCPP_HAS_NO_EXCEPTIONS
1131+
# endif // _LIBCPP_AVAILABILITY_HAS_PRINT
11331132
}
11341133

11351134
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
1136-
_LIBCPP_HIDE_FROM_ABI inline void
1137-
vprint_unicode(ostream& __os, string_view __fmt, format_args __args) {
1135+
_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(ostream& __os, string_view __fmt, format_args __args) {
11381136
std::__vprint_unicode(__os, __fmt, __args, false);
11391137
}
11401138
# endif // _LIBCPP_HAS_NO_UNICODE
11411139

11421140
template <class... _Args>
1143-
_LIBCPP_HIDE_FROM_ABI void
1144-
print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
1141+
_LIBCPP_HIDE_FROM_ABI void print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
11451142
# ifndef _LIBCPP_HAS_NO_UNICODE
11461143
if constexpr (__print::__use_unicode_execution_charset)
11471144
std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), false);
@@ -1153,8 +1150,7 @@ print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
11531150
}
11541151

11551152
template <class... _Args>
1156-
_LIBCPP_HIDE_FROM_ABI void
1157-
println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
1153+
_LIBCPP_HIDE_FROM_ABI void println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
11581154
# ifndef _LIBCPP_HAS_NO_UNICODE
11591155
// Note the wording in the Standard is inefficient. The output of
11601156
// std::format is a std::string which is then copied. This solution

libcxx/include/scoped_allocator

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ public:
476476
}
477477

478478
private:
479-
_LIBCPP_HIDE_FROM_ABI explicit scoped_allocator_adaptor(outer_allocator_type&& __o, inner_allocator_type&& __i) _NOEXCEPT
480-
: base(std::move(__o), std::move(__i)) {}
479+
_LIBCPP_HIDE_FROM_ABI explicit scoped_allocator_adaptor(
480+
outer_allocator_type&& __o, inner_allocator_type&& __i) _NOEXCEPT : base(std::move(__o), std::move(__i)) {}
481481

482482
template <class _Tp, class... _Args>
483483
_LIBCPP_HIDE_FROM_ABI void __construct(integral_constant<int, 0>, _Tp* __p, _Args&&... __args) {

libcxx/include/shared_mutex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ template <class Mutex>
124124

125125
#include <__config>
126126

127-
# ifdef _LIBCPP_HAS_NO_THREADS
128-
# error "<shared_mutex> is not supported since libc++ has been configured without support for threads."
129-
# endif
127+
#ifdef _LIBCPP_HAS_NO_THREADS
128+
# error "<shared_mutex> is not supported since libc++ has been configured without support for threads."
129+
#endif
130130

131131
#include <__assert> // all public C++ headers provide the assertion handler
132132
#include <__availability>

libcxx/include/string

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,11 @@ public:
938938
// Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS
939939
// does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
940940
// __str's memory needs to be unpoisoned only in the case where it's a short string.
941-
: __r_([](basic_string &__s) -> decltype(__s.__r_)&& { if(!__s.__is_long()) __s.__annotate_delete(); return std::move(__s.__r_); }(__str)) {
941+
: __r_([](basic_string& __s) -> decltype(__s.__r_)&& {
942+
if (!__s.__is_long())
943+
__s.__annotate_delete();
944+
return std::move(__s.__r_);
945+
}(__str)) {
942946
__str.__r_.first() = __rep();
943947
__str.__annotate_new(0);
944948
if (!__is_long())
@@ -1918,7 +1922,7 @@ private:
19181922
}
19191923

19201924
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_new(size_type __current_size) const _NOEXCEPT {
1921-
(void) __current_size;
1925+
(void)__current_size;
19221926
#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
19231927
if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
19241928
__annotate_contiguous_container(data() + capacity() + 1, data() + __current_size + 1);
@@ -1933,15 +1937,15 @@ private:
19331937
}
19341938

19351939
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_increase(size_type __n) const _NOEXCEPT {
1936-
(void) __n;
1940+
(void)__n;
19371941
#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
19381942
if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
19391943
__annotate_contiguous_container(data() + size() + 1, data() + size() + 1 + __n);
19401944
#endif
19411945
}
19421946

19431947
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_shrink(size_type __old_size) const _NOEXCEPT {
1944-
(void) __old_size;
1948+
(void)__old_size;
19451949
#if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
19461950
if (!__libcpp_is_constant_evaluated() && (__asan_short_string_is_annotated() || __is_long()))
19471951
__annotate_contiguous_container(data() + __old_size + 1, data() + size() + 1);
@@ -1952,9 +1956,7 @@ private:
19521956
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __align_it(size_type __s) _NOEXCEPT {
19531957
return (__s + (__a - 1)) & ~(__a - 1);
19541958
}
1955-
enum {
1956-
__alignment = 8
1957-
};
1959+
enum { __alignment = 8 };
19581960
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __recommend(size_type __s) _NOEXCEPT {
19591961
if (__s < __min_cap) {
19601962
return static_cast<size_type>(__min_cap) - 1;

libcxx/include/valarray

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
24352435
inline valarray<_Tp>& valarray<_Tp>::operator*=(const _Expr& __v) {
24362436
size_t __i = 0;
24372437
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
2438-
*__t *= std::__get(__v,__i);
2438+
*__t *= std::__get(__v, __i);
24392439
return *this;
24402440
}
24412441

@@ -2444,7 +2444,7 @@ template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
24442444
inline valarray<_Tp>& valarray<_Tp>::operator/=(const _Expr& __v) {
24452445
size_t __i = 0;
24462446
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
2447-
*__t /= std::__get(__v,__i);
2447+
*__t /= std::__get(__v, __i);
24482448
return *this;
24492449
}
24502450

libcxx/include/vector

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,8 @@ private:
831831
// For more details, see the "Using libc++" documentation page or
832832
// the documentation for __sanitizer_annotate_contiguous_container.
833833

834-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __annotate_contiguous_container(
835-
const void* __old_mid, const void* __new_mid) const {
834+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
835+
__annotate_contiguous_container(const void* __old_mid, const void* __new_mid) const {
836836
(void)__old_mid;
837837
(void)__new_mid;
838838
#ifndef _LIBCPP_HAS_NO_ASAN

0 commit comments

Comments
 (0)