Explorar el Código

clang-tidy: Use default member initialization

Regina Pfeifer hace 7 años
padre
commit
b2aa3aedea
Se han modificado 62 ficheros con 152 adiciones y 347 borrados
  1. 3 1
      .clang-tidy
  2. 2 5
      Source/CTest/cmCTestBuildHandler.cxx
  3. 3 7
      Source/CTest/cmCTestGIT.cxx
  4. 2 5
      Source/cmCPluginAPI.cxx
  5. 2 5
      Source/cmCTest.h
  6. 3 8
      Source/cmCacheManager.h
  7. 2 5
      Source/cmCommand.h
  8. 4 9
      Source/cmComputeLinkDepends.h
  9. 3 7
      Source/cmComputeLinkInformation.h
  10. 0 3
      Source/cmCustomCommand.cxx
  11. 3 9
      Source/cmDefinitions.h
  12. 0 3
      Source/cmDepends.cxx
  13. 3 3
      Source/cmDepends.h
  14. 0 1
      Source/cmDependsC.cxx
  15. 3 6
      Source/cmDependsC.h
  16. 0 1
      Source/cmDependsFortran.cxx
  17. 1 1
      Source/cmDependsFortran.h
  18. 2 5
      Source/cmDocumentation.h
  19. 0 2
      Source/cmDocumentationFormatter.cxx
  20. 2 2
      Source/cmDocumentationFormatter.h
  21. 5 11
      Source/cmExecutionStatus.h
  22. 0 1
      Source/cmExpandedCommandArgument.cxx
  23. 1 1
      Source/cmExpandedCommandArgument.h
  24. 0 1
      Source/cmExtraCodeLiteGenerator.cxx
  25. 1 1
      Source/cmExtraCodeLiteGenerator.h
  26. 3 7
      Source/cmFileCommand.cxx
  27. 2 3
      Source/cmFileLock.h
  28. 0 1
      Source/cmFileLockUnix.cxx
  29. 0 1
      Source/cmFileLockWin32.cxx
  30. 2 5
      Source/cmFindLibraryCommand.cxx
  31. 2 5
      Source/cmFindPackageCommand.cxx
  32. 0 8
      Source/cmGeneratedFileStream.cxx
  33. 4 4
      Source/cmGeneratedFileStream.h
  34. 0 2
      Source/cmGeneratorExpressionLexer.cxx
  35. 2 2
      Source/cmGeneratorExpressionLexer.h
  36. 13 31
      Source/cmGeneratorTarget.h
  37. 2 5
      Source/cmGlobVerificationManager.h
  38. 4 10
      Source/cmGlobalGenerator.h
  39. 2 5
      Source/cmGlobalUnixMakefileGenerator3.h
  40. 0 1
      Source/cmInstalledFile.cxx
  41. 1 1
      Source/cmInstalledFile.h
  42. 0 3
      Source/cmLinkItem.cxx
  43. 15 31
      Source/cmLinkItem.h
  44. 7 17
      Source/cmListFileCache.h
  45. 6 14
      Source/cmLocalUnixMakefileGenerator3.h
  46. 3 7
      Source/cmMakefile.cxx
  47. 0 1
      Source/cmNewLineStyle.cxx
  48. 1 1
      Source/cmNewLineStyle.h
  49. 3 7
      Source/cmOutputRequiredFilesCommand.cxx
  50. 1 4
      Source/cmProcessTools.cxx
  51. 3 3
      Source/cmProcessTools.h
  52. 3 7
      Source/cmQtAutoGenInitializer.h
  53. 0 5
      Source/cmQtAutoGeneratorMocUic.cxx
  54. 5 5
      Source/cmQtAutoGeneratorMocUic.h
  55. 0 6
      Source/cmQtAutoGeneratorRcc.cxx
  56. 6 6
      Source/cmQtAutoGeneratorRcc.h
  57. 2 5
      Source/cmScriptGenerator.h
  58. 0 3
      Source/cmSourceFileLocation.cxx
  59. 3 3
      Source/cmSourceFileLocation.h
  60. 0 8
      Source/cmState.cxx
  61. 8 8
      Source/cmState.h
  62. 4 9
      Source/cmVariableWatch.h

+ 3 - 1
.clang-tidy

@@ -15,7 +15,6 @@ modernize-*,\
 -modernize-raw-string-literal,\
 -modernize-raw-string-literal,\
 -modernize-return-braced-init-list,\
 -modernize-return-braced-init-list,\
 -modernize-use-auto,\
 -modernize-use-auto,\
--modernize-use-default-member-init,\
 -modernize-use-emplace,\
 -modernize-use-emplace,\
 -modernize-use-equals-default,\
 -modernize-use-equals-default,\
 -modernize-use-equals-delete,\
 -modernize-use-equals-delete,\
@@ -36,4 +35,7 @@ readability-*,\
 -readability-simplify-boolean-expr,\
 -readability-simplify-boolean-expr,\
 "
 "
 HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
 HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
+CheckOptions:
+  - key:   modernize-use-default-member-init.UseAssignment
+    value: '1'
 ...
 ...

+ 2 - 5
Source/CTest/cmCTestBuildHandler.cxx

@@ -503,10 +503,7 @@ public:
     : FTC(ftc)
     : FTC(ftc)
   {
   {
   }
   }
-  FragmentCompare()
-    : FTC(nullptr)
-  {
-  }
+  FragmentCompare() {}
   bool operator()(std::string const& l, std::string const& r) const
   bool operator()(std::string const& l, std::string const& r) const
   {
   {
     // Order files by modification time.  Use lexicographic order
     // Order files by modification time.  Use lexicographic order
@@ -520,7 +517,7 @@ public:
   }
   }
 
 
 private:
 private:
-  cmFileTimeComparison* FTC;
+  cmFileTimeComparison* FTC = nullptr;
 };
 };
 
 
 void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
 void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)

+ 3 - 7
Source/CTest/cmCTestGIT.cxx

@@ -475,13 +475,9 @@ private:
   {
   {
     std::string Name;
     std::string Name;
     std::string EMail;
     std::string EMail;
-    unsigned long Time;
-    long TimeZone;
-    Person()
-      : Time(0)
-      , TimeZone(0)
-    {
-    }
+    unsigned long Time = 0;
+    long TimeZone = 0;
+    Person() {}
   };
   };
 
 
   void ParsePerson(const char* str, Person& person)
   void ParsePerson(const char* str, Person& person)

+ 2 - 5
Source/cmCPluginAPI.cxx

