clang-tidy: fix `modernize-use-default-member-init` lints

stage/master/nightly/2022/11/30
Ben Boeckel 2022-11-22 13:37:59 -05:00
parent 63453bf4ef
commit f8a2926986
7 changed files with 14 additions and 25 deletions

View File

@ -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;

View File

@ -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(

View File

@ -90,7 +90,6 @@ cmVSSetupAPIHelper::cmVSSetupAPIHelper(unsigned int version)
, setupConfig(NULL)
, setupConfig2(NULL)
, setupHelper(NULL)
, initializationFailure(false)
{
comInitialized = CoInitializeEx(NULL, 0);
if (SUCCEEDED(comInitialized)) {

View File

@ -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

View File

@ -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)
{
}

View File

@ -73,8 +73,8 @@ protected:
struct ResultData
{
ParseResult Result;
size_t ResultLine;
ParseResult Result = ResultOK;
size_t ResultLine = 0;
bool HadBOM;
ResultData();

View File

@ -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;
};