clang-tidy: Remove redundant member initializations

This commit is contained in:
Regina Pfeifer 2018-12-06 22:52:39 +01:00
parent 7ffa6bf999
commit 32cb564bea
26 changed files with 29 additions and 86 deletions

View File

@ -33,7 +33,6 @@ readability-*,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'

View File

@ -478,9 +478,7 @@ private:
unsigned long Time;
long TimeZone;
Person()
: Name()
, EMail()
, Time(0)
: Time(0)
, TimeZone(0)
{
}

View File

@ -119,7 +119,6 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
}
cmCTestSubmitHandler::cmCTestSubmitHandler()
: HTTPProxy()
{
this->Initialize();
}

View File

@ -39,8 +39,7 @@ public:
bool IsSharedDep;
bool IsFlag;
LinkEntry()
: Item()
, Target(nullptr)
: Target(nullptr)
, IsSharedDep(false)
, IsFlag(false)
{

View File

@ -31,8 +31,7 @@ public:
struct Item
{
Item()
: Value()
, IsPath(true)
: IsPath(true)
, Target(nullptr)
{
}

View File

@ -15,7 +15,6 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
, Byproducts(byproducts)
, Depends(depends)
, CommandLines(commandLines)
, Backtrace()
, Comment(comment ? comment : "")
, WorkingDirectory(workingDirectory ? workingDirectory : "")
, HaveComment(comment != nullptr)

View File

@ -48,8 +48,7 @@ private:
public:
Def()
: std_string()
, Exists(false)
: Exists(false)
, Used(false)
{
}

View File

@ -25,9 +25,7 @@ class cmExecutionStatus;
#endif
cmExportCommand::cmExportCommand()
: cmCommand()
, ArgumentGroup()
, Targets(&Helper, "TARGETS")
: Targets(&Helper, "TARGETS")
, Append(&Helper, "APPEND", &ArgumentGroup)
, ExportSetName(&Helper, "EXPORT", &ArgumentGroup)
, Namespace(&Helper, "NAMESPACE", &ArgumentGroup)

View File

@ -33,7 +33,6 @@ http://forums.codeblocks.org/index.php/topic,6789.0.html
*/
cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
: cmExternalMakefileProjectGenerator()
{
}

View File

@ -21,8 +21,7 @@
#include <utility>
cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
: cmExternalMakefileProjectGenerator()
, ConfigName("NoConfig")
: ConfigName("NoConfig")
, CpuCount(2)
{
}

View File

@ -41,7 +41,6 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value)
}
cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator()
: cmExternalMakefileProjectGenerator()
{
this->SupportsVirtualFolders = true;
this->GenerateLinkedResources = true;

View File

@ -17,7 +17,6 @@
#include <vector>
cmExtraKateGenerator::cmExtraKateGenerator()
: cmExternalMakefileProjectGenerator()
{
}

View File

@ -55,7 +55,6 @@ cmExtraSublimeTextGenerator::GetFactory()
}
cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator()
: cmExternalMakefileProjectGenerator()
{
this->ExcludeBuildFolder = false;
}

View File

@ -1676,8 +1676,7 @@ class cmFileList
{
public:
cmFileList()
: First()
, Last(nullptr)
: Last(nullptr)
{
}
virtual ~cmFileList() {}
@ -1710,8 +1709,7 @@ class cmFindPackageFileList : public cmFileList
{
public:
cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true)
: cmFileList()
, FPC(fpc)
: FPC(fpc)
, UseSuffixes(use_suffixes)
{
}
@ -1753,13 +1751,11 @@ class cmFileListGeneratorFixed : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorFixed(std::string const& str)
: cmFileListGeneratorBase()
, String(str)
: String(str)
{
}
cmFileListGeneratorFixed(cmFileListGeneratorFixed const& r)
: cmFileListGeneratorBase()
, String(r.String)
: String(r.String)
{
}
@ -1782,13 +1778,11 @@ class cmFileListGeneratorEnumerate : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorEnumerate(std::vector<std::string> const& v)
: cmFileListGeneratorBase()
, Vector(v)
: Vector(v)
{
}
cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r)
: cmFileListGeneratorBase()
, Vector(r.Vector)
: Vector(r.Vector)
{
}
@ -1817,14 +1811,12 @@ public:
cmFileListGeneratorProject(std::vector<std::string> const& names,
cmFindPackageCommand::SortOrderType so,
cmFindPackageCommand::SortDirectionType sd)
: cmFileListGeneratorBase()
, Names(names)
: Names(names)
{
this->SetSort(so, sd);
}
cmFileListGeneratorProject(cmFileListGeneratorProject const& r)
: cmFileListGeneratorBase()
, Names(r.Names)
: Names(r.Names)
{
this->SetSort(r.SortOrder, r.SortDirection);
}
@ -1888,14 +1880,12 @@ class cmFileListGeneratorMacProject : public cmFileListGeneratorBase
public:
cmFileListGeneratorMacProject(std::vector<std::string> const& names,
const char* ext)
: cmFileListGeneratorBase()
, Names(names)
: Names(names)
, Extension(ext)
{
}
cmFileListGeneratorMacProject(cmFileListGeneratorMacProject const& r)
: cmFileListGeneratorBase()
, Names(r.Names)
: Names(r.Names)
, Extension(r.Extension)
{
}
@ -1941,14 +1931,12 @@ class cmFileListGeneratorCaseInsensitive : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorCaseInsensitive(std::string const& str)
: cmFileListGeneratorBase()
, String(str)
: String(str)
{
}
cmFileListGeneratorCaseInsensitive(
cmFileListGeneratorCaseInsensitive const& r)
: cmFileListGeneratorBase()
, String(r.String)
: String(r.String)
{
}
@ -1985,13 +1973,11 @@ class cmFileListGeneratorGlob : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorGlob(std::string const& str)
: cmFileListGeneratorBase()
, Pattern(str)
: Pattern(str)
{
}
cmFileListGeneratorGlob(cmFileListGeneratorGlob const& r)
: cmFileListGeneratorBase()
, Pattern(r.Pattern)
: Pattern(r.Pattern)
{
}