@@ -475,11 +475,8 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
 // API for source files.
 // API for source files.
 struct cmCPluginAPISourceFile
 struct cmCPluginAPISourceFile
 {
 {
-  cmCPluginAPISourceFile()
-    : RealSourceFile(nullptr)
-  {
-  }
-  cmSourceFile* RealSourceFile;
+  cmCPluginAPISourceFile() {}
+  cmSourceFile* RealSourceFile = nullptr;
   std::string SourceName;
   std::string SourceName;
   std::string SourceExtension;
   std::string SourceExtension;
   std::string FullPath;
   std::string FullPath;

+ 2 - 5
Source/cmCTest.h

@@ -57,10 +57,7 @@ public:
   /** Representation of one part.  */
   /** Representation of one part.  */
   struct PartInfo
   struct PartInfo
   {
   {
-    PartInfo()
-      : Enabled(false)
-    {
-    }
+    PartInfo() {}
 
 
     void SetName(const std::string& name) { this->Name = name; }
     void SetName(const std::string& name) { this->Name = name; }
     const std::string& GetName() const { return this->Name; }
     const std::string& GetName() const { return this->Name; }
@@ -71,7 +68,7 @@ public:
     std::vector<std::string> SubmitFiles;
     std::vector<std::string> SubmitFiles;
 
 
   private:
   private:
-    bool Enabled;
+    bool Enabled = false;
     std::string Name;
     std::string Name;
   };
   };
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #ifdef CMAKE_BUILD_WITH_CMAKE

+ 3 - 8
Source/cmCacheManager.h

@@ -34,20 +34,15 @@ private:
   struct CacheEntry
   struct CacheEntry
   {
   {
     std::string Value;
     std::string Value;
-    cmStateEnums::CacheEntryType Type;
+    cmStateEnums::CacheEntryType Type = cmStateEnums::UNINITIALIZED;
     cmPropertyMap Properties;
     cmPropertyMap Properties;
     std::vector<std::string> GetPropertyList() const;
     std::vector<std::string> GetPropertyList() const;
     const char* GetProperty(const std::string&) const;
     const char* GetProperty(const std::string&) const;
     void SetProperty(const std::string& property, const char* value);
     void SetProperty(const std::string& property, const char* value);
     void AppendProperty(const std::string& property, const char* value,
     void AppendProperty(const std::string& property, const char* value,
                         bool asString = false);
                         bool asString = false);
-    bool Initialized;
-    CacheEntry()
-      : Value("")
-      , Type(cmStateEnums::UNINITIALIZED)
-      , Initialized(false)
-    {
-    }
+    bool Initialized = false;
+    CacheEntry() {}
   };
   };
 
 
 public:
 public:

+ 2 - 5
Source/cmCommand.h

@@ -30,10 +30,7 @@ public:
   /**
   /**
    * Construct the command. By default it has no makefile.
    * Construct the command. By default it has no makefile.
    */
    */
-  cmCommand()
-    : Makefile(nullptr)
-  {
-  }
+  cmCommand() {}
 
 
   /**
   /**
    * Need virtual destructor to destroy real command type.
    * Need virtual destructor to destroy real command type.
@@ -90,7 +87,7 @@ public:
   void SetError(const std::string& e);
   void SetError(const std::string& e);
 
 
 protected:
 protected:
-  cmMakefile* Makefile;
+  cmMakefile* Makefile = nullptr;
 
 
 private:
 private:
   std::string Error;
   std::string Error;

+ 4 - 9
Source/cmComputeLinkDepends.h

@@ -35,15 +35,10 @@ public:
   struct LinkEntry
   struct LinkEntry
   {
   {
     std::string Item;
     std::string Item;
-    cmGeneratorTarget const* Target;
-    bool IsSharedDep;
-    bool IsFlag;
-    LinkEntry()
-      : Target(nullptr)
-      , IsSharedDep(false)
-      , IsFlag(false)
-    {
-    }
+    cmGeneratorTarget const* Target = nullptr;
+    bool IsSharedDep = false;
+    bool IsFlag = false;
+    LinkEntry() {}
     LinkEntry(LinkEntry const& r)
     LinkEntry(LinkEntry const& r)
       : Item(r.Item)
       : Item(r.Item)
       , Target(r.Target)
       , Target(r.Target)

+ 3 - 7
Source/cmComputeLinkInformation.h

@@ -30,11 +30,7 @@ public:
 
 
   struct Item
   struct Item
   {
   {
-    Item()
-      : IsPath(true)
-      , Target(nullptr)
-    {
-    }
+    Item() {}
     Item(std::string const& v, bool p,
     Item(std::string const& v, bool p,
          cmGeneratorTarget const* target = nullptr)
          cmGeneratorTarget const* target = nullptr)
       : Value(v)
       : Value(v)
@@ -43,8 +39,8 @@ public:
     {
     {
     }
     }
     std::string Value;
     std::string Value;
-    bool IsPath;
-    cmGeneratorTarget const* Target;
+    bool IsPath = true;
+    cmGeneratorTarget const* Target = nullptr;
   };
   };
   typedef std::vector<Item> ItemVector;
   typedef std::vector<Item> ItemVector;
   ItemVector const& GetItems() const;
   ItemVector const& GetItems() const;

+ 0 - 3
Source/cmCustomCommand.cxx

@@ -18,9 +18,6 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
   , Comment(comment ? comment : "")
   , Comment(comment ? comment : "")
   , WorkingDirectory(workingDirectory ? workingDirectory : "")
   , WorkingDirectory(workingDirectory ? workingDirectory : "")
   , HaveComment(comment != nullptr)
   , HaveComment(comment != nullptr)
-  , EscapeAllowMakeVars(false)
-  , EscapeOldStyle(true)
-  , CommandExpandLists(false)
 {
 {
   if (mf) {
   if (mf) {
     this->Backtrace = mf->GetBacktrace();
     this->Backtrace = mf->GetBacktrace();

+ 3 - 9
Source/cmDefinitions.h

@@ -47,25 +47,19 @@ private:
     typedef std::string std_string;
     typedef std::string std_string;
 
 
   public:
   public:
-    Def()
-      : Exists(false)
-      , Used(false)
-    {
-    }
+    Def() {}
     Def(const char* v)
     Def(const char* v)
       : std_string(v ? v : "")
       : std_string(v ? v : "")
       , Exists(v ? true : false)
       , Exists(v ? true : false)
-      , Used(false)
     {
     {
     }
     }
     Def(const std_string& v)
     Def(const std_string& v)
       : std_string(v)
       : std_string(v)
       , Exists(true)
       , Exists(true)
-      , Used(false)
     {
     {
     }
     }
-    bool Exists;
-    bool Used;
+    bool Exists = false;
+    bool Used = false;
   };
   };
   static Def NoDef;
   static Def NoDef;
 
 

+ 0 - 3
Source/cmDepends.cxx

@@ -15,10 +15,7 @@
 
 
 cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
 cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
   : LocalGenerator(lg)
   : LocalGenerator(lg)
-  , Verbose(false)
-  , FileComparison(nullptr)
   , TargetDirectory(targetDir)
   , TargetDirectory(targetDir)
-  , MaxPath(16384)
   , Dependee(new char[MaxPath])
   , Dependee(new char[MaxPath])
   , Depender(new char[MaxPath])
   , Depender(new char[MaxPath])
 {
 {

+ 3 - 3
Source/cmDepends.h

@@ -96,15 +96,15 @@ protected:
   cmLocalGenerator* LocalGenerator;
   cmLocalGenerator* LocalGenerator;
 
 
   // Flag for verbose output.
   // Flag for verbose output.
-  bool Verbose;
-  cmFileTimeComparison* FileComparison;
+  bool Verbose = false;
+  cmFileTimeComparison* FileComparison = nullptr;
 
 
   std::string Language;
   std::string Language;
 
 
   // The full path to the target's build directory.
   // The full path to the target's build directory.
   std::string TargetDirectory;
   std::string TargetDirectory;
 
 
-  size_t MaxPath;
+  size_t MaxPath = 16384;
   char* Dependee;
   char* Dependee;
   char* Depender;
   char* Depender;
 
 

+ 0 - 1
Source/cmDependsC.cxx

@@ -20,7 +20,6 @@
 #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
 #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
 
 
 cmDependsC::cmDependsC()
 cmDependsC::cmDependsC()
-  : ValidDeps(nullptr)
 {
 {
 }
 }
 
 

+ 3 - 6
Source/cmDependsC.h

@@ -75,16 +75,13 @@ public:
 
 
   struct cmIncludeLines
   struct cmIncludeLines
   {
   {
-    cmIncludeLines()
-      : Used(false)
-    {
-    }
+    cmIncludeLines() {}
     std::vector<UnscannedEntry> UnscannedEntries;
     std::vector<UnscannedEntry> UnscannedEntries;
-    bool Used;
+    bool Used = false;
   };
   };
 
 
 protected:
 protected:
-  const std::map<std::string, DependencyVector>* ValidDeps;
+  const std::map<std::string, DependencyVector>* ValidDeps = nullptr;
   std::set<std::string> Encountered;
   std::set<std::string> Encountered;
   std::queue<UnscannedEntry> Unscanned;
   std::queue<UnscannedEntry> Unscanned;
 
 

+ 0 - 1
Source/cmDependsFortran.cxx

@@ -69,7 +69,6 @@ public:
 };
 };
 
 
 cmDependsFortran::cmDependsFortran()
 cmDependsFortran::cmDependsFortran()
-  : Internal(nullptr)
 {
 {
 }
 }
 
 

+ 1 - 1
Source/cmDependsFortran.h

@@ -76,7 +76,7 @@ protected:
   std::set<std::string> PPDefinitions;
   std::set<std::string> PPDefinitions;
 
 
   // Internal implementation details.
   // Internal implementation details.
-  cmDependsFortranInternals* Internal;
+  cmDependsFortranInternals* Internal = nullptr;
 
 
 private:
 private:
   std::string MaybeConvertToRelativePath(std::string const& base,
   std::string MaybeConvertToRelativePath(std::string const& base,

+ 2 - 5
Source/cmDocumentation.h

@@ -116,11 +116,8 @@ private:
 
 
   struct RequestedHelpItem
   struct RequestedHelpItem
   {
   {
-    RequestedHelpItem()
-      : HelpType(None)
-    {
-    }
-    cmDocumentationEnums::Type HelpType;
+    RequestedHelpItem() {}
+    cmDocumentationEnums::Type HelpType = None;
     std::string Filename;
     std::string Filename;
     std::string Argument;
     std::string Argument;
   };
   };

+ 0 - 2
Source/cmDocumentationFormatter.cxx

@@ -11,8 +11,6 @@
 #include <vector>
 #include <vector>
 
 
 cmDocumentationFormatter::cmDocumentationFormatter()
 cmDocumentationFormatter::cmDocumentationFormatter()
-  : TextWidth(77)
-  , TextIndent("")
 {
 {
 }
 }
 
 

+ 2 - 2
Source/cmDocumentationFormatter.h

@@ -59,8 +59,8 @@ public:
   void SetIndent(const char* indent);
   void SetIndent(const char* indent);
 
 
 private:
 private:
-  int TextWidth;
-  const char* TextIndent;
+  int TextWidth = 77;
+  const char* TextIndent = "";
 };
 };
 
 
 #endif
 #endif

+ 5 - 11
Source/cmExecutionStatus.h

@@ -11,13 +11,7 @@
 class cmExecutionStatus
 class cmExecutionStatus
 {
 {
 public:
 public:
-  cmExecutionStatus()
-    : ReturnInvoked(false)
-    , BreakInvoked(false)
-    , ContinueInvoked(false)
-    , NestedError(false)
-  {
-  }
+  cmExecutionStatus() {}
 
 
   void Clear()
   void Clear()
   {
   {
@@ -40,10 +34,10 @@ public:
   bool GetNestedError() const { return this->NestedError; }
   bool GetNestedError() const { return this->NestedError; }
 
 
 private:
 private:
-  bool ReturnInvoked;
-  bool BreakInvoked;
-  bool ContinueInvoked;
-  bool NestedError;
+  bool ReturnInvoked = false;
+  bool BreakInvoked = false;
+  bool ContinueInvoked = false;
+  bool NestedError = false;
 };
 };
 
 
 #endif
 #endif

+ 0 - 1
Source/cmExpandedCommandArgument.cxx

@@ -3,7 +3,6 @@
 #include "cmExpandedCommandArgument.h"
 #include "cmExpandedCommandArgument.h"
 
 
 cmExpandedCommandArgument::cmExpandedCommandArgument()
 cmExpandedCommandArgument::cmExpandedCommandArgument()
-  : Quoted(false)
 {
 {
 }
 }
 
 

+ 1 - 1
Source/cmExpandedCommandArgument.h

@@ -33,7 +33,7 @@ public:
 
 
 private:
 private:
   std::string Value;
   std::string Value;
-  bool Quoted;
+  bool Quoted = false;
 };
 };
 
 
 #endif
 #endif

+ 0 - 1
Source/cmExtraCodeLiteGenerator.cxx

@@ -22,7 +22,6 @@
 
 
 cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
 cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
   : ConfigName("NoConfig")
   : ConfigName("NoConfig")
-  , CpuCount(2)
 {
 {
 }
 }
 
 

+ 1 - 1
Source/cmExtraCodeLiteGenerator.h

@@ -23,7 +23,7 @@ class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator
 protected:
 protected:
   std::string ConfigName;
   std::string ConfigName;
   std::string WorkspacePath;
   std::string WorkspacePath;
-  unsigned int CpuCount;
+  unsigned int CpuCount = 2;
 
 
 protected:
 protected:
   std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;
   std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;

+ 3 - 7
Source/cmFileCommand.cxx

@@ -1095,13 +1095,9 @@ protected:
   // Properties set by pattern and regex match rules.
   // Properties set by pattern and regex match rules.
   struct MatchProperties
   struct MatchProperties
   {
   {
-    bool Exclude;
-    mode_t Permissions;
-    MatchProperties()
-      : Exclude(false)
-      , Permissions(0)
-    {
-    }
+    bool Exclude = false;
+    mode_t Permissions = 0;
+    MatchProperties() {}
   };
   };
   struct MatchRule
   struct MatchRule
   {
   {

+ 2 - 3
Source/cmFileLock.h

@@ -51,14 +51,13 @@ private:
   cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
   cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
 
 
 #if defined(_WIN32)
 #if defined(_WIN32)
-  typedef HANDLE FileId;
+  HANDLE File = INVALID_HANDLE_VALUE;
   BOOL LockFile(DWORD flags);
   BOOL LockFile(DWORD flags);
 #else
 #else
-  typedef int FileId;
+  int File = -1;
   int LockFile(int cmd, int type);
   int LockFile(int cmd, int type);
 #endif
 #endif
 
 
-  FileId File;
   std::string Filename;
   std::string Filename;
 };
 };
 
 

+ 0 - 1
Source/cmFileLockUnix.cxx

@@ -9,7 +9,6 @@
 #include <unistd.h>
 #include <unistd.h>
 
 
 cmFileLock::cmFileLock()
 cmFileLock::cmFileLock()
-  : File(-1)
 {
 {
 }
 }
 
 

+ 0 - 1
Source/cmFileLockWin32.cxx

@@ -6,7 +6,6 @@
 #include <windows.h> // CreateFileW
 #include <windows.h> // CreateFileW
 
 
 cmFileLock::cmFileLock()
 cmFileLock::cmFileLock()
-  : File(INVALID_HANDLE_VALUE)
 {
 {
 }
 }
 
 

+ 2 - 5
Source/cmFindLibraryCommand.cxx

@@ -198,13 +198,10 @@ struct cmFindLibraryHelper
   // Current names under consideration.
   // Current names under consideration.
   struct Name
   struct Name
   {
   {
-    bool TryRaw;
+    bool TryRaw = false;
     std::string Raw;
     std::string Raw;
     cmsys::RegularExpression Regex;
     cmsys::RegularExpression Regex;
-    Name()
-      : TryRaw(false)
-    {
-    }
+    Name() {}
   };
   };
   std::vector<Name> Names;
   std::vector<Name> Names;
 
 

+ 2 - 5
Source/cmFindPackageCommand.cxx

@@ -1675,10 +1675,7 @@ private:
 class cmFileList
 class cmFileList
 {
 {
 public:
 public:
-  cmFileList()
-    : Last(nullptr)
-  {
-  }
+  cmFileList() {}
   virtual ~cmFileList() {}
   virtual ~cmFileList() {}
   cmFileList& operator/(cmFileListGeneratorBase const& rhs)
   cmFileList& operator/(cmFileListGeneratorBase const& rhs)
   {
   {
@@ -1702,7 +1699,7 @@ private:
   virtual bool Visit(std::string const& fullPath) = 0;
   virtual bool Visit(std::string const& fullPath) = 0;
   friend class cmFileListGeneratorBase;
   friend class cmFileListGeneratorBase;
   std::unique_ptr<cmFileListGeneratorBase> First;
   std::unique_ptr<cmFileListGeneratorBase> First;
-  cmFileListGeneratorBase* Last;
+  cmFileListGeneratorBase* Last = nullptr;
 };
 };
 
 
 class cmFindPackageFileList : public cmFileList
 class cmFindPackageFileList : public cmFileList

+ 0 - 8
Source/cmGeneratedFileStream.cxx

@@ -103,18 +103,10 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext)
 }
 }
 
 
 cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
 cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
-  : CopyIfDifferent(false)
-  , Okay(false)
-  , Compress(false)
-  , CompressExtraExtension(true)
 {
 {
 }
 }
 
 
 cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
 cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
-  : CopyIfDifferent(false)
-  , Okay(false)
-  , Compress(false)
-  , CompressExtraExtension(true)
 {
 {
   this->Open(name);
   this->Open(name);
 }
 }

+ 4 - 4
Source/cmGeneratedFileStream.h

@@ -45,16 +45,16 @@ protected:
   std::string TempName;
   std::string TempName;
 
 
   // Whether to do a copy-if-different.
   // Whether to do a copy-if-different.
-  bool CopyIfDifferent;
+  bool CopyIfDifferent = false;
 
 
   // Whether the real file stream was valid when it was closed.
   // Whether the real file stream was valid when it was closed.
-  bool Okay;
+  bool Okay = false;
 
 
   // Whether the destination file is compressed
   // Whether the destination file is compressed
-  bool Compress;
+  bool Compress = false;
 
 
   // Whether the destination file is compressed
   // Whether the destination file is compressed
-  bool CompressExtraExtension;
+  bool CompressExtraExtension = true;
 };
 };
 
 
 /** \class cmGeneratedFileStream
 /** \class cmGeneratedFileStream

+ 0 - 2
Source/cmGeneratorExpressionLexer.cxx

@@ -3,8 +3,6 @@
 #include "cmGeneratorExpressionLexer.h"
 #include "cmGeneratorExpressionLexer.h"
 
 
 cmGeneratorExpressionLexer::cmGeneratorExpressionLexer()
 cmGeneratorExpressionLexer::cmGeneratorExpressionLexer()
-  : SawBeginExpression(false)
-  , SawGeneratorExpression(false)
 {
 {
 }
 }
 
 

+ 2 - 2
Source/cmGeneratorExpressionLexer.h

@@ -46,8 +46,8 @@ public:
   }
   }
 
 
 private:
 private:
-  bool SawBeginExpression;
-  bool SawGeneratorExpression;
+  bool SawBeginExpression = false;
+  bool SawGeneratorExpression = false;
 };
 };
 
 
 #endif
 #endif

+ 13 - 31
Source/cmGeneratorTarget.h

@@ -110,11 +110,8 @@ public:
     std::set<std::string> ExpectedResxHeaders;
     std::set<std::string> ExpectedResxHeaders;
     std::set<std::string> ExpectedXamlHeaders;
     std::set<std::string> ExpectedXamlHeaders;
     std::set<std::string> ExpectedXamlSources;
     std::set<std::string> ExpectedXamlSources;
-    bool Initialized;
-    KindedSources()
-      : Initialized(false)
-    {
-    }
+    bool Initialized = false;
+    KindedSources() {}
   };
   };
 
 
   /** Get all sources needed for a configuration with kinds assigned.  */
   /** Get all sources needed for a configuration with kinds assigned.  */
@@ -565,13 +562,9 @@ public:
   };
   };
   struct SourceFileFlags
   struct SourceFileFlags
   {
   {
-    SourceFileFlags()
-      : Type(SourceFileTypeNormal)
-      , MacFolder(nullptr)
-    {
-    }
-    SourceFileType Type;
-    const char* MacFolder; // location inside Mac content folders
+    SourceFileFlags() {}
+    SourceFileType Type = SourceFileTypeNormal;
+    const char* MacFolder = nullptr; // location inside Mac content folders
   };
   };
   void GetAutoUicOptions(std::vector<std::string>& result,
   void GetAutoUicOptions(std::vector<std::string>& result,
                          const std::string& config) const;
                          const std::string& config) const;
