Просмотр исходного кода

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
Kitware Robot 2 лет назад
Родитель
Сommit
33abef7416
62 измененных файлов с 148 добавлено и 136 удалено
  1. 2 1
      Modules/CMakeCCompilerABI.c
  2. 1 1
      Modules/TestForANSIStreamHeaders.cxx
  3. 1 1
      Modules/TestForAnsiForScope.cxx
  4. 1 1
      Modules/TestForSSTREAM.cxx
  5. 1 1
      Modules/TestForSTDNamespace.cxx
  6. 8 2
      Source/CPack/cmCPackGenerator.h
  7. 8 8
      Source/CTest/cmCTestBuildHandler.cxx
  8. 1 1
      Source/cmArchiveWrite.cxx
  9. 1 1
      Source/cmCPluginAPI.h
  10. 8 8
      Source/cmCTest.cxx
  11. 1 1
      Source/cmComputeLinkInformation.cxx
  12. 1 1
      Source/cmExtraEclipseCDT4Generator.cxx
  13. 3 3
      Source/cmGlobalVisualStudio10Generator.cxx
  14. 3 3
      Source/cmGlobalVisualStudio7Generator.cxx
  15. 13 15
      Source/cmJSONHelpers.h
  16. 3 3
      Source/cmRange.h
  17. 3 4
      Source/cmSetPropertyCommand.cxx
  18. 1 1
      Source/cmSystemTools.cxx
  19. 7 6
      Tests/CMakeGUI/CatchShow.h
  20. 1 1
      Tests/CMakeLib/testArgumentParser.cxx
  21. 1 1
      Tests/CMakeLib/testCMExtAlgorithm.cxx
  22. 1 1
      Tests/CMakeLib/testCMExtEnumSet.cxx
  23. 1 1
      Tests/CMakeLib/testCMExtMemory.cxx
  24. 1 1
      Tests/CMakeLib/testCMFilesystemPath.cxx
  25. 1 1
      Tests/CMakeLib/testCTestBinPacker.cxx
  26. 1 1
      Tests/CMakeLib/testCTestResourceGroups.cxx
  27. 1 1
      Tests/CMakeLib/testFindPackageCommand.cxx
  28. 1 1
      Tests/CMakeLib/testGeneratedFileStream.cxx
  29. 1 1
      Tests/CMakeLib/testJSONHelpers.cxx
  30. 1 1
      Tests/CMakeLib/testOptional.cxx
  31. 1 1
      Tests/CMakeLib/testRange.cxx
  32. 1 1
      Tests/CMakeLib/testString.cxx
  33. 1 1
      Tests/CMakeLib/testStringAlgorithms.cxx
  34. 1 1
      Tests/CMakeLib/testSystemTools.cxx
  35. 1 1
      Tests/CMakeLib/testUTF8.cxx
  36. 1 2
      Tests/CMakeLib/testUVRAII.cxx
  37. 7 6
      Tests/CMakeLib/testUVStreambuf.cxx
  38. 1 1
      Tests/CMakeLib/testVisualStudioSlnParser.cxx
  39. 1 1
      Tests/CMakeLib/testXMLParser.cxx
  40. 1 1
      Tests/CMakeLib/testXMLSafe.cxx
  41. 4 1
      Tests/CompileFeatures/cxx_attribute_deprecated.cpp
  42. 1 1
      Tests/CompileFeatures/cxx_attributes.cpp
  43. 1 1
      Tests/Cuda/SeparableCompCXXOnly/main.cpp
  44. 1 1
      Tests/FindOpenACC/CXXTest/main.cxx
  45. 1 1
      Tests/QtAutogen/Complex/calwidget.cpp
  46. 1 1
      Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx
  47. 1 1
      Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx
  48. 1 1
      Tests/RunCMake/CXXModules/examples/partitions/importable.cxx
  49. 1 1
      Tests/RunCMake/CXXModules/examples/partitions/partition.cxx
  50. 1 1
      Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx
  51. 1 1
      Tests/RunCMake/CXXModules/sources/module-internal-part.cxx
  52. 2 2
      Tests/RunCMake/CXXModules/sources/module-part-impl.cxx
  53. 1 1
      Tests/RunCMake/CXXModules/sources/module-part.cxx
  54. 2 2
      Tests/RunCMake/CXXModules/sources/module.cxx
  55. 1 0
      Tests/RunCMake/CommandLine/cmake_depends/test.c
  56. 1 1
      Tests/StringFileTest/StringFile.cxx
  57. 1 1
      Tests/SystemInformation/DumpInformation.cxx
  58. 8 2
      Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h
  59. 2 1
      Tests/Wrapping/Wrap.c
  60. 16 20
      Utilities/std/cm/bits/string_view.cxx
  61. 2 2
      Utilities/std/cm/string_view
  62. 4 4
      Utilities/std/cmext/iterator