View File

@ -12,8 +12,6 @@
#endif
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
: cmGeneratedFileStreamBase()
, Stream()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
if (encoding != codecvt::None) {
@ -105,9 +103,7 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext)
}
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
: Name()
, TempName()
, CopyIfDifferent(false)
: CopyIfDifferent(false)
, Okay(false)
, Compress(false)
, CompressExtraExtension(true)
@ -115,9 +111,7 @@ cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
}
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
: Name()
, TempName()
, CopyIfDifferent(false)
: CopyIfDifferent(false)
, Okay(false)
, Compress(false)
, CompressExtraExtension(true)

View File

@ -447,8 +447,6 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
, BuildFileStream(nullptr)
, RulesFileStream(nullptr)
, CompileCommandsStream(nullptr)
, Rules()
, AllDependencies()
, UsingGCCOnWindows(false)
, ComputingUnknownDependencies(false)
, PolicyCMP0058(cmPolicies::WARN)

View File

@ -17,9 +17,7 @@ const std::string cmInstallCommandArguments::EmptyString;
cmInstallCommandArguments::cmInstallCommandArguments(
const std::string& defaultComponent)
: Parser()
, ArgumentGroup()
, Destination(&Parser, "DESTINATION", &ArgumentGroup)
: Destination(&Parser, "DESTINATION", &ArgumentGroup)
, Component(&Parser, "COMPONENT", &ArgumentGroup)
, NamelinkComponent(&Parser, "NAMELINK_COMPONENT", &ArgumentGroup)
, ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup)

View File

@ -7,8 +7,7 @@
#include <utility> // IWYU pragma: keep
cmLinkItem::cmLinkItem()
: String()
, Target(nullptr)
: Target(nullptr)
{
}
@ -21,8 +20,7 @@ cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt)
cmLinkItem::cmLinkItem(cmGeneratorTarget const* t,
cmListFileBacktrace const& bt)
: String()
, Target(t)
: Target(t)
, Backtrace(bt)
{
}

View File

@ -54,8 +54,7 @@ struct cmListFileArgument
Bracket
};
cmListFileArgument()
: Value()
, Delim(Unquoted)
: Delim(Unquoted)
, Line(0)
{
}
@ -82,9 +81,7 @@ public:
std::string FilePath;
long Line;
cmListFileContext()
: Name()
, FilePath()
, Line(0)
: Line(0)
{
}

View File

@ -268,7 +268,6 @@ private:
std::string Language;
LocalObjectEntry()
: Target(nullptr)
, Language()
{
}
LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang)

View File

@ -37,13 +37,7 @@ class cmCustomCommand;
cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
cmGeneratorTarget* target)
: cmNinjaTargetGenerator(target)
, TargetNameOut()
, TargetNameSO()
, TargetNameReal()
, TargetNameImport()
, TargetNamePDB()
, TargetLinkLanguage("")
, DeviceLinkObject()
{
this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
if (target->GetType() == cmStateEnums::EXECUTABLE) {

View File

@ -54,10 +54,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
, MacOSXContentGenerator(nullptr)
, OSXBundleGenerator(nullptr)
, MacContentFolders()
, LocalGenerator(
static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator()))
, Objects()
{
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}

View File

@ -50,8 +50,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap
{
typedef cmPolicies::PolicyMap derived;
PolicyStackEntry(bool w = false)
: derived()
, Weak(w)
: Weak(w)
{
}
PolicyStackEntry(derived const& d, bool w)

View File

@ -28,7 +28,6 @@
cmStateSnapshot::cmStateSnapshot(cmState* state)
: State(state)
, Position()
{
}

View File

@ -625,8 +625,7 @@ private:
// Internal constructor for view of statically allocated string.
String(string_view v, Private)
: string_()
, view_(v)
: view_(v)
{
}

View File

@ -46,7 +46,6 @@ private:
}
RegexReplacement(int n)
: Number(n)
, Value()
{
}
RegexReplacement() {}