@@ -757,11 +750,8 @@ private:
 
 
   struct CompatibleInterfaces : public CompatibleInterfacesBase
   struct CompatibleInterfaces : public CompatibleInterfacesBase
   {
   {
-    CompatibleInterfaces()
-      : Done(false)
-    {
-    }
-    bool Done;
+    CompatibleInterfaces() {}
+    bool Done = false;
   };
   };
   mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
   mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
 
 
@@ -774,11 +764,8 @@ private:
 
 
   struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
   struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
   {
   {
-    LinkImplClosure()
-      : Done(false)
-    {
-    }
-    bool Done;
+    LinkImplClosure() {}
+    bool Done = false;
   };
   };
   mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
   mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
 
 
@@ -797,15 +784,10 @@ private:
   // Cache import information from properties for each configuration.
   // Cache import information from properties for each configuration.
   struct ImportInfo
   struct ImportInfo
   {
   {
-    ImportInfo()
-      : NoSOName(false)
-      , Managed(Native)
-      , Multiplicity(0)
-    {
-    }
-    bool NoSOName;
-    ManagedType Managed;
-    unsigned int Multiplicity;
+    ImportInfo() {}
+    bool NoSOName = false;
+    ManagedType Managed = Native;
+    unsigned int Multiplicity = 0;
     std::string Location;
     std::string Location;
     std::string SOName;
     std::string SOName;
     std::string ImportLibrary;
     std::string ImportLibrary;

+ 2 - 5
Source/cmGlobVerificationManager.h

@@ -70,13 +70,10 @@ private:
 
 
   struct CacheEntryValue
   struct CacheEntryValue
   {
   {
-    bool Initialized;
+    bool Initialized = false;
     std::vector<std::string> Files;
     std::vector<std::string> Files;
     std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
     std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
-    CacheEntryValue()
-      : Initialized(false)
-    {
-    }
+    CacheEntryValue() {}
   };
   };
 
 
   typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
   typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;

+ 4 - 10
Source/cmGlobalGenerator.h

@@ -478,11 +478,8 @@ protected:
     cmCustomCommandLines CommandLines;
     cmCustomCommandLines CommandLines;
     std::vector<std::string> Depends;
     std::vector<std::string> Depends;
     std::string WorkingDir;
     std::string WorkingDir;
-    bool UsesTerminal;
-    GlobalTargetInfo()
-      : UsesTerminal(false)
-    {
-    }
+    bool UsesTerminal = false;
+    GlobalTargetInfo() {}
   };
   };
 
 
   void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
   void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