+ 2 - 1
Modules/CMakeCCompilerABI.c

@@ -9,7 +9,8 @@
 #include "CMakeCompilerABI.h"
 
 #ifdef __CLASSIC_C__
-int main(argc, argv) int argc;
+int main(argc, argv)
+int argc;
 char* argv[];
 #else
 int main(int argc, char* argv[])

+ 1 - 1
Modules/TestForANSIStreamHeaders.cxx

@@ -1,6 +1,6 @@
 #include <iostream>
 
-int main(int, char* [])
+int main(int, char*[])
 {
   return 0;
 }

+ 1 - 1
Modules/TestForAnsiForScope.cxx

@@ -1,4 +1,4 @@
-int main(int, char* [])
+int main(int, char*[])
 {
   int i;
   for (int i = 0; i < 1; ++i)

+ 1 - 1
Modules/TestForSSTREAM.cxx

@@ -1,5 +1,5 @@
 #include <sstream>
-int main(int, char* [])
+int main(int, char*[])
 {
   std::ostringstream os;
   os << "12345";

+ 1 - 1
Modules/TestForSTDNamespace.cxx

@@ -1,5 +1,5 @@
 #include <list>
-int main(int, char* [])
+int main(int, char*[])
 {
   std::list<int>();
   return 0;

+ 8 - 2
Source/CPack/cmCPackGenerator.h

@@ -344,8 +344,14 @@ private:
 
 #define cmCPackTypeMacro(klass, superclass)                                   \
   using Superclass = superclass;                                              \
-  const char* GetNameOfClass() override { return #klass; }                    \
-  static cmCPackGenerator* CreateGenerator() { return new klass; }            \
+  const char* GetNameOfClass() override                                       \
+  {                                                                           \
+    return #klass;                                                            \
+  }                                                                           \
+  static cmCPackGenerator* CreateGenerator()                                  \
+  {                                                                           \
+    return new klass;                                                         \
+  }                                                                           \
   class cmCPackTypeMacro_UseTrailingSemicolon
 
 #define cmCPackLogger(logType, msg)                                           \

+ 8 - 8
Source/CTest/cmCTestBuildHandler.cxx

@@ -671,10 +671,10 @@ bool cmCTestBuildHandler::IsLaunchedWarningFile(const char* fname)
           cmHasLiteralSuffix(fname, ".xml"));
 }
 
-//######################################################################
-//######################################################################
-//######################################################################
-//######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
 
 class cmCTestBuildHandler::LaunchHelper
 {
@@ -963,10 +963,10 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
   return result;
 }
 
-//######################################################################
-//######################################################################
-//######################################################################
-//######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
 
 void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
                                         size_t& tick, size_t tick_len,

+ 1 - 1
Source/cmArchiveWrite.cxx

@@ -68,7 +68,7 @@ public:
   ~Entry() { archive_entry_free(this->Object); }
   Entry(const Entry&) = delete;
   Entry& operator=(const Entry&) = delete;
-  operator struct archive_entry*() { return this->Object; }
+  operator struct archive_entry *() { return this->Object; }
 };
 
 struct cmArchiveWrite::Callback

+ 1 - 1
Source/cmCPluginAPI.h

@@ -201,7 +201,7 @@ typedef const char*(CCONV* CM_DOC_FUNCTION)();
 
 /* NOLINTNEXTLINE(modernize-use-using) */
 typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc,
-                                             char* []);
+                                             char*[]);
 
 /* NOLINTNEXTLINE(modernize-use-using) */
 typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf);

