diff options
author | Brad King <brad.king@kitware.com> | 2023-01-19 14:07:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-01-19 14:07:18 (GMT) |
commit | d6d847607c5f312c9b85605c8a4596377275a34b (patch) | |
tree | 4520266bea637b441079cde51cb89c29a2a61816 /Source | |
parent | 4c5efdcfa87ddedfe1264119032a2245f5269691 (diff) | |
parent | 33abef7416401b7db9f5f68cee447b4246310e72 (diff) | |
download | CMake-d6d847607c5f312c9b85605c8a4596377275a34b.zip CMake-d6d847607c5f312c9b85605c8a4596377275a34b.tar.gz CMake-d6d847607c5f312c9b85605c8a4596377275a34b.tar.bz2 |
Merge topic 'clang-format-15'
33abef7416 Revise C++ coding style using clang-format-15
57221fd56f Empty commit at end of history preceding clang-format-15 style transition
6739d57948 clang-format.bash: update to clang-format-15
9ee57226bc clang-format: Add comments to suppress some formatting
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8086
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackGenerator.h | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 16 | ||||
-rw-r--r-- | Source/cmArchiveWrite.cxx | 2 | ||||
-rw-r--r-- | Source/cmCPluginAPI.h | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 16 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 2 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 2 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 6 | ||||
-rw-r--r-- | Source/cmJSONHelpers.h | 28 | ||||
-rw-r--r-- | Source/cmRange.h | 6 | ||||
-rw-r--r-- | Source/cmSetPropertyCommand.cxx | 7 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 2 |
14 files changed, 56 insertions, 51 deletions
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 65156ab..8078d9f 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/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) \ diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 66c30c0..c6387ab 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/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, diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index f29983c..e992b4b 100644 --- a/Source/cmArchiveWrite.cxx +++ b/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 diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index 0d8a366..13a93b7 100644 --- a/Source/cmCPluginAPI.h +++ b/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); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 72cd8cd..5899a61 100644 --- a/Source/cmCTest.cxx +++ b/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, diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index cd0a1dc..ad8fb8b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/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: diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 2084b33..618c794 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -39,12 +39,14 @@ constexpr size_t lang_property_start = 0; constexpr size_t lang_property_size = 4; constexpr size_t pie_property_start = 4; constexpr size_t pie_property_size = 2; +/* clang-format off */ #define SETUP_LANGUAGE(name, lang) \ static const std::string name[lang_property_size + pie_property_size + 1] = \ { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN", \ "CMAKE_" #lang "_COMPILER_TARGET", \ "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED", \ "CMAKE_" #lang "_PIE_SUPPORTED", "" } +/* clang-format on */ // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) SETUP_LANGUAGE(c_properties, C); diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index ba4b326..a07acdc 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/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"); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 192663d..a7a47ef 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/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); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index c375d60..d483135 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/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); diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index 48decbc..f7151b5 100644 --- a/Source/cmJSONHelpers.h +++ b/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) diff --git a/Source/cmRange.h b/Source/cmRange.h index 30af7d2..85cb8ea 100644 --- a/Source/cmRange.h +++ b/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&; diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 521cf63..de1e3b0 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/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); } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f94c4d3..0b29b0d 100644 --- a/Source/cmSystemTools.cxx +++ b/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; |