@@ -608,13 +605,10 @@ private:
   // Cache directory content and target files to be built.
   // Cache directory content and target files to be built.
   struct DirectoryContent
   struct DirectoryContent
   {
   {
-    long LastDiskTime;
+    long LastDiskTime = -1;
     std::set<std::string> All;
     std::set<std::string> All;
     std::set<std::string> Generated;
     std::set<std::string> Generated;
-    DirectoryContent()
-      : LastDiskTime(-1)
-    {
-    }
+    DirectoryContent() {}
   };
   };
   std::map<std::string, DirectoryContent> DirectoryContentMap;
   std::map<std::string, DirectoryContent> DirectoryContentMap;
 
 

+ 2 - 5
Source/cmGlobalUnixMakefileGenerator3.h

@@ -217,11 +217,8 @@ protected:
   // Store per-target progress counters.
   // Store per-target progress counters.
   struct TargetProgress
   struct TargetProgress
   {
   {
-    TargetProgress()
-      : NumberOfActions(0)
-    {
-    }
-    unsigned long NumberOfActions;
+    TargetProgress() {}
+    unsigned long NumberOfActions = 0;
     std::string VariableFile;
     std::string VariableFile;
     std::vector<unsigned long> Marks;
     std::vector<unsigned long> Marks;
     void WriteProgressVariables(unsigned long total, unsigned long& current);
     void WriteProgressVariables(unsigned long total, unsigned long& current);

+ 0 - 1
Source/cmInstalledFile.cxx

@@ -10,7 +10,6 @@
 #include <utility>
 #include <utility>
 
 
 cmInstalledFile::cmInstalledFile()
 cmInstalledFile::cmInstalledFile()
-  : NameExpression(nullptr)
 {
 {
 }
 }
 
 

+ 1 - 1
Source/cmInstalledFile.h

@@ -68,7 +68,7 @@ public:
 
 
 private:
 private:
   std::string Name;
   std::string Name;
-  cmCompiledGeneratorExpression* NameExpression;
+  cmCompiledGeneratorExpression* NameExpression = nullptr;
   PropertyMapType Properties;
   PropertyMapType Properties;
 };
 };
 
 