+ 8 - 8
Source/cmCTest.cxx

@@ -1066,10 +1066,10 @@ int cmCTest::GetTestModelFromString(const std::string& str)
   return cmCTest::EXPERIMENTAL;
 }
 
-//######################################################################
-//######################################################################
-//######################################################################
-//######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
 
 int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
                             int* retVal, const char* dir, cmDuration timeout,
@@ -1185,10 +1185,10 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
   return result;
 }
 
-//######################################################################
-//######################################################################
-//######################################################################
-//######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
+// ######################################################################
 
 int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
                      int* retVal, std::ostream* log, cmDuration testTimeOut,

+ 1 - 1
Source/cmComputeLinkInformation.cxx

@@ -30,7 +30,7 @@
 #include "cmValue.h"
 #include "cmake.h"
 
-//#define CM_COMPUTE_LINK_INFO_DEBUG
+// #define CM_COMPUTE_LINK_INFO_DEBUG
 
 /*
 Notes about linking on various platforms:

+ 1 - 1
Source/cmExtraEclipseCDT4Generator.cxx

@@ -67,7 +67,7 @@ cmExtraEclipseCDT4Generator::GetFactory()
 
   if (factory.GetSupportedGlobalGenerators().empty()) {
 // TODO: Verify if __CYGWIN__ should be checked.
-//#if defined(_WIN32) && !defined(__CYGWIN__)
+// #if defined(_WIN32) && !defined(__CYGWIN__)
 #if defined(_WIN32)
     factory.AddSupportedGlobalGenerator("NMake Makefiles");
     factory.AddSupportedGlobalGenerator("MinGW Makefiles");

+ 3 - 3
Source/cmGlobalVisualStudio10Generator.cxx

@@ -773,9 +773,9 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
   std::string mskey;
 
   // Search in standard location.
-  mskey = cmStrCat(
-    R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)",
-    this->GetToolsVersion(), ";MSBuildToolsPath");
+  mskey =
+    cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)",
+             this->GetToolsVersion(), ";MSBuildToolsPath");
   if (cmSystemTools::ReadRegistryValue(mskey, msbuild,
                                        cmSystemTools::KeyWOW64_32)) {
     cmSystemTools::ConvertToUnixSlashes(msbuild);

+ 3 - 3
Source/cmGlobalVisualStudio7Generator.cxx

@@ -168,9 +168,9 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
   }
 
   // Search where VS15Preview places it.
-  vskey = cmStrCat(
-    R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)",
-    this->GetIDEVersion());
+  vskey =
+    cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)",
+             this->GetIDEVersion());
   if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
                                        cmSystemTools::KeyWOW64_32)) {
     cmSystemTools::ConvertToUnixSlashes(vscmd);

+ 13 - 15
Source/cmJSONHelpers.h

@@ -36,26 +36,24 @@ struct cmJSONHelperBuilder
     Object& Bind(const cm::string_view& name, M U::*member, F func,
                  bool required = true)
     {
-      return this->BindPrivate(name,
-                               [func, member](T& out, const Json::Value* value,
-                                              CallState&&... state) -> E {
-                                 return func(out.*member, value,
-                                             std::forward(state)...);
-                               },
-                               required);
+      return this->BindPrivate(
+        name,
+        [func, member](T& out, const Json::Value* value, CallState&&... state)
+          -> E { return func(out.*member, value, std::forward(state)...); },
+        required);
     }
     template <typename M, typename F>
     Object& Bind(const cm::string_view& name, std::nullptr_t, F func,
                  bool required = true)
     {
-      return this->BindPrivate(name,
-                               [func](T& /*out*/, const Json::Value* value,
-                                      CallState&&... state) -> E {
-                                 M dummy;
-                                 return func(dummy, value,
-                                             std::forward(state)...);
-                               },
-                               required);
+      return this->BindPrivate(
+        name,
+        [func](T& /*out*/, const Json::Value* value,
+               CallState&&... state) -> E {
+          M dummy;
+          return func(dummy, value, std::forward(state)...);
+        },
+        required);
     }
     template <typename F>
     Object& Bind(const cm::string_view& name, F func, bool required = true)

