summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2023-01-18 17:46:53 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-18 21:20:47 (GMT)
commit33abef7416401b7db9f5f68cee447b4246310e72 (patch)
tree4639cca017838624bfb38c9d82eb34266a28b0c8 /Utilities
parent57221fd56f77d32703aadada435d9a8f0dc3fb6c (diff)
downloadCMake-33abef7416401b7db9f5f68cee447b4246310e72.zip
CMake-33abef7416401b7db9f5f68cee447b4246310e72.tar.gz
CMake-33abef7416401b7db9f5f68cee447b4246310e72.tar.bz2
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
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/std/cm/bits/string_view.cxx36
-rw-r--r--Utilities/std/cm/string_view4
-rw-r--r--Utilities/std/cmext/iterator8
3 files changed, 22 insertions, 26 deletions
diff --git a/Utilities/std/cm/bits/string_view.cxx b/Utilities/std/cm/bits/string_view.cxx
index 5381fe6..af5ae78 100644
--- a/Utilities/std/cm/bits/string_view.cxx
+++ b/Utilities/std/cm/bits/string_view.cxx
@@ -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);
}
diff --git a/Utilities/std/cm/string_view b/Utilities/std/cm/string_view
index 35cf5d9..320e1e7 100644
--- a/Utilities/std/cm/string_view
+++ b/Utilities/std/cm/string_view
@@ -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;
diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator
index 83d7890..eba10dd 100644
--- a/Utilities/std/cmext/iterator
+++ b/Utilities/std/cmext/iterator
@@ -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