+ 0 - 3
Source/cmLinkItem.cxx

@@ -7,13 +7,11 @@
 #include <utility> // IWYU pragma: keep
 #include <utility> // IWYU pragma: keep
 
 
 cmLinkItem::cmLinkItem()
 cmLinkItem::cmLinkItem()
-  : Target(nullptr)
 {
 {
 }
 }
 
 
 cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt)
 cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt)
   : String(n)
   : String(n)
-  , Target(nullptr)
   , Backtrace(bt)
   , Backtrace(bt)
 {
 {
 }
 }
@@ -59,7 +57,6 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
 
 
 cmLinkImplItem::cmLinkImplItem()
 cmLinkImplItem::cmLinkImplItem()
   : cmLinkItem()
   : cmLinkItem()
-  , FromGenex(false)
 {
 {
 }
 }
 
 

+ 15 - 31
Source/cmLinkItem.h

@@ -27,7 +27,7 @@ public:
   cmLinkItem(std::string const& s, cmListFileBacktrace const& bt);
   cmLinkItem(std::string const& s, cmListFileBacktrace const& bt);
   cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt);
   cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt);
   std::string const& AsStr() const;
   std::string const& AsStr() const;
-  cmGeneratorTarget const* Target;
+  cmGeneratorTarget const* Target = nullptr;
   cmListFileBacktrace Backtrace;
   cmListFileBacktrace Backtrace;
   friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
   friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
   friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
   friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
