diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-22 18:37:59 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-11-29 17:39:29 (GMT) |
commit | f8a2926986de51ce99948cf160e882e57bf5f384 (patch) | |
tree | aa325c04415235fcc913579b8b578c68463a67a8 | |
parent | 63453bf4ef6aea31f072c559dda656fbd845ab41 (diff) | |
download | CMake-f8a2926986de51ce99948cf160e882e57bf5f384.zip CMake-f8a2926986de51ce99948cf160e882e57bf5f384.tar.gz CMake-f8a2926986de51ce99948cf160e882e57bf5f384.tar.bz2 |
clang-tidy: fix `modernize-use-default-member-init` lints
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 13 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 1 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.h | 10 | ||||
-rw-r--r-- | Source/cmVisualStudioSlnParser.cxx | 5 | ||||
-rw-r--r-- | Source/cmVisualStudioSlnParser.h | 4 | ||||
-rw-r--r-- | Source/cmVisualStudioWCEPlatformParser.h | 3 |
7 files changed, 14 insertions, 25 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index b3d9552..f0ec721 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -241,15 +241,10 @@ protected: private: struct LongestSourcePath { - LongestSourcePath() - : Length(0) - , Target(0) - , SourceFile(0) - { - } - size_t Length; - cmGeneratorTarget* Target; - cmSourceFile const* SourceFile; + LongestSourcePath() {} + size_t Length = 0; + cmGeneratorTarget* Target = 0; + cmSourceFile const* SourceFile = 0; std::string SourceRel; }; LongestSourcePath LongestSource; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 538c036..fab64c1 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -564,7 +564,6 @@ public: : LG(lg) , Config(config) , Stream(os) - , First(true) { } void Start(const char* tool) @@ -610,7 +609,7 @@ private: cmLocalVisualStudio7Generator* LG; std::string Config; std::ostream& Stream; - bool First; + bool First = true; }; void cmLocalVisualStudio7Generator::WriteConfiguration( diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 8764f21..068b5be 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -90,7 +90,6 @@ cmVSSetupAPIHelper::cmVSSetupAPIHelper(unsigned int version) , setupConfig(NULL) , setupConfig2(NULL) , setupHelper(NULL) - , initializationFailure(false) { comInitialized = CoInitializeEx(NULL, 0); if (SUCCEEDED(comInitialized)) { diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index a16f00b..6549b93 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -17,7 +17,7 @@ template <class T> class SmartCOMPtr { public: - SmartCOMPtr() { ptr = NULL; } + SmartCOMPtr() {} SmartCOMPtr(T* p) { ptr = p; @@ -65,13 +65,13 @@ public: } private: - T* ptr; + T* ptr = NULL; }; class SmartBSTR { public: - SmartBSTR() { str = NULL; } + SmartBSTR() {} SmartBSTR(const SmartBSTR& src) = delete; SmartBSTR& operator=(const SmartBSTR& src) = delete; operator BSTR() const { return str; } @@ -79,7 +79,7 @@ public: ~SmartBSTR() throw() { ::SysFreeString(str); } private: - BSTR str; + BSTR str = NULL; }; struct VSInstanceInfo @@ -129,7 +129,7 @@ private: SmartCOMPtr<ISetupConfiguration2> setupConfig2; SmartCOMPtr<ISetupHelper> setupHelper; // used to indicate failure in Initialize(), so we don't have to call again - bool initializationFailure; + bool initializationFailure = false; // indicated if COM initialization is successful HRESULT comInitialized; // current best instance of VS selected diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx index feab895..479e3ec 100644 --- a/Source/cmVisualStudioSlnParser.cxx +++ b/Source/cmVisualStudioSlnParser.cxx @@ -140,14 +140,13 @@ private: std::stack<FileState> Stack; std::string EndIgnoreTag; DataGroupSet RequestedData; - size_t CurrentLine; + size_t CurrentLine = 0; void IgnoreUntilTag(const std::string& endTag); }; cmVisualStudioSlnParser::State::State(DataGroupSet requestedData) : RequestedData(requestedData) - , CurrentLine(0) { if (this->RequestedData.test(DataGroupProjectDependenciesBit)) this->RequestedData.set(DataGroupProjectsBit); @@ -386,8 +385,6 @@ void cmVisualStudioSlnParser::State::IgnoreUntilTag(const std::string& endTag) } cmVisualStudioSlnParser::ResultData::ResultData() - : Result(ResultOK) - , ResultLine(0) { } diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h index 60be598..0cac140 100644 --- a/Source/cmVisualStudioSlnParser.h +++ b/Source/cmVisualStudioSlnParser.h @@ -73,8 +73,8 @@ protected: struct ResultData { - ParseResult Result; - size_t ResultLine; + ParseResult Result = ResultOK; + size_t ResultLine = 0; bool HadBOM; ResultData(); diff --git a/Source/cmVisualStudioWCEPlatformParser.h b/Source/cmVisualStudioWCEPlatformParser.h index 2fff91c..fb62688 100644 --- a/Source/cmVisualStudioWCEPlatformParser.h +++ b/Source/cmVisualStudioWCEPlatformParser.h @@ -18,7 +18,6 @@ class cmVisualStudioWCEPlatformParser : public cmXMLParser public: cmVisualStudioWCEPlatformParser(const char* name = NULL) : RequiredName(name) - , FoundRequiredName(false) { } @@ -61,7 +60,7 @@ private: std::vector<std::string> AvailablePlatforms; const char* RequiredName; - bool FoundRequiredName; + bool FoundRequiredName = false; std::string VcInstallDir; std::string VsInstallDir; }; |