+ 3 - 3
Source/cmRange.h

@@ -76,9 +76,9 @@ class TransformIterator
 {
 public:
   using iterator_category = std::bidirectional_iterator_tag;
-  using value_type =
-    typename std::remove_cv<typename std::remove_reference<decltype(
-      std::declval<UnaryFunction>()(*std::declval<Iter>()))>::type>::type;
+  using value_type = typename std::remove_cv<
+    typename std::remove_reference<decltype(std::declval<UnaryFunction>()(
+      *std::declval<Iter>()))>::type>::type;
   using difference_type = typename std::iterator_traits<Iter>::difference_type;
   using pointer = value_type const*;
   using reference = value_type const&;

+ 3 - 4
Source/cmSetPropertyCommand.cxx

@@ -619,10 +619,9 @@ bool HandleSource(cmSourceFile* sf, const std::string& propertyName,
   if (propertyName == "GENERATED") {
     SetPropertyCommand::PropertyOp op = (remove)
       ? SetPropertyCommand::PropertyOp::Remove
-      : (appendAsString)
-        ? SetPropertyCommand::PropertyOp::AppendAsString
-        : (appendMode) ? SetPropertyCommand::PropertyOp::Append
-                       : SetPropertyCommand::PropertyOp::Set;
+      : (appendAsString) ? SetPropertyCommand::PropertyOp::AppendAsString
+      : (appendMode)     ? SetPropertyCommand::PropertyOp::Append
+                         : SetPropertyCommand::PropertyOp::Set;
     return SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
       sf, propertyValue, op);
   }

+ 1 - 1
Source/cmSystemTools.cxx

@@ -3044,7 +3044,7 @@ static cm::optional<bool> SetRPathELF(std::string const& file,
 {
   auto adjustCallback = [newRPath](cm::optional<std::string>& outRPath,
                                    const std::string& inRPath,
-                                   const char* /*se_name*/, std::string *
+                                   const char* /*se_name*/, std::string*
                                    /*emsg*/) -> bool {
     if (inRPath != newRPath) {
       outRPath = newRPath;

+ 7 - 6
Tests/CMakeGUI/CatchShow.h

@@ -30,12 +30,13 @@ void CatchShow::setCallback(F&& func)
   this->m_callback = [this, func](QObject* obj) {
     auto* d = qobject_cast<T*>(obj);
     if (d) {
-      QMetaObject::invokeMethod(obj,
-                                [this, func, d]() {
-                                  ++this->m_count;
-                                  func(d);
-                                },
-                                Qt::QueuedConnection);
+      QMetaObject::invokeMethod(
+        obj,
+        [this, func, d]() {
+          ++this->m_count;
+          func(d);
+        },
+        Qt::QueuedConnection);
     }
   };
 }

+ 1 - 1
Tests/CMakeLib/testArgumentParser.cxx

@@ -365,7 +365,7 @@ bool testArgumentParserStaticBool()
 
 } // namespace
 
-int testArgumentParser(int /*unused*/, char* /*unused*/ [])
+int testArgumentParser(int /*unused*/, char* /*unused*/[])
 {
   if (!testArgumentParserDynamic()) {
     std::cout << "While executing testArgumentParserDynamic().\n";

+ 1 - 1
Tests/CMakeLib/testCMExtAlgorithm.cxx

@@ -110,7 +110,7 @@ void testAppend()
 }
 }
 
-int testCMExtAlgorithm(int /*unused*/, char* /*unused*/ [])
+int testCMExtAlgorithm(int /*unused*/, char* /*unused*/[])
 {
   testAppend();
 

+ 1 - 1
Tests/CMakeLib/testCMExtEnumSet.cxx

@@ -203,7 +203,7 @@ void testEdition()
 }
 }
 
-int testCMExtEnumSet(int /*unused*/, char* /*unused*/ [])
+int testCMExtEnumSet(int /*unused*/, char* /*unused*/[])
 {
   testDeclaration();
   testIteration();

+ 1 - 1
Tests/CMakeLib/testCMExtMemory.cxx

@@ -55,7 +55,7 @@ bool testReferenceCast()
 }
 }
 
-int testCMExtMemory(int /*unused*/, char* /*unused*/ [])
+int testCMExtMemory(int /*unused*/, char* /*unused*/[])
 {
   if (!testReferenceCast()) {
     return 1;

+ 1 - 1
Tests/CMakeLib/testCMFilesystemPath.cxx

@@ -969,7 +969,7 @@ bool testNonMemberFunctions()
 }
 }
 
-int testCMFilesystemPath(int /*unused*/, char* /*unused*/ [])
+int testCMFilesystemPath(int /*unused*/, char* /*unused*/[])
 {
   int result = 0;
 

+ 1 - 1
Tests/CMakeLib/testCTestBinPacker.cxx

@@ -275,7 +275,7 @@ static bool TestExpectedPackResult(const ExpectedPackResult& expected)
   return true;
 }
 
-int testCTestBinPacker(int /*unused*/, char* /*unused*/ [])
+int testCTestBinPacker(int /*unused*/, char* /*unused*/[])
 {
   int retval = 0;
 

+ 1 - 1
Tests/CMakeLib/testCTestResourceGroups.cxx

@@ -127,7 +127,7 @@ static bool TestExpectedParseResult(const ExpectedParseResult& expected)
   return true;
 }
 
-int testCTestResourceGroups(int /*unused*/, char* /*unused*/ [])
+int testCTestResourceGroups(int /*unused*/, char* /*unused*/[])
 {
   int retval = 0;
 

+ 1 - 1
Tests/CMakeLib/testFindPackageCommand.cxx

@@ -14,7 +14,7 @@
   std::cout << "FAILED: " << (m) << "\n";                                     \
   failed = 1
 
-int testFindPackageCommand(int /*unused*/, char* /*unused*/ [])
+int testFindPackageCommand(int /*unused*/, char* /*unused*/[])
 {
   int failed = 0;
 

+ 1 - 1
Tests/CMakeLib/testGeneratedFileStream.cxx

@@ -10,7 +10,7 @@
   std::cout << "FAILED: " << (m1) << (m2) << "\n";                            \
   failed = 1
 
-int testGeneratedFileStream(int /*unused*/, char* /*unused*/ [])
+int testGeneratedFileStream(int /*unused*/, char* /*unused*/[])
 {
   int failed = 0;
   cmGeneratedFileStream gm;

+ 1 - 1
Tests/CMakeLib/testJSONHelpers.cxx

@@ -457,7 +457,7 @@ bool testRequired()
 }
 }
 
-int testJSONHelpers(int /*unused*/, char* /*unused*/ [])
+int testJSONHelpers(int /*unused*/, char* /*unused*/[])
 {
   if (!testInt()) {
     return 1;

+ 1 - 1
Tests/CMakeLib/testOptional.cxx

@@ -760,7 +760,7 @@ static bool testMemoryRange(std::vector<Event>& expected)
   return true;
 }
 
-int testOptional(int /*unused*/, char* /*unused*/ [])
+int testOptional(int /*unused*/, char* /*unused*/[])
 {
   int retval = 0;
 

+ 1 - 1
Tests/CMakeLib/testRange.cxx

@@ -15,7 +15,7 @@
     }                                                                         \
   } while (false)
 
-int testRange(int /*unused*/, char* /*unused*/ [])
+int testRange(int /*unused*/, char* /*unused*/[])
 {
   std::vector<int> const testData = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
 

+ 1 - 1
Tests/CMakeLib/testString.cxx

@@ -1163,7 +1163,7 @@ static bool testStability()
   return true;
 }
 
-int testString(int /*unused*/, char* /*unused*/ [])
+int testString(int /*unused*/, char* /*unused*/[])
 {
   if (!testConstructDefault()) {
     return 1;

+ 1 - 1
Tests/CMakeLib/testStringAlgorithms.cxx

@@ -14,7 +14,7 @@
 
 #include "cmStringAlgorithms.h"
 
-int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
+int testStringAlgorithms(int /*unused*/, char* /*unused*/[])
 {
   int failed = 0;
 

+ 1 - 1
Tests/CMakeLib/testSystemTools.cxx

@@ -25,7 +25,7 @@
     }                                                                         \
   } while (false)
 
-int testSystemTools(int /*unused*/, char* /*unused*/ [])
+int testSystemTools(int /*unused*/, char* /*unused*/[])
 {
   int failed = 0;
   // ----------------------------------------------------------------------

+ 1 - 1
Tests/CMakeLib/testUTF8.cxx

@@ -164,7 +164,7 @@ static bool is_invalid(const char* s)
   return true;
 }
 
-int testUTF8(int /*unused*/, char* /*unused*/ [])
+int testUTF8(int /*unused*/, char* /*unused*/[])
 {
   int result = 0;
   for (test_utf8_entry const* e = good_entry; e->n; ++e) {

+ 1 - 2
Tests/CMakeLib/testUVRAII.cxx

@@ -30,8 +30,7 @@ static bool testAsyncShutdown()
     std::thread([&] {
       std::this_thread::sleep_for(std::chrono::seconds(2));
       signal.send();
-    })
-      .detach();
+    }).detach();
 
     if (uv_run(&Loop, UV_RUN_DEFAULT) != 0) {
       std::cerr << "Unclean exit state in testAsyncDtor" << std::endl;

+ 7 - 6
Tests/CMakeLib/testUVStreambuf.cxx

@@ -404,12 +404,13 @@ static bool testUVStreambufRead(
               << std::endl;
     goto end;
   }
-  uv_timer_start(timer,
-                 [](uv_timer_t* handle) {
-                   auto buf = static_cast<cmUVStreambuf*>(handle->data);
-                   buf->close();
-                 },
-                 0, 0);
+  uv_timer_start(
+    timer,
+    [](uv_timer_t* handle) {
+      auto buf = static_cast<cmUVStreambuf*>(handle->data);
+      buf->close();
+    },
+    0, 0);
   if ((readLen = inputBuf.sgetn(inputData.data(), 128)) != 0) {
     std::cout << "sgetn() returned " << readLen << ", should be 0"
               << std::endl;

+ 1 - 1
Tests/CMakeLib/testVisualStudioSlnParser.cxx

@@ -27,7 +27,7 @@ static bool parsedRight(cmVisualStudioSlnParser& parser,
   return false;
 }
 
-int testVisualStudioSlnParser(int, char* [])
+int testVisualStudioSlnParser(int, char*[])
 {
   cmVisualStudioSlnParser parser;
 

+ 1 - 1
Tests/CMakeLib/testXMLParser.cxx

@@ -4,7 +4,7 @@
 
 #include "cmXMLParser.h"
 
-int testXMLParser(int /*unused*/, char* /*unused*/ [])
+int testXMLParser(int /*unused*/, char* /*unused*/[])
 {
   // TODO: Derive from parser and check attributes.
   cmXMLParser parser;

+ 1 - 1
Tests/CMakeLib/testXMLSafe.cxx

@@ -25,7 +25,7 @@ static test_pair const pairs[] = {
   { nullptr, nullptr }
 };
 
-int testXMLSafe(int /*unused*/, char* /*unused*/ [])
+int testXMLSafe(int /*unused*/, char* /*unused*/[])
 {
   int result = 0;
   for (test_pair const* p = pairs; p->in; ++p) {

+ 4 - 1
Tests/CompileFeatures/cxx_attribute_deprecated.cpp

@@ -1,5 +1,8 @@
 
-[[deprecated]] int foo() { return 0; }
+[[deprecated]] int foo()
+{
+  return 0;
+}
 
 int someFunc()
 {

+ 1 - 1
Tests/CompileFeatures/cxx_attributes.cpp

@@ -1,5 +1,5 @@
 
-void unusedFunc[[noreturn]]()
+void unusedFunc [[noreturn]] ()
 {
   throw 1;
 }

+ 1 - 1
Tests/Cuda/SeparableCompCXXOnly/main.cpp

@@ -1,5 +1,5 @@
 
-int main(int, char const* [])
+int main(int, char const*[])
 {
   return 0;
 }

+ 1 - 1
Tests/FindOpenACC/CXXTest/main.cxx

@@ -8,7 +8,7 @@ void vecaddgpu(float* r, float* a, float* b, std::size_t n)
     r[i] = a[i] + b[i];
 }
 
-int main(int, char* [])
+int main(int, char*[])
 {
   const std::size_t n = 100000; /* vector length */
   std::vector<float> a(n);      /* input vector 1 */

+ 1 - 1
Tests/QtAutogen/Complex/calwidget.cpp

@@ -433,4 +433,4 @@ QComboBox* Window::createColorComboBox()
   return comboBox;
 }
 
-//#include "moc_calwidget.cpp"
+// #include "moc_calwidget.cpp"

+ 1 - 1
Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx

@@ -1,5 +1,5 @@
 export module importable;
-import : internal_partition;
+import :internal_partition;
 
 #include "internal-partitions_export.h"
 

+ 1 - 1
Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx

@@ -1,4 +1,4 @@
-module importable : internal_partition;
+module importable:internal_partition;
 
 int from_partition()
 {

+ 1 - 1
Tests/RunCMake/CXXModules/examples/partitions/importable.cxx

@@ -1,5 +1,5 @@
 export module importable;
-export import : partition;
+export import :partition;
 
 #include "partitions_export.h"
 

+ 1 - 1
Tests/RunCMake/CXXModules/examples/partitions/partition.cxx

@@ -1,4 +1,4 @@
-export module importable : partition;
+export module importable:partition;
 
 #include "partitions_export.h"
 

+ 1 - 1
Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx

@@ -1,6 +1,6 @@
 #ifdef _MSC_VER
 // Only MSVC supports this pattern.
-module M : internal_part;
+module M:internal_part;
 #else
 module M;
 #endif

+ 1 - 1
Tests/RunCMake/CXXModules/sources/module-internal-part.cxx

@@ -1,3 +1,3 @@
-module M : internal_part;
+module M:internal_part;
 
 int i();

+ 2 - 2
Tests/RunCMake/CXXModules/sources/module-part-impl.cxx

@@ -1,11 +1,11 @@
 #ifdef _MSC_VER
 // Only MSVC supports this pattern.
-module M : part;
+module M:part;
 #else
 module M;
 #endif
 
-import M : internal_part;
+import M:internal_part;
 
 int p()
 {

+ 1 - 1
Tests/RunCMake/CXXModules/sources/module-part.cxx

@@ -1,3 +1,3 @@
-export module M : part;
+export module M:part;
 
 int p();

+ 2 - 2
Tests/RunCMake/CXXModules/sources/module.cxx

@@ -1,5 +1,5 @@
 export module M;
-export import M : part;
-import M : internal_part;
+export import M:part;
+import M:internal_part;
 
 int f();

+ 1 - 0
Tests/RunCMake/CommandLine/cmake_depends/test.c

@@ -1,2 +1,3 @@
 #include "test.h"
+
 #include "test_UTF-16LE.h"

+ 1 - 1
Tests/StringFileTest/StringFile.cxx

@@ -3,7 +3,7 @@
 
 #include "OutputFile.h"
 
-int main(int, char* [])
+int main(int, char*[])
 {
   int res = 0;
 

+ 1 - 1
Tests/SystemInformation/DumpInformation.cxx

@@ -53,7 +53,7 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout)
   }
 }
 
-int main(int, char* [])
+int main(int, char*[])
 {
   const char* files[] = {
     DumpInformation_BINARY_DIR "/SystemInformation.out",

+ 8 - 2
Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h

@@ -52,13 +52,19 @@ public:
   // Update().
   property float Total
   {
-    float get() { return m_total; }
+    float get()
+    {
+      return m_total;
+    }
   }
 
   // Duration in seconds between the previous two calls to Update().
   property float Delta
   {
-    float get() { return m_delta; }
+    float get()
+    {
+      return m_delta;
+    }
   }
 
 private:

+ 2 - 1
Tests/Wrapping/Wrap.c

@@ -1,7 +1,8 @@
 #include <stdio.h>
 
 #ifdef __CLASSIC_C__
-int main(argc, argv) int argc;
+int main(argc, argv)
+int argc;
 char** argv;
 #else
 int main(int argc, const char* argv[])

+ 16 - 20
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);
 }

+ 2 - 2
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;

+ 4 - 4
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