@@ -39,7 +39,7 @@ class cmLinkImplItem : public cmLinkItem
 public:
 public:
   cmLinkImplItem();
   cmLinkImplItem();
   cmLinkImplItem(cmLinkItem item, bool fromGenex);
   cmLinkImplItem(cmLinkItem item, bool fromGenex);
-  bool FromGenex;
+  bool FromGenex = false;
 };
 };
 
 
 /** The link implementation specifies the direct library
 /** The link implementation specifies the direct library
@@ -70,36 +70,25 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
 
 
   // Number of repetitions of a strongly connected component of two
   // Number of repetitions of a strongly connected component of two
   // or more static libraries.
   // or more static libraries.
-  unsigned int Multiplicity;
+  unsigned int Multiplicity = 0;
 
 
   // Libraries listed for other configurations.
   // Libraries listed for other configurations.
   // Needed only for OLD behavior of CMP0003.
   // Needed only for OLD behavior of CMP0003.
   std::vector<cmLinkItem> WrongConfigLibraries;
   std::vector<cmLinkItem> WrongConfigLibraries;
 
 
-  bool ImplementationIsInterface;
+  bool ImplementationIsInterface = false;
 
 
-  cmLinkInterface()
-    : Multiplicity(0)
-    , ImplementationIsInterface(false)
-  {
-  }
+  cmLinkInterface() {}
 };
 };
 
 
 struct cmOptionalLinkInterface : public cmLinkInterface
 struct cmOptionalLinkInterface : public cmLinkInterface
 {
 {
-  cmOptionalLinkInterface()
-    : LibrariesDone(false)
-    , AllDone(false)
-    , Exists(false)
-    , HadHeadSensitiveCondition(false)
-    , ExplicitLibraries(nullptr)
-  {
-  }
-  bool LibrariesDone;
-  bool AllDone;
-  bool Exists;
-  bool HadHeadSensitiveCondition;
-  const char* ExplicitLibraries;
+  cmOptionalLinkInterface() {}
+  bool LibrariesDone = false;
+  bool AllDone = false;
+  bool Exists = false;
+  bool HadHeadSensitiveCondition = false;
+  const char* ExplicitLibraries = nullptr;
 };
 };
 
 
 struct cmHeadToLinkInterfaceMap
 struct cmHeadToLinkInterfaceMap
@@ -116,15 +105,10 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
 // Cache link implementation computation from each configuration.
 // Cache link implementation computation from each configuration.
 struct cmOptionalLinkImplementation : public cmLinkImplementation
 struct cmOptionalLinkImplementation : public cmLinkImplementation
 {
 {
-  cmOptionalLinkImplementation()
-    : LibrariesDone(false)
-    , LanguagesDone(false)
-    , HadHeadSensitiveCondition(false)
-  {
-  }
-  bool LibrariesDone;
-  bool LanguagesDone;
-  bool HadHeadSensitiveCondition;
+  cmOptionalLinkImplementation() {}
+  bool LibrariesDone = false;
+  bool LanguagesDone = false;
+  bool HadHeadSensitiveCondition = false;
 };
 };
 
 
 /** Compute the link type to use for the given configuration.  */
 /** Compute the link type to use for the given configuration.  */

+ 7 - 17
Source/cmListFileCache.h

@@ -33,11 +33,8 @@ struct cmCommandContext
     cmCommandName(std::string const& name) { *this = name; }
     cmCommandName(std::string const& name) { *this = name; }
     cmCommandName& operator=(std::string const& name);
     cmCommandName& operator=(std::string const& name);
   } Name;
   } Name;
-  long Line;
-  cmCommandContext()
-    : Line(0)
-  {
-  }
+  long Line = 0;
+  cmCommandContext() {}
   cmCommandContext(const char* name, int line)
   cmCommandContext(const char* name, int line)
     : Name(name)
     : Name(name)
     , Line(line)
     , Line(line)
@@ -53,11 +50,7 @@ struct cmListFileArgument
     Quoted,
     Quoted,
     Bracket
     Bracket
   };
   };
-  cmListFileArgument()
-    : Delim(Unquoted)
-    , Line(0)
-  {
-  }
+  cmListFileArgument() {}
   cmListFileArgument(const std::string& v, Delimiter d, long line)
   cmListFileArgument(const std::string& v, Delimiter d, long line)
     : Value(v)
     : Value(v)
     , Delim(d)
     , Delim(d)
@@ -70,8 +63,8 @@ struct cmListFileArgument
   }
   }
   bool operator!=(const cmListFileArgument& r) const { return !(*this == r); }
   bool operator!=(const cmListFileArgument& r) const { return !(*this == r); }
   std::string Value;
   std::string Value;
-  Delimiter Delim;
-  long Line;
+  Delimiter Delim = Unquoted;
+  long Line = 0;
 };
 };
 
 
 class cmListFileContext
 class cmListFileContext
@@ -79,11 +72,8 @@ class cmListFileContext
 public:
 public:
   std::string Name;
   std::string Name;
   std::string FilePath;
   std::string FilePath;
-  long Line;
-  cmListFileContext()
-    : Line(0)
-  {
-  }
+  long Line = 0;
+  cmListFileContext() {}
 
 
   static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
   static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
                                               std::string const& fileName)
                                               std::string const& fileName)

+ 6 - 14
Source/cmLocalUnixMakefileGenerator3.h

@@ -264,12 +264,9 @@ private:
 
 
   struct LocalObjectEntry
   struct LocalObjectEntry
   {
   {
-    cmGeneratorTarget* Target;
+    cmGeneratorTarget* Target = nullptr;
     std::string Language;
     std::string Language;
-    LocalObjectEntry()
-      : Target(nullptr)
-    {
-    }
+    LocalObjectEntry() {}
     LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang)
     LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang)
       : Target(t)
       : Target(t)
       , Language(lang)
       , Language(lang)
