Revise C++ coding style using clang-format-15

Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 15.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Fixes: #24315
This commit is contained in:
Kitware Robot
2023-01-18 12:46:53 -05:00
committed by Brad King
parent 57221fd56f
commit 33abef7416
62 changed files with 148 additions and 136 deletions
+16 -20
View File
@@ -82,8 +82,8 @@ int string_view::compare(size_type pos1, size_type count1, const char* s,
return substr(pos1, count1).compare(string_view(s, count2));
}
string_view::size_type string_view::find(string_view v, size_type pos) const
noexcept
string_view::size_type string_view::find(string_view v,
size_type pos) const noexcept
{
for (; pos + v.size_ <= size_; ++pos) {
if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == 0) {
@@ -109,8 +109,8 @@ string_view::size_type string_view::find(const char* s, size_type pos) const
return find(string_view(s), pos);
}
string_view::size_type string_view::rfind(string_view v, size_type pos) const
noexcept
string_view::size_type string_view::rfind(string_view v,
size_type pos) const noexcept
{
if (size_ >= v.size_) {
for (pos = std::min(pos, size_ - v.size_) + 1; pos > 0;) {
@@ -151,8 +151,8 @@ string_view::size_type string_view::find_first_of(string_view v,
return npos;
}
string_view::size_type string_view::find_first_of(char c, size_type pos) const
noexcept
string_view::size_type string_view::find_first_of(char c,
size_type pos) const noexcept
{
return find_first_of(string_view(&c, 1), pos);
}
@@ -183,8 +183,8 @@ string_view::size_type string_view::find_last_of(string_view v,
return npos;
}
string_view::size_type string_view::find_last_of(char c, size_type pos) const
noexcept
string_view::size_type string_view::find_last_of(char c,
size_type pos) const noexcept
{
return find_last_of(string_view(&c, 1), pos);
}
@@ -201,9 +201,8 @@ string_view::size_type string_view::find_last_of(const char* s,
return find_last_of(string_view(s), pos);
}
string_view::size_type string_view::find_first_not_of(string_view v,
size_type pos) const
noexcept
string_view::size_type string_view::find_first_not_of(
string_view v, size_type pos) const noexcept
{
for (; pos < size_; ++pos) {
if (!traits_type::find(v.data_, v.size_, data_[pos])) {
@@ -213,9 +212,8 @@ string_view::size_type string_view::find_first_not_of(string_view v,
return npos;
}
string_view::size_type string_view::find_first_not_of(char c,
size_type pos) const
noexcept
string_view::size_type string_view::find_first_not_of(
char c, size_type pos) const noexcept
{
return find_first_not_of(string_view(&c, 1), pos);
}
@@ -233,9 +231,8 @@ string_view::size_type string_view::find_first_not_of(const char* s,
return find_first_not_of(string_view(s), pos);
}
string_view::size_type string_view::find_last_not_of(string_view v,
size_type pos) const
noexcept
string_view::size_type string_view::find_last_not_of(
string_view v, size_type pos) const noexcept
{
if (size_ > 0) {
for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) {
@@ -248,9 +245,8 @@ string_view::size_type string_view::find_last_not_of(string_view v,
return npos;
}
string_view::size_type string_view::find_last_not_of(char c,
size_type pos) const
noexcept
string_view::size_type string_view::find_last_not_of(
char c, size_type pos) const noexcept
{
return find_last_not_of(string_view(&c, 1), pos);
}
+2 -2
View File
@@ -157,8 +157,8 @@ public:
size_type count) const;
size_type find_first_not_of(const char* s, size_type pos = 0) const;
size_type find_last_not_of(string_view v, size_type pos = npos) const
noexcept;
size_type find_last_not_of(string_view v,
size_type pos = npos) const noexcept;
size_type find_last_not_of(char c, size_type pos = npos) const noexcept;
size_type find_last_not_of(const char* s, size_type pos,
size_type count) const;
+4 -4
View File
@@ -39,10 +39,10 @@ using is_input_range =
std::is_pointer<Range>::value ||
std::is_array<Range>::value>;
#else
cm::bool_constant<cm::is_input_iterator<decltype(
std::begin(std::declval<const Range>()))>::value &&
cm::is_input_iterator<decltype(
std::end(std::declval<const Range>()))>::value>;
cm::bool_constant<cm::is_input_iterator<decltype(std::begin(
std::declval<const Range>()))>::value &&
cm::is_input_iterator<decltype(std::end(
std::declval<const Range>()))>::value>;
#endif
} // namespace cm