@@ -278,15 +275,10 @@ private:
   };
   };
   struct LocalObjectInfo : public std::vector<LocalObjectEntry>
   struct LocalObjectInfo : public std::vector<LocalObjectEntry>
   {
   {
-    bool HasSourceExtension;
-    bool HasPreprocessRule;
-    bool HasAssembleRule;
-    LocalObjectInfo()
-      : HasSourceExtension(false)
-      , HasPreprocessRule(false)
-      , HasAssembleRule(false)
-    {
-    }
+    bool HasSourceExtension = false;
+    bool HasPreprocessRule = false;
+    bool HasAssembleRule = false;
+    LocalObjectInfo() {}
   };
   };
   void GetLocalObjectFiles(
   void GetLocalObjectFiles(
     std::map<std::string, LocalObjectInfo>& localObjectFiles);
     std::map<std::string, LocalObjectInfo>& localObjectFiles);

+ 3 - 7
Source/cmMakefile.cxx

@@ -2697,13 +2697,9 @@ typedef enum
 } t_domain;
 } t_domain;
 struct t_lookup
 struct t_lookup
 {
 {
-  t_lookup()
-    : domain(NORMAL)
-    , loc(0)
-  {
-  }
-  t_domain domain;
-  size_t loc;
+  t_lookup() {}
+  t_domain domain = NORMAL;
+  size_t loc = 0;
 };
 };
 
 
 cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
 cmake::MessageType cmMakefile::ExpandVariablesInStringNew(

+ 0 - 1
Source/cmNewLineStyle.cxx

@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 cmNewLineStyle::cmNewLineStyle()
 cmNewLineStyle::cmNewLineStyle()
-  : NewLineStyle(Invalid)
 {
 {
 }
 }
 
 

+ 1 - 1
Source/cmNewLineStyle.h

@@ -33,7 +33,7 @@ public:
   const std::string GetCharacters() const;
   const std::string GetCharacters() const;
 
 
 private:
 private:
-  Style NewLineStyle;
+  Style NewLineStyle = Invalid;
 };
 };
 
 
 #endif
 #endif

+ 3 - 7
Source/cmOutputRequiredFilesCommand.cxx

@@ -28,11 +28,7 @@ public:
    * Construct with dependency generation marked not done; instance
    * Construct with dependency generation marked not done; instance
    * not placed in cmMakefile's list.
    * not placed in cmMakefile's list.
    */
    */
-  cmDependInformation()
-    : DependDone(false)
-    , SourceFile(nullptr)
-  {
-  }
+  cmDependInformation() {}
 
 
   /**
   /**
    * The set of files on which this one depends.
    * The set of files on which this one depends.
@@ -44,13 +40,13 @@ public:
    * This flag indicates whether dependency checking has been
    * This flag indicates whether dependency checking has been
    * performed for this file.
    * performed for this file.
    */
    */
-  bool DependDone;
+  bool DependDone = false;
 
 
   /**
   /**
    * If this object corresponds to a cmSourceFile instance, this points
    * If this object corresponds to a cmSourceFile instance, this points
    * to it.
    * to it.
    */
    */
-  const cmSourceFile* SourceFile;
+  const cmSourceFile* SourceFile = nullptr;
 
 
   /**
   /**
    * Full path to this file.
    * Full path to this file.

+ 1 - 4
Source/cmProcessTools.cxx

@@ -45,10 +45,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
 }
 }
 
 
 cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
 cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
-  : Log(nullptr)
-  , Prefix(nullptr)
-  , Separator(sep)
-  , LineEnd('\0')
+  : Separator(sep)
   , IgnoreCR(ignoreCR)
   , IgnoreCR(ignoreCR)
 {
 {
 }
 }

+ 3 - 3
Source/cmProcessTools.h

@@ -54,11 +54,11 @@ public:
     void SetLog(std::ostream* log, const char* prefix);
     void SetLog(std::ostream* log, const char* prefix);
 
 
   protected:
   protected:
-    std::ostream* Log;
-    const char* Prefix;
+    std::ostream* Log = nullptr;
+    const char* Prefix = nullptr;
     std::string Line;
     std::string Line;
     char Separator;
     char Separator;
-    char LineEnd;
+    char LineEnd = '\0';
     bool IgnoreCR;
     bool IgnoreCR;
     bool ProcessChunk(const char* data, int length) override;
     bool ProcessChunk(const char* data, int length) override;
 
 

+ 3 - 7
Source/cmQtAutoGenInitializer.h

@@ -25,11 +25,7 @@ public:
   class Qrc
   class Qrc
   {
   {
   public:
   public:
-    Qrc()
-      : Generated(false)
-      , Unique(false)
-    {
-    }
+    Qrc() {}
 
 
   public:
   public:
     std::string LockFile;
     std::string LockFile;
@@ -40,8 +36,8 @@ public:
     std::string SettingsFile;
     std::string SettingsFile;
     std::map<std::string, std::string> ConfigSettingsFile;
     std::map<std::string, std::string> ConfigSettingsFile;
     std::string RccFile;
     std::string RccFile;
-    bool Generated;
-    bool Unique;
+    bool Generated = false;
+    bool Unique = false;
     std::vector<std::string> Options;
     std::vector<std::string> Options;
     std::vector<std::string> Resources;
     std::vector<std::string> Resources;
   };
   };

+ 0 - 5
Source/cmQtAutoGeneratorMocUic.cxx

@@ -1130,11 +1130,6 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessFinished()
 cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
 cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
   : Base_(&FileSys())
   : Base_(&FileSys())
   , Moc_(&FileSys())
   , Moc_(&FileSys())
-  , Stage_(StageT::SETTINGS_READ)
-  , JobsRemain_(0)
-  , JobError_(false)
-  , JobThreadsAbort_(false)
-  , MocAutoFileUpdated_(false)
 {
 {
   // Precompile regular expressions
   // Precompile regular expressions
   Moc_.RegExpInclude.compile(
   Moc_.RegExpInclude.compile(

+ 5 - 5
Source/cmQtAutoGeneratorMocUic.h

@@ -404,7 +404,7 @@ private:
   MocSettingsT Moc_;
   MocSettingsT Moc_;
   UicSettingsT Uic_;
   UicSettingsT Uic_;
   // -- Progress
   // -- Progress
-  StageT Stage_;
+  StageT Stage_ = StageT::SETTINGS_READ;
   // -- Job queues
   // -- Job queues
   std::mutex JobsMutex_;
   std::mutex JobsMutex_;
   struct
   struct
@@ -416,15 +416,15 @@ private:
     JobQueueT Uic;
     JobQueueT Uic;
   } JobQueues_;
   } JobQueues_;
   JobQueueT JobQueue_;
   JobQueueT JobQueue_;
-  std::size_t volatile JobsRemain_;
-  bool volatile JobError_;
-  bool volatile JobThreadsAbort_;
+  std::size_t volatile JobsRemain_ = 0;
+  bool volatile JobError_ = false;
+  bool volatile JobThreadsAbort_ = false;
   std::condition_variable JobsConditionRead_;
   std::condition_variable JobsConditionRead_;
   // -- Moc meta
   // -- Moc meta
   std::set<std::string> MocIncludedStrings_;
   std::set<std::string> MocIncludedStrings_;
   std::set<std::string> MocIncludedFiles_;
   std::set<std::string> MocIncludedFiles_;
   std::set<std::string> MocAutoFiles_;
   std::set<std::string> MocAutoFiles_;
-  bool volatile MocAutoFileUpdated_;
+  bool volatile MocAutoFileUpdated_ = false;
   // -- Settings file
   // -- Settings file
   std::string SettingsFile_;
   std::string SettingsFile_;
   std::string SettingsStringMoc_;
   std::string SettingsStringMoc_;

+ 0 - 6
Source/cmQtAutoGeneratorRcc.cxx

@@ -15,12 +15,6 @@
 // -- Class methods
 // -- Class methods
 
 
 cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
 cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
-  : MultiConfig_(false)
-  , SettingsChanged_(false)
-  , Stage_(StageT::SETTINGS_READ)
-  , Error_(false)
-  , Generate_(false)
-  , BuildFileChanged_(false)
 {
 {
   // Initialize libuv asynchronous iteration request
   // Initialize libuv asynchronous iteration request
   UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this);
   UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this);

+ 6 - 6
Source/cmQtAutoGeneratorRcc.h

@@ -70,7 +70,7 @@ private:
 
 
 private:
 private:
   // -- Config settings
   // -- Config settings
-  bool MultiConfig_;
+  bool MultiConfig_ = false;
   // -- Directories
   // -- Directories
   std::string AutogenBuildDir_;
   std::string AutogenBuildDir_;
   std::string IncludeDir_;
   std::string IncludeDir_;
@@ -95,12 +95,12 @@ private:
   // -- Settings file
   // -- Settings file
   std::string SettingsFile_;
   std::string SettingsFile_;
   std::string SettingsString_;
   std::string SettingsString_;
-  bool SettingsChanged_;
+  bool SettingsChanged_ = false;
   // -- libuv loop
   // -- libuv loop
-  StageT Stage_;
-  bool Error_;
-  bool Generate_;
-  bool BuildFileChanged_;
+  StageT Stage_ = StageT::SETTINGS_READ;
+  bool Error_ = false;
+  bool Generate_ = false;
+  bool BuildFileChanged_ = false;
 };
 };
 
 
 #endif
 #endif

+ 2 - 5
Source/cmScriptGenerator.h

@@ -12,10 +12,7 @@
 class cmScriptGeneratorIndent
 class cmScriptGeneratorIndent
 {
 {
 public:
 public:
-  cmScriptGeneratorIndent()
-    : Level(0)
-  {
-  }
+  cmScriptGeneratorIndent() {}
   cmScriptGeneratorIndent(int level)
   cmScriptGeneratorIndent(int level)
     : Level(level)
     : Level(level)
   {
   {
@@ -32,7 +29,7 @@ public:
   }
   }
 
 
 private:
 private:
-  int Level;
+  int Level = 0;
 };
 };
 inline std::ostream& operator<<(std::ostream& os,
 inline std::ostream& operator<<(std::ostream& os,
                                 cmScriptGeneratorIndent indent)
                                 cmScriptGeneratorIndent indent)

+ 0 - 3
Source/cmSourceFileLocation.cxx

@@ -11,9 +11,6 @@
 #include <assert.h>
 #include <assert.h>
 
 
 cmSourceFileLocation::cmSourceFileLocation()
 cmSourceFileLocation::cmSourceFileLocation()
-  : Makefile(nullptr)
-  , AmbiguousDirectory(true)
-  , AmbiguousExtension(true)
 {
 {
 }
 }
 
 

+ 3 - 3
Source/cmSourceFileLocation.h

@@ -83,9 +83,9 @@ public:
   cmMakefile const* GetMakefile() const { return this->Makefile; }
   cmMakefile const* GetMakefile() const { return this->Makefile; }
 
 
 private:
 private:
-  cmMakefile const* const Makefile;
-  bool AmbiguousDirectory;
-  bool AmbiguousExtension;
+  cmMakefile const* const Makefile = nullptr;
+  bool AmbiguousDirectory = true;
+  bool AmbiguousExtension = true;
   std::string Directory;
   std::string Directory;
   std::string Name;
   std::string Name;
 
 

+ 0 - 8
Source/cmState.cxx

@@ -22,14 +22,6 @@
 #include "cmake.h"
 #include "cmake.h"
 
 
 cmState::cmState()
 cmState::cmState()
-  : IsInTryCompile(false)
-  , IsGeneratorMultiConfig(false)
-  , WindowsShell(false)
-  , WindowsVSIDE(false)
-  , WatcomWMake(false)
-  , MinGWMake(false)
-  , NMake(false)
-  , MSYSShell(false)
 {
 {
   this->CacheManager = new cmCacheManager;
   this->CacheManager = new cmCacheManager;
   this->GlobVerificationManager = new cmGlobVerificationManager;
   this->GlobVerificationManager = new cmGlobVerificationManager;

+ 8 - 8
Source/cmState.h

@@ -202,14 +202,14 @@ private:
 
 
   std::string SourceDirectory;
   std::string SourceDirectory;
   std::string BinaryDirectory;
   std::string BinaryDirectory;
-  bool IsInTryCompile;
-  bool IsGeneratorMultiConfig;
-  bool WindowsShell;
-  bool WindowsVSIDE;
-  bool WatcomWMake;
-  bool MinGWMake;
-  bool NMake;
-  bool MSYSShell;
+  bool IsInTryCompile = false;
+  bool IsGeneratorMultiConfig = false;
+  bool WindowsShell = false;
+  bool WindowsVSIDE = false;
+  bool WatcomWMake = false;
+  bool MinGWMake = false;
+  bool NMake = false;
+  bool MSYSShell = false;
 };
 };
 
 
 #endif
 #endif

+ 4 - 9
Source/cmVariableWatch.h

@@ -63,15 +63,10 @@ public:
 protected:
 protected:
   struct Pair
   struct Pair
   {
   {
-    WatchMethod Method;
-    void* ClientData;
-    DeleteData DeleteDataCall;
-    Pair()
-      : Method(nullptr)
-      , ClientData(nullptr)
-      , DeleteDataCall(nullptr)
-    {
-    }
+    WatchMethod Method = nullptr;
+    void* ClientData = nullptr;
+    DeleteData DeleteDataCall = nullptr;
+    Pair() {}
     ~Pair()
     ~Pair()
     {
     {
       if (this->DeleteDataCall && this->ClientData) {
       if (this->DeleteDataCall && this->ClientData) {