From a1ddf2d0ba6268e29a9456948828f59d044791f1 Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Wed, 4 Sep 2019 18:03:01 +0200 Subject: clang-tidy: Replace typedef with using Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places. --- Source/CPack/IFW/cmCPackIFWGenerator.h | 12 +++++------ Source/CPack/IFW/cmCPackIFWInstaller.h | 4 ++-- Source/CPack/IFW/cmCPackIFWRepository.h | 2 +- Source/CPack/WiX/cmCPackWIXGenerator.h | 6 +++--- Source/CPack/WiX/cmWIXPatchParser.h | 6 +++--- Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx | 2 +- Source/CPack/WiX/cmWIXShortcut.h | 6 +++--- Source/CPack/cmCPackArchiveGenerator.h | 2 +- Source/CPack/cmCPackGenerator.h | 2 +- Source/CPack/cmCPackGeneratorFactory.h | 6 +++--- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.h | 2 +- Source/CTest/cmCTestBuildHandler.cxx | 2 +- Source/CTest/cmCTestBuildHandler.h | 8 ++++---- Source/CTest/cmCTestConfigureHandler.h | 2 +- Source/CTest/cmCTestCoverageCommand.h | 2 +- Source/CTest/cmCTestCoverageHandler.h | 10 ++++----- Source/CTest/cmCTestGenericHandler.h | 2 +- Source/CTest/cmCTestMemCheckHandler.h | 2 +- Source/CTest/cmCTestScriptHandler.h | 2 +- Source/CTest/cmCTestSubmitCommand.h | 2 +- Source/CTest/cmCTestSubmitHandler.h | 4 ++-- Source/CTest/cmCTestTestHandler.cxx | 2 +- Source/CTest/cmCTestTestHandler.h | 11 +++++----- Source/CTest/cmCTestUpdateHandler.h | 2 +- Source/CTest/cmCTestUploadCommand.h | 2 +- Source/CTest/cmCTestUploadHandler.h | 2 +- Source/QtDialog/QCMake.h | 2 +- Source/cmAffinity.cxx | 2 +- Source/cmCLocaleEnvironmentScope.h | 2 +- Source/cmCacheManager.h | 2 +- Source/cmCommonTargetGenerator.h | 2 +- Source/cmCustomCommand.h | 2 +- Source/cmDepends.h | 2 +- Source/cmDependsC.h | 2 +- Source/cmDependsFortran.cxx | 4 ++-- Source/cmDuration.h | 2 +- Source/cmELF.cxx | 15 +++++++------- Source/cmELF.h | 2 +- Source/cmExportFileGenerator.h | 2 +- Source/cmExportSetMap.h | 2 +- Source/cmExtraCodeBlocksGenerator.cxx | 2 +- Source/cmExtraSublimeTextGenerator.h | 2 +- Source/cmFileLockResult.h | 2 +- Source/cmGeneratorExpression.cxx | 5 ++--- Source/cmGeneratorExpressionNode.cxx | 2 +- Source/cmGeneratorTarget.cxx | 4 ++-- Source/cmGeneratorTarget.h | 28 +++++++++++++------------- Source/cmGlobVerificationManager.h | 2 +- Source/cmGlobalGenerator.h | 12 +++++------ Source/cmGlobalGhsMultiGenerator.h | 5 ++--- Source/cmGlobalNinjaGenerator.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.h | 5 ++--- Source/cmGlobalVisualStudioGenerator.h | 11 +++++----- Source/cmGlobalXCodeGenerator.cxx | 10 ++++----- Source/cmIDEOptions.h | 2 +- Source/cmInstalledFile.h | 2 +- Source/cmLocalGenerator.h | 4 ++-- Source/cmLocalNinjaGenerator.h | 4 ++-- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.h | 4 ++-- Source/cmMakefile.cxx | 5 +++-- Source/cmMakefileTargetGenerator.h | 2 +- Source/cmNinjaTypes.h | 2 +- Source/cmOrderDirectories.cxx | 4 ++-- Source/cmOrderDirectories.h | 2 +- Source/cmOutputRequiredFilesCommand.cxx | 8 ++++---- Source/cmPropertyMap.cxx | 2 +- Source/cmQtAutoMocUic.cxx | 2 +- Source/cmQtAutoMocUic.h | 6 +++--- Source/cmSourceGroupCommand.h | 2 +- Source/cmString.hxx | 2 +- Source/cmTarget.h | 2 +- Source/cmVariableWatch.h | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 14 ++++++------- Source/cmVisualStudio10TargetGenerator.h | 18 ++++++++--------- Source/cmVisualStudioGeneratorOptions.h | 2 +- Source/cmVisualStudioSlnData.h | 4 ++-- Source/cmVisualStudioSlnParser.cxx | 2 +- Source/cmVisualStudioSlnParser.h | 2 +- Source/cmXCodeScheme.h | 2 +- Source/cm_string_view.hxx | 4 ++-- Source/cm_sys_stat.h | 6 +++--- Source/cmake.cxx | 2 +- Source/cmake.h | 2 +- 85 files changed, 177 insertions(+), 182 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index 0430122..ee3c166 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -29,12 +29,12 @@ class cmCPackIFWGenerator public: cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator); - typedef std::map PackagesMap; - typedef std::map RepositoriesMap; - typedef std::map ComponentsMap; - typedef std::map ComponentGoupsMap; - typedef std::map - DependenceMap; + using PackagesMap = std::map; + using RepositoriesMap = std::map; + using ComponentsMap = std::map; + using ComponentGoupsMap = std::map; + using DependenceMap = + std::map; using cmCPackIFWCommon::GetOption; using cmCPackIFWCommon::IsOn; diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index be51fa5..467779e 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -22,8 +22,8 @@ class cmCPackIFWInstaller : public cmCPackIFWCommon public: // Types - typedef std::map PackagesMap; - typedef std::vector RepositoriesVector; + using PackagesMap = std::map; + using RepositoriesVector = std::vector; public: // Constructor diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h index 227cfae..585334c 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.h +++ b/Source/CPack/IFW/cmCPackIFWRepository.h @@ -28,7 +28,7 @@ public: Replace }; - typedef std::vector RepositoriesVector; + using RepositoriesVector = std::vector; public: // Constructor diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index f8c7644..3b72e38 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -44,9 +44,9 @@ protected: bool SupportsComponentInstallation() const override { return true; } private: - typedef std::map id_map_t; - typedef std::map ambiguity_map_t; - typedef std::set extension_set_t; + using id_map_t = std::map; + using ambiguity_map_t = std::map; + using extension_set_t = std::set; enum class DefinitionType { diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h index 52c7e35..e0e3470 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.h +++ b/Source/CPack/WiX/cmWIXPatchParser.h @@ -36,8 +36,8 @@ struct cmWIXPatchElement : cmWIXPatchNode ~cmWIXPatchElement(); - typedef std::vector child_list_t; - typedef std::map attributes_t; + using child_list_t = std::vector; + using attributes_t = std::map; std::string name; child_list_t children; @@ -50,7 +50,7 @@ struct cmWIXPatchElement : cmWIXPatchNode class cmWIXPatchParser : public cmXMLParser { public: - typedef std::map fragment_map_t; + using fragment_map_t = std::map; cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger); diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx index 2c99a22..751f7dc 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx @@ -25,7 +25,7 @@ cmWIXRichTextFormatWriter::~cmWIXRichTextFormatWriter() void cmWIXRichTextFormatWriter::AddText(std::string const& text) { - typedef unsigned char rtf_byte_t; + using rtf_byte_t = unsigned char; for (size_t i = 0; i < text.size(); ++i) { rtf_byte_t c = rtf_byte_t(text[i]); diff --git a/Source/CPack/WiX/cmWIXShortcut.h b/Source/CPack/WiX/cmWIXShortcut.h index 23ddc6a..d9eecdf 100644 --- a/Source/CPack/WiX/cmWIXShortcut.h +++ b/Source/CPack/WiX/cmWIXShortcut.h @@ -28,8 +28,8 @@ public: STARTUP }; - typedef std::vector shortcut_list_t; - typedef std::map shortcut_id_map_t; + using shortcut_list_t = std::vector; + using shortcut_id_map_t = std::map; void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut); @@ -46,7 +46,7 @@ public: cmInstalledFile const& installedFile); private: - typedef std::map shortcut_type_map_t; + using shortcut_type_map_t = std::map; void CreateFromProperty(std::string const& propertyName, Type type, std::string const& id, diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 9983854..760b03d 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -22,7 +22,7 @@ class cmCPackComponent; class cmCPackArchiveGenerator : public cmCPackGenerator { public: - typedef cmCPackGenerator Superclass; + using Superclass = cmCPackGenerator; /** * Construct generator diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 3c06d41..fc00b09 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -326,7 +326,7 @@ protected: }; #define cmCPackTypeMacro(klass, superclass) \ - typedef superclass Superclass; \ + using Superclass = superclass; \ const char* GetNameOfClass() override { return #klass; } \ static cmCPackGenerator* CreateGenerator() { return new klass; } \ class cmCPackTypeMacro_UseTrailingSemicolon diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h index 972f0f7..da2eb8d 100644 --- a/Source/CPack/cmCPackGeneratorFactory.h +++ b/Source/CPack/cmCPackGeneratorFactory.h @@ -29,7 +29,7 @@ public: cmCPackGenerator* NewGenerator(const std::string& name); void DeleteGenerator(cmCPackGenerator* gen); - typedef cmCPackGenerator* CreateGeneratorCall(); + using CreateGeneratorCall = cmCPackGenerator*(); void RegisterGenerator(const std::string& name, const char* generatorDescription, @@ -37,7 +37,7 @@ public: void SetLogger(cmCPackLog* logger) { this->Logger = logger; } - typedef std::map DescriptionsMap; + using DescriptionsMap = std::map; const DescriptionsMap& GetGeneratorsList() const { return this->GeneratorDescriptions; @@ -47,7 +47,7 @@ private: cmCPackGenerator* NewGeneratorInternal(const std::string& name); std::vector Generators; - typedef std::map t_GeneratorCreatorsMap; + using t_GeneratorCreatorsMap = std::map; t_GeneratorCreatorsMap GeneratorCreators; DescriptionsMap GeneratorDescriptions; cmCPackLog* Logger; diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index b4b320d..08681ec 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -66,7 +66,7 @@ int cpackUnknownArgument(const char* /*unused*/, void* /*unused*/) struct cpackDefinitions { - typedef std::map MapType; + using MapType = std::map; MapType Map; cmCPackLog* Log; }; diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index 2d47b15..d5240aa 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -22,7 +22,7 @@ class cmake; class cmCTestBuildAndTestHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /* * The main entry point for this class diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 147286e..e07d7aa 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -529,7 +529,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml) // Sort XML fragments in chronological order. cmFileTimeCache ftc; FragmentCompare fragmentCompare(&ftc); - typedef std::set Fragments; + using Fragments = std::set; Fragments fragments(fragmentCompare); // only report the first 50 warnings and first 50 errors diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h index 87f1534..ce1d343 100644 --- a/Source/CTest/cmCTestBuildHandler.h +++ b/Source/CTest/cmCTestBuildHandler.h @@ -28,8 +28,8 @@ class cmXMLWriter; class cmCTestBuildHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; - typedef cmProcessOutput::Encoding Encoding; + using Superclass = cmCTestGenericHandler; + using Encoding = cmProcessOutput::Encoding; /* * The main entry point for this class @@ -111,7 +111,7 @@ private: std::vector WarningMatchRegex; std::vector WarningExceptionRegex; - typedef std::deque t_BuildProcessingQueueType; + using t_BuildProcessingQueueType = std::deque; void ProcessBuffer(const char* data, size_t length, size_t& tick, size_t tick_len, std::ostream& ofs, @@ -126,7 +126,7 @@ private: std::string SimplifySourceDir; std::string SimplifyBuildDir; size_t OutputLineCounter; - typedef std::vector t_ErrorsAndWarningsVector; + using t_ErrorsAndWarningsVector = std::vector; t_ErrorsAndWarningsVector ErrorsAndWarnings; t_ErrorsAndWarningsVector::iterator LastErrorOrWarning; size_t PostContextCount; diff --git a/Source/CTest/cmCTestConfigureHandler.h b/Source/CTest/cmCTestConfigureHandler.h index 680401c..01fe801 100644 --- a/Source/CTest/cmCTestConfigureHandler.h +++ b/Source/CTest/cmCTestConfigureHandler.h @@ -14,7 +14,7 @@ class cmCTestConfigureHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /* * The main entry point for this class diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h index 08f31f7..24b96c0 100644 --- a/Source/CTest/cmCTestCoverageCommand.h +++ b/Source/CTest/cmCTestCoverageCommand.h @@ -42,7 +42,7 @@ public: */ std::string GetName() const override { return "ctest_coverage"; } - typedef cmCTestHandlerCommand Superclass; + using Superclass = cmCTestHandlerCommand; protected: cmCTestGenericHandler* InitializeHandler() override; diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 6492fe9..06aaef7 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -24,8 +24,8 @@ public: int Error; std::string SourceDir; std::string BinaryDir; - typedef std::vector SingleFileCoverageVector; - typedef std::map TotalCoverageMap; + using SingleFileCoverageVector = std::vector; + using TotalCoverageMap = std::map; TotalCoverageMap TotalCoverage; std::ostream* OFS; bool Quiet; @@ -37,7 +37,7 @@ public: class cmCTestCoverageHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /* * The main entry point for this class @@ -128,12 +128,12 @@ private: class LabelSet : public std::set { }; - typedef std::map LabelMapType; + using LabelMapType = std::map; LabelMapType SourceLabels; LabelMapType TargetDirs; // Map from label name to label id. - typedef std::map LabelIdMapType; + using LabelIdMapType = std::map; LabelIdMapType LabelIdMap; std::vector Labels; int GetLabelId(std::string const& label); diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index cf91b4f..793829e 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -71,7 +71,7 @@ public: cmCTestGenericHandler(); virtual ~cmCTestGenericHandler(); - typedef std::map t_StringToString; + using t_StringToString = std::map; void SetPersistentOption(const std::string& op, const char* value); void SetOption(const std::string& op, const char* value); diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 746d72c..4bc655b 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -22,7 +22,7 @@ class cmCTestMemCheckHandler : public cmCTestTestHandler friend class cmCTestRunTest; public: - typedef cmCTestTestHandler Superclass; + using Superclass = cmCTestTestHandler; void PopulateCustomVectors(cmMakefile* mf) override; diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index b2e8cbf..4a08ad9 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -58,7 +58,7 @@ class cmake; class cmCTestScriptHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /** * Add a script to run, and if is should run in the current process diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 5bbcd39..8562207 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -37,7 +37,7 @@ public: */ std::string GetName() const override { return "ctest_submit"; } - typedef cmCTestHandlerCommand Superclass; + using Superclass = cmCTestHandlerCommand; protected: cmCTestGenericHandler* InitializeHandler() override; diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index e0fed10..31b747b 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -22,7 +22,7 @@ class cmCTestSubmitHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; cmCTestSubmitHandler(); ~cmCTestSubmitHandler() override { this->LogFile = nullptr; } @@ -59,7 +59,7 @@ private: const std::string& remoteprefix, const std::string& url); - typedef std::vector cmCTestSubmitHandlerVectorOfChar; + using cmCTestSubmitHandlerVectorOfChar = std::vector; void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 2b5a406..f67b11a 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -940,7 +940,7 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const // Prepare some maps to help us find setup and cleanup tests for // any given fixture using TestIterator = ListOfTests::const_iterator; - typedef std::multimap FixtureDependencies; + using FixtureDependencies = std::multimap; using FixtureDepsIterator = FixtureDependencies::const_iterator; FixtureDependencies fixtureSetups; FixtureDependencies fixtureCleanups; diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 9345185..8f1dafc 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -34,7 +34,7 @@ class cmCTestTestHandler : public cmCTestGenericHandler friend class cmCTestMultiProcessHandler; public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /** * The main entry point for this class @@ -188,12 +188,11 @@ public: std::vector& extraPaths, std::vector& failed); - typedef std::vector ListOfTests; + using ListOfTests = std::vector; protected: - typedef std::set - SetOfTests; + using SetOfTests = + std::set; // compute a final test list virtual int PreProcessHandler(); @@ -222,7 +221,7 @@ protected: cmDuration ElapsedTestingTime; - typedef std::vector TestResultsVector; + using TestResultsVector = std::vector; TestResultsVector TestResults; std::vector CustomTestsIgnore; diff --git a/Source/CTest/cmCTestUpdateHandler.h b/Source/CTest/cmCTestUpdateHandler.h index 0f51d3f..57b952d 100644 --- a/Source/CTest/cmCTestUpdateHandler.h +++ b/Source/CTest/cmCTestUpdateHandler.h @@ -18,7 +18,7 @@ class cmCTestUpdateHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; /* * The main entry point for this class diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h index 2bb072f..9e49769 100644 --- a/Source/CTest/cmCTestUploadCommand.h +++ b/Source/CTest/cmCTestUploadCommand.h @@ -41,7 +41,7 @@ public: */ std::string GetName() const override { return "ctest_upload"; } - typedef cmCTestHandlerCommand Superclass; + using Superclass = cmCTestHandlerCommand; protected: cmCTestGenericHandler* InitializeHandler() override; diff --git a/Source/CTest/cmCTestUploadHandler.h b/Source/CTest/cmCTestUploadHandler.h index 4d8fab4..ff69c6e 100644 --- a/Source/CTest/cmCTestUploadHandler.h +++ b/Source/CTest/cmCTestUploadHandler.h @@ -19,7 +19,7 @@ class cmCTestUploadHandler : public cmCTestGenericHandler { public: - typedef cmCTestGenericHandler Superclass; + using Superclass = cmCTestGenericHandler; cmCTestUploadHandler(); diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index f2fd6d9..fa4451b 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -50,7 +50,7 @@ struct QCMakeProperty }; // list of properties -typedef QList QCMakePropertyList; +using QCMakePropertyList = QList; // allow QVariant to be a property or list of properties Q_DECLARE_METATYPE(QCMakeProperty) diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx index fa5e4b9..a6d89aa 100644 --- a/Source/cmAffinity.cxx +++ b/Source/cmAffinity.cxx @@ -22,7 +22,7 @@ # if defined(__linux__) using cm_cpuset_t = cpu_set_t; # else -typedef cpuset_t cm_cpuset_t; +using cm_cpuset_t = cpuset_t; # endif # endif #endif diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h index 93032c1..aa2827e 100644 --- a/Source/cmCLocaleEnvironmentScope.h +++ b/Source/cmCLocaleEnvironmentScope.h @@ -22,7 +22,7 @@ private: std::string GetEnv(std::string const& key); void SetEnv(std::string const& key, std::string const& value); - typedef std::map backup_map_t; + using backup_map_t = std::map; backup_map_t EnvironmentBackup; }; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 65f22f7..a988bd8 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -212,7 +212,7 @@ protected: unsigned int CacheMinorVersion; private: - typedef std::map CacheEntryMap; + using CacheEntryMap = std::map; static void OutputHelpString(std::ostream& fout, const std::string& helpString); static void OutputWarningComment(std::ostream& fout, diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index 6b0f74e..17792d6 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -50,7 +50,7 @@ protected: void AppendOSXVerFlag(std::string& flags, const std::string& lang, const char* name, bool so); - typedef std::map ByLanguageMap; + using ByLanguageMap = std::map; std::string GetFlags(const std::string& l); ByLanguageMap FlagsByLanguage; std::string GetDefines(const std::string& l); diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 9a6f239..102b178 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -68,7 +68,7 @@ public: /** Backtrace of the command that created this custom command. */ cmListFileBacktrace const& GetBacktrace() const; - typedef std::pair ImplicitDependsPair; + using ImplicitDependsPair = std::pair; class ImplicitDependsList : public std::vector { }; diff --git a/Source/cmDepends.h b/Source/cmDepends.h index b7475f0..d938775 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -24,7 +24,7 @@ class cmLocalGenerator; class cmDepends { public: - typedef std::map> DependencyMap; + using DependencyMap = std::map>; public: /** Instances need to know the build directory name and the relative diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h index 3fc839e..cbdc276 100644 --- a/Source/cmDependsC.h +++ b/Source/cmDependsC.h @@ -59,7 +59,7 @@ protected: // Regex to transform #include lines. std::string IncludeRegexTransformString; cmsys::RegularExpression IncludeRegexTransform; - typedef std::map TransformRulesType; + using TransformRulesType = std::map; TransformRulesType TransformRules; void SetupTransforms(); void ParseTransform(std::string const& xform); diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 8df9938..c30e0bf 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -46,11 +46,11 @@ public: std::set TargetProvides; // Map modules required by this target to locations. - typedef std::map TargetRequiresMap; + using TargetRequiresMap = std::map; TargetRequiresMap TargetRequires; // Information about each object file. - typedef std::map ObjectInfoMap; + using ObjectInfoMap = std::map; ObjectInfoMap ObjectInfo; cmFortranSourceInfo& CreateObjectInfo(const std::string& obj, diff --git a/Source/cmDuration.h b/Source/cmDuration.h index 6df1455..ccd1cc1 100644 --- a/Source/cmDuration.h +++ b/Source/cmDuration.h @@ -5,7 +5,7 @@ #include #include -typedef std::chrono::duration> cmDuration; +using cmDuration = std::chrono::duration>; /* * This function will return number of seconds in the requested type T. diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 425f1a8..648a900 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -20,11 +20,11 @@ #elif defined(__HAIKU__) # include # include -typedef struct Elf32_Ehdr Elf32_Ehdr; -typedef struct Elf32_Shdr Elf32_Shdr; -typedef struct Elf32_Sym Elf32_Sym; -typedef struct Elf32_Rel Elf32_Rel; -typedef struct Elf32_Rela Elf32_Rela; +using Elf32_Ehdr = struct Elf32_Ehdr; +using Elf32_Shdr = struct Elf32_Shdr; +using Elf32_Sym = struct Elf32_Sym; +using Elf32_Rel = struct Elf32_Rel; +using Elf32_Rela = struct Elf32_Rela; # define ELFMAG0 0x7F # define ELFMAG1 'E' # define ELFMAG2 'L' @@ -289,9 +289,8 @@ public: } private: - // ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size - typedef char dyn_size_assert - [sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr) ? 1 : -1]; + static_assert(sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr), + "ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size"); void ByteSwap(ELF_Ehdr& elf_header) { diff --git a/Source/cmELF.h b/Source/cmELF.h index afef654..123bf9b 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -68,7 +68,7 @@ public: }; /** Represent entire dynamic section header */ - typedef std::vector> DynamicEntryList; + using DynamicEntryList = std::vector>; /** Get the type of the file opened. */ FileType GetFileType() const; diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 747503e..6fa86ab 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -62,7 +62,7 @@ public: bool GenerateImportFile(); protected: - typedef std::map ImportPropertyMap; + using ImportPropertyMap = std::map; // Generate per-configuration target information to the given output // stream. diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h index 3853732..0ef07ef 100644 --- a/Source/cmExportSetMap.h +++ b/Source/cmExportSetMap.h @@ -13,7 +13,7 @@ class cmExportSet; /// A name -> cmExportSet map with overloaded operator[]. class cmExportSetMap : public std::map { - typedef std::map derived; + using derived = std::map; public: /** \brief Overloaded operator[]. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 6b16b93..5a9c54c 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -333,7 +333,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // Collect all used source files in the project. // Keep a list of C/C++ source files which might have an accompanying header // that should be looked for. - typedef std::map all_files_map_t; + using all_files_map_t = std::map; all_files_map_t allFiles; std::vector cFiles; diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h index bc158f6..d9ef1d1 100644 --- a/Source/cmExtraSublimeTextGenerator.h +++ b/Source/cmExtraSublimeTextGenerator.h @@ -24,7 +24,7 @@ class cmExtraSublimeTextGenerator : public cmExternalMakefileProjectGenerator { public: static cmExternalMakefileProjectGeneratorFactory* GetFactory(); - typedef std::map> MapSourceFileFlags; + using MapSourceFileFlags = std::map>; cmExtraSublimeTextGenerator(); void Generate() override; diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index c452814..81c1906 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -19,7 +19,7 @@ class cmFileLockResult { public: #if defined(_WIN32) - typedef DWORD Error; + using Error = DWORD; #else using Error = int; #endif diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 133a72b..32eb3cd 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -370,9 +370,8 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string& input) void cmCompiledGeneratorExpression::GetMaxLanguageStandard( const cmGeneratorTarget* tgt, std::map& mapping) { - typedef std::map> - MapType; + using MapType = + std::map>; MapType::const_iterator it = this->MaxLanguageStandard.find(tgt); if (it != this->MaxLanguageStandard.end()) { mapping = it->second; diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 667f4a0..89b6c1c 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1473,7 +1473,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode } context->HadHeadSensitiveCondition = true; - typedef std::map> LangMap; + using LangMap = std::map>; static LangMap availableFeatures; LangMap testedFeatures; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 48ffcec..b4706a3 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1107,7 +1107,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory( config_upper = cmSystemTools::UpperCase(config); } - typedef std::map> IncludeCacheType; + using IncludeCacheType = std::map>; IncludeCacheType::const_iterator iter = this->SystemIncludesCache.find(config_upper); @@ -2606,7 +2606,7 @@ private: SourceEntry* CurrentEntry; std::queue SourceQueue; std::set SourcesQueued; - typedef std::map NameMapType; + using NameMapType = std::map; NameMapType NameMap; std::vector NewSources; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 4701071..9eb2ecf 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -531,7 +531,7 @@ public: CompileInfo const* GetCompileInfo(const std::string& config) const; - typedef std::map CompileInfoMapType; + using CompileInfoMapType = std::map; mutable CompileInfoMapType CompileInfoMap; bool IsNullImpliedByLinkLibraries(const std::string& p) const; @@ -745,7 +745,7 @@ private: { std::vector Depends; }; - typedef std::map SourceEntriesType; + using SourceEntriesType = std::map; SourceEntriesType SourceDepends; mutable std::map Objects; std::set ExplicitObjectName; @@ -775,7 +775,7 @@ private: std::string& outPrefix, std::string& outBase, std::string& outSuffix) const; - typedef std::map LinkClosureMapType; + using LinkClosureMapType = std::map; mutable LinkClosureMapType LinkClosureMap; // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type. @@ -802,8 +802,8 @@ private: }; mutable std::map CompatibleInterfacesMap; - typedef std::map - cmTargetLinkInformationMap; + using cmTargetLinkInformationMap = + std::map; mutable cmTargetLinkInformationMap LinkInformation; void CheckPropertyCompatibility(cmComputeLinkInformation* info, @@ -815,7 +815,7 @@ private: }; mutable std::map LinkImplClosureMap; - typedef std::map LinkInterfaceMapType; + using LinkInterfaceMapType = std::map; mutable LinkInterfaceMapType LinkInterfaceMap; mutable LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap; @@ -843,7 +843,7 @@ private: std::string SharedDeps; }; - typedef std::map ImportInfoMapType; + using ImportInfoMapType = std::map; mutable ImportInfoMapType ImportInfoMap; void ComputeImportInfo(std::string const& desired_config, ImportInfo& info) const; @@ -857,7 +857,7 @@ private: const std::string& config, const cmGeneratorTarget* head, bool usage_requirements_only) const; - typedef std::map KindedSourcesMapType; + using KindedSourcesMapType = std::map; mutable KindedSourcesMapType KindedSourcesMap; void ComputeKindedSources(KindedSources& files, std::string const& config) const; @@ -902,7 +902,7 @@ private: : public std::map { }; - typedef std::map LinkImplMapType; + using LinkImplMapType = std::map; mutable LinkImplMapType LinkImplMap; cmLinkImplementationLibraries const* GetLinkImplementationLibrariesInternal( @@ -911,17 +911,17 @@ private: cmStateEnums::ArtifactType artifact, std::string& out) const; - typedef std::map OutputInfoMapType; + using OutputInfoMapType = std::map; mutable OutputInfoMapType OutputInfoMap; - typedef std::map - ModuleDefinitionInfoMapType; + using ModuleDefinitionInfoMapType = + std::map; mutable ModuleDefinitionInfoMapType ModuleDefinitionInfoMap; void ComputeModuleDefinitionInfo(std::string const& config, ModuleDefinitionInfo& info) const; - typedef std::pair OutputNameKey; - typedef std::map OutputNameMapType; + using OutputNameKey = std::pair; + using OutputNameMapType = std::map; mutable OutputNameMapType OutputNameMap; mutable std::set UtilityItems; cmPolicies::PolicyMap PolicyMap; diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h index 48606d3..e03d939 100644 --- a/Source/cmGlobVerificationManager.h +++ b/Source/cmGlobVerificationManager.h @@ -72,7 +72,7 @@ private: std::vector> Backtraces; }; - typedef std::map CacheEntryMap; + using CacheEntryMap = std::map; CacheEntryMap Cache; std::string VerifyScript; std::string VerifyStamp; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 36e5d0e..d67c725 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -561,11 +561,11 @@ protected: const char* GetPredefinedTargetsFolder(); private: - typedef std::unordered_map TargetMap; - typedef std::unordered_map - GeneratorTargetMap; - typedef std::unordered_map MakefileMap; - typedef std::unordered_map LocalGeneratorMap; + using TargetMap = std::unordered_map; + using GeneratorTargetMap = + std::unordered_map; + using MakefileMap = std::unordered_map; + using LocalGeneratorMap = std::unordered_map; // Map efficiently from target name to cmTarget instance. // Do not use this structure for looping over all targets. // It contains both normal and globally visible imported targets. @@ -626,7 +626,7 @@ private: std::vector FilesReplacedDuringGenerate; // Store computed inter-target dependencies. - typedef std::map TargetDependMap; + using TargetDependMap = std::map; TargetDependMap TargetDependencies; friend class cmake; diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index 9b5bf63..e58e65e 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -148,9 +148,8 @@ class cmGlobalGhsMultiGenerator::OrderedTargetDependSet : public std::multiset { - typedef std::multiset - derived; + using derived = + std::multiset; public: using TargetDependSet = cmGlobalGenerator::TargetDependSet; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index db64031..f6d5998 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -426,7 +426,7 @@ private: /// The mapping from source file to assumed dependencies. std::map> AssumedSourceDependencies; - typedef std::map TargetAliasMap; + using TargetAliasMap = std::map; TargetAliasMap TargetAliases; std::map TargetDependsClosures; diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 287472c..264de54 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -220,9 +220,8 @@ protected: std::vector Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); }; - typedef std::map - ProgressMapType; + using ProgressMapType = std::map; ProgressMapType ProgressMap; size_t CountProgressMarksInTarget( diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index e4cd73f..bd615ec 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -180,7 +180,7 @@ protected: const std::string&); virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0; std::string GetUtilityDepend(const cmGeneratorTarget* target); - typedef std::map UtilityDependsMap; + using UtilityDependsMap = std::map; UtilityDependsMap UtilityDepends; protected: @@ -213,13 +213,12 @@ class cmGlobalVisualStudioGenerator::OrderedTargetDependSet : public std::multiset { - typedef std::multiset - derived; + using derived = std::multiset; public: - typedef cmGlobalGenerator::TargetDependSet TargetDependSet; - typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet; + using TargetDependSet = cmGlobalGenerator::TargetDependSet; + using TargetSet = cmGlobalVisualStudioGenerator::TargetSet; OrderedTargetDependSet(TargetDependSet const&, std::string const& first); OrderedTargetDependSet(TargetSet const&, std::string const& first); }; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 427ab44..21c2b2a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1244,8 +1244,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( // framework or bundle targets std::vector contentBuildPhases; if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { - typedef std::map> - mapOfVectorOfSourceFiles; + using mapOfVectorOfSourceFiles = + std::map>; mapOfVectorOfSourceFiles bundleFiles; for (auto sourceFile : classes) { cmGeneratorTarget::SourceFileFlags tsFlags = @@ -1292,8 +1292,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( // create vector of "resource content file" build phases - only for // framework or bundle targets if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { - typedef std::map> - mapOfVectorOfSourceFiles; + using mapOfVectorOfSourceFiles = + std::map>; mapOfVectorOfSourceFiles bundleFiles; for (auto sourceFile : classes) { cmGeneratorTarget::SourceFileFlags tsFlags = @@ -3048,7 +3048,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( this->CreateObject(cmXCodeObject::XCConfigurationList); cmXCodeObject* buildConfigurations = this->CreateObject(cmXCodeObject::OBJECT_LIST); - typedef std::vector> Configs; + using Configs = std::vector>; Configs configs; std::string defaultConfigName; for (const auto& name : this->CurrentConfigurationTypes) { diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index 4a43073..f949ae3 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -51,7 +51,7 @@ protected: // and overwrite or add new values to this map class FlagValue : public std::vector { - typedef std::vector derived; + using derived = std::vector; public: FlagValue& operator=(std::string const& r) diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index e00e666..ee809ee 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -37,7 +37,7 @@ public: ExpressionVectorType ValueExpressions; }; - typedef std::map PropertyMapType; + using PropertyMapType = std::map; cmInstalledFile(); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f63fe0f..8c7e7a3 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -433,8 +433,8 @@ protected: std::set EnvCPATH; - typedef std::unordered_map - GeneratorTargetMap; + using GeneratorTargetMap = + std::unordered_map; GeneratorTargetMap GeneratorTargetSearchIndex; std::vector GeneratorTargets; diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 3a30bbb..08bec70 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -109,8 +109,8 @@ private: std::string HomeRelativeOutputPath; - typedef std::map> - CustomCommandTargetMap; + using CustomCommandTargetMap = + std::map>; CustomCommandTargetMap CustomCommandTargets; std::vector CustomCommands; }; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 357ccc8..dd25716 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -30,7 +30,7 @@ public: : LocalGenerator(e) { } - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; void OutputLibraries(std::ostream& fout, ItemVector const& libs); void OutputObjects(std::ostream& fout, cmGeneratorTarget* t, std::string const& config, const char* isep = 0); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index ce8eceb..671783f 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -83,8 +83,8 @@ protected: void CreateSingleVCProj(const std::string& lname, cmGeneratorTarget* tgt); private: - typedef cmVS7GeneratorOptions Options; - typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; + using Options = cmVS7GeneratorOptions; + using FCInfo = cmLocalVisualStudio7GeneratorFCInfo; std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const std::string& configName); void FixGlobalTargets(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index dfe0086..411add3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2744,12 +2744,13 @@ MessageType cmMakefile::ExpandVariablesInStringOld( return mtype; } -typedef enum +enum t_domain { NORMAL, ENVIRONMENT, CACHE -} t_domain; +}; + struct t_lookup { t_domain domain = NORMAL; diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 9eeeed0..f464128 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -223,7 +223,7 @@ protected: // Set of extra output files to be driven by the build. std::set ExtraFiles; - typedef std::map MultipleOutputPairsType; + using MultipleOutputPairsType = std::map; MultipleOutputPairsType MultipleOutputPairs; bool WriteMakeRule(std::ostream& os, const char* comment, const std::vector& outputs, diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index 89afbbd..bd0e83f 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -19,7 +19,7 @@ enum cmNinjaTargetDepends using cmNinjaDeps = std::vector; using cmNinjaOuts = std::set; -typedef std::map cmNinjaVars; +using cmNinjaVars = std::map; class cmNinjaRule { diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 21a17e8..35ec33e 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -412,7 +412,7 @@ void cmOrderDirectories::AddOriginalDirectories( struct cmOrderDirectoriesCompare { - typedef std::pair ConflictPair; + using ConflictPair = std::pair; // The conflict pair is unique based on just the directory // (first). The second element is only used for displaying @@ -557,7 +557,7 @@ std::string const& cmOrderDirectories::GetRealPath(std::string const& dir) this->RealPaths.lower_bound(dir); if (i == this->RealPaths.end() || this->RealPaths.key_comp()(dir, i->first)) { - typedef std::map::value_type value_type; + using value_type = std::map::value_type; i = this->RealPaths.insert( i, value_type(dir, cmSystemTools::GetRealPath(dir))); } diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 23e61d6..2dfc4d1 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -75,7 +75,7 @@ private: // the index of the directory that must come first. The second // element is the index of the runtime library that added the // constraint. - typedef std::pair ConflictPair; + using ConflictPair = std::pair; struct ConflictList : public std::vector { }; diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 1a854dc..c034fdd 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -446,10 +446,10 @@ protected: cmsys::RegularExpression IncludeFileRegularExpression; cmsys::RegularExpression ComplainFileRegularExpression; std::vector IncludeDirectories; - typedef std::map FileToPathMapType; - typedef std::map - DirectoryToFileToPathMapType; - typedef std::map DependInformationMapType; + using FileToPathMapType = std::map; + using DirectoryToFileToPathMapType = + std::map; + using DependInformationMapType = std::map; DependInformationMapType DependInformationMap; DirectoryToFileToPathMapType DirectoryToFileToPathMap; }; diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 3ed4c05..a3d4946 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -66,7 +66,7 @@ std::vector cmPropertyMap::GetKeys() const std::vector> cmPropertyMap::GetList() const { - typedef std::pair StringPair; + using StringPair = std::pair; std::vector kvList; kvList.reserve(Map_.size()); for (auto const& item : Map_) { diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index 84359f2..14329c0 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -1237,7 +1237,7 @@ std::pair cmQtAutoMocUic::JobGenerateT::MocFindDependency( std::string const& sourceDir, std::string const& includeString) const { - typedef std::pair ResPair; + using ResPair = std::pair; // Search in vicinity of the source { ResPair res{ sourceDir + includeString, {} }; diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h index 076e460..549b088 100644 --- a/Source/cmQtAutoMocUic.h +++ b/Source/cmQtAutoMocUic.h @@ -107,7 +107,7 @@ public: } Uic; }; using FileHandleT = std::shared_ptr; - typedef std::pair GetOrInsertT; + using GetOrInsertT = std::pair; public: ParseCacheT(); @@ -147,7 +147,7 @@ public: bool Uic = false; }; using SourceFileHandleT = std::shared_ptr; - typedef std::map SourceFileMapT; + using SourceFileMapT = std::map; /** * Meta compiler file mapping information @@ -160,7 +160,7 @@ public: std::vector IncluderFiles; }; using MappingHandleT = std::shared_ptr; - typedef std::map MappingMapT; + using MappingMapT = std::map; /** * Common settings diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index 45438a9..87a6114 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -40,7 +40,7 @@ public: cmExecutionStatus& status) override; private: - typedef std::map> ParsedArguments; + using ParsedArguments = std::map>; using ExpectedOptions = std::vector; ExpectedOptions getExpectedOptions() const; diff --git a/Source/cmString.hxx b/Source/cmString.hxx index 050a2fd..a401ad1 100644 --- a/Source/cmString.hxx +++ b/Source/cmString.hxx @@ -725,7 +725,7 @@ struct StringAdd template struct StringAdd> : std::true_type { - typedef StringOpPlus const& temp_type; + using temp_type = StringOpPlus const&; static temp_type temp(temp_type s) { return s; } }; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index fa420af..e9bcffe 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -107,7 +107,7 @@ public: cmSourceFile* AddSource(const std::string& src, bool before = false); //! how we identify a library, by name and type - typedef std::pair LibraryID; + using LibraryID = std::pair; using LinkLibraryVectorType = std::vector; LinkLibraryVectorType const& GetOriginalLinkLibraries() const; diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 32445d5..e4b3b7c 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -77,7 +77,7 @@ protected: }; using VectorOfPairs = std::vector>; - typedef std::map StringToVectorOfPairs; + using StringToVectorOfPairs = std::map; StringToVectorOfPairs WatchMap; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 06e1798..101c97a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -121,7 +121,7 @@ struct cmVisualStudio10TargetGenerator::Elem class cmVS10GeneratorOptions : public cmVisualStudioGeneratorOptions { public: - typedef cmVisualStudio10TargetGenerator::Elem Elem; + using Elem = cmVisualStudio10TargetGenerator::Elem; cmVS10GeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool, cmVS7FlagTable const* table, cmVisualStudio10TargetGenerator* g = nullptr) @@ -894,7 +894,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( static const std::string refpropPrefix = "VS_DOTNET_REFERENCEPROP_"; static const std::string refpropInfix = "_TAG_"; const std::string refPropFullPrefix = refpropPrefix + ref + refpropInfix; - typedef std::map CustomTags; + using CustomTags = std::map; CustomTags tags; cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties(); for (const auto& i : props.GetList()) { @@ -2349,7 +2349,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } if (this->ProjectType == csproj) { std::string f = source->GetFullPath(); - typedef std::map CsPropMap; + using CsPropMap = std::map; CsPropMap sourceFileTags; // set tag if necessary std::string link; @@ -3663,7 +3663,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions( } cmComputeLinkInformation& cli = *pcli; - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; const ItemVector& libs = cli.GetItems(); std::string currentBinDir = this->LocalGenerator->GetCurrentBinaryDirectory(); @@ -3708,7 +3708,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries( const cmComputeLinkInformation& cli, std::vector& libVec, std::vector& vsTargetVec, const std::string& config) { - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; ItemVector const& libs = cli.GetItems(); std::string currentBinDir = this->LocalGenerator->GetCurrentBinaryDirectory(); @@ -3934,8 +3934,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) { cmGlobalGenerator::TargetDependSet const& unordered = this->GlobalGenerator->GetTargetDirectDepends(this->GeneratorTarget); - typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet - OrderedTargetDependSet; + using OrderedTargetDependSet = + cmGlobalVisualStudioGenerator::OrderedTargetDependSet; OrderedTargetDependSet depends(unordered, CMAKE_CHECK_BUILD_SYSTEM_TARGET); Elem e1(e0, "ItemGroup"); e1.SetHasElements(); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 6607e77..4dd92eb 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -186,8 +186,8 @@ private: private: friend class cmVS10GeneratorOptions; - typedef cmVS10GeneratorOptions Options; - typedef std::map> OptionsMap; + using Options = cmVS10GeneratorOptions; + using OptionsMap = std::map>; OptionsMap ClOptions; OptionsMap RcOptions; OptionsMap CudaOptions; @@ -224,16 +224,16 @@ private: std::string DefaultArtifactDir; bool AddedDefaultCertificate = false; // managed C++/C# relevant members - typedef std::pair DotNetHintReference; - typedef std::vector DotNetHintReferenceList; - typedef std::map - DotNetHintReferenceMap; + using DotNetHintReference = std::pair; + using DotNetHintReferenceList = std::vector; + using DotNetHintReferenceMap = + std::map; DotNetHintReferenceMap DotNetHintReferences; - typedef std::set UsingDirectories; - typedef std::map UsingDirectoriesMap; + using UsingDirectories = std::set; + using UsingDirectoriesMap = std::map; UsingDirectoriesMap AdditionalUsingDirectories; - typedef std::map ToolSourceMap; + using ToolSourceMap = std::map; ToolSourceMap Tools; std::string GetCMakeFilePath(const char* name) const; }; diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index a30a67f..560593e 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -14,7 +14,7 @@ class cmLocalVisualStudioGenerator; -typedef cmIDEFlagTable cmVS7FlagTable; +using cmVS7FlagTable = cmIDEFlagTable; class cmVisualStudioGeneratorOptions : public cmIDEOptions { diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h index 9c1dffc..5ce7d74 100644 --- a/Source/cmVisualStudioSlnData.h +++ b/Source/cmVisualStudioSlnData.h @@ -45,9 +45,9 @@ public: const std::string& projectRelativePath); private: - typedef std::map ProjectStorage; + using ProjectStorage = std::map; ProjectStorage ProjectsByGUID; - typedef std::map ProjectStringIndex; + using ProjectStringIndex = std::map; ProjectStringIndex ProjectNameIndex; }; diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx index 9eaee11..05ef517 100644 --- a/Source/cmVisualStudioSlnParser.cxx +++ b/Source/cmVisualStudioSlnParser.cxx @@ -51,7 +51,7 @@ public: void CopyVerbatim(const std::string& line) { this->Tag = line; } private: - typedef std::pair StringData; + using StringData = std::pair; std::string Tag; StringData Arg; std::vector Values; diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h index d6345a8..166f788 100644 --- a/Source/cmVisualStudioSlnParser.h +++ b/Source/cmVisualStudioSlnParser.h @@ -42,7 +42,7 @@ public: DataGroupCount }; - typedef std::bitset DataGroupSet; + using DataGroupSet = std::bitset; static const DataGroupSet DataGroupProjects; static const DataGroupSet DataGroupProjectDependencies; diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h index 8c47123..1cc5324 100644 --- a/Source/cmXCodeScheme.h +++ b/Source/cmXCodeScheme.h @@ -18,7 +18,7 @@ class cmXCodeScheme { public: - typedef std::vector TestObjects; + using TestObjects = std::vector; cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests, const std::vector& configList, diff --git a/Source/cm_string_view.hxx b/Source/cm_string_view.hxx index d368ed8..04de797 100644 --- a/Source/cm_string_view.hxx +++ b/Source/cm_string_view.hxx @@ -207,8 +207,8 @@ namespace std { template <> struct hash { - typedef cm::string_view argument_type; - typedef size_t result_type; + using argument_type = cm::string_view; + using result_type = size_t; result_type operator()(argument_type const& s) const noexcept; }; } diff --git a/Source/cm_sys_stat.h b/Source/cm_sys_stat.h index 796f027..d3b9ef2 100644 --- a/Source/cm_sys_stat.h +++ b/Source/cm_sys_stat.h @@ -4,12 +4,12 @@ #define cm_sys_stat_h #if defined(_MSC_VER) -typedef unsigned short mode_t; +using mode_t = unsigned short; #endif #if defined(WIN32) -typedef unsigned short uid_t; -typedef unsigned short gid_t; +using uid_t = unsigned short; +using gid_t = unsigned short; #endif #include diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1746082..ace9198 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -116,7 +116,7 @@ namespace { #if !defined(CMAKE_BOOTSTRAP) -typedef std::unordered_map JsonValueMapType; +using JsonValueMapType = std::unordered_map; #endif } // namespace diff --git a/Source/cmake.h b/Source/cmake.h index cc44b92..687c105 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -133,7 +133,7 @@ public: std::unordered_set unordered; }; - typedef std::map InstalledFilesMap; + using InstalledFilesMap = std::map; static const int NO_BUILD_PARALLEL_LEVEL = -1; static const int DEFAULT_BUILD_PARALLEL_LEVEL = 0; -- cgit v0.12 From 1d3f5ebb0d3da35d1b5b1287f39115b188ac5f6a Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Wed, 4 Sep 2019 18:44:53 +0200 Subject: clang-tidy: Enable check modernize-use-using Annotate the remaining typedefs with NOLINT. Unfortunately, clang-tidy is not smart enough and suggests the use of using inside extern "C" blocks. --- .clang-tidy | 1 - Source/cmCPluginAPI.h | 11 +++++++++++ Source/cmListFileLexer.h | 13 +++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6f96c22..cfca64e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -20,7 +20,6 @@ modernize-*,\ -modernize-use-nodiscard,\ -modernize-use-noexcept,\ -modernize-use-transparent-functors,\ --modernize-use-using,\ performance-*,\ readability-*,\ -readability-function-size,\ diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index adc57a2..6a95148 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -28,6 +28,7 @@ this is the structure of function entry points that a plugin may call. This structure must be kept in sync with the static decaled at the bottom of cmCPLuginAPI.cxx =========================================================================*/ +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct { /*========================================================================= @@ -194,12 +195,21 @@ define the different types of custom commands for a target /*========================================================================= Finally we define the key data structures and function prototypes =========================================================================*/ + +/* NOLINTNEXTLINE(modernize-use-using) */ 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* []); + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf); + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info); +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct { unsigned long reserved1; /* Reserved for future use. DO NOT USE. */ @@ -216,6 +226,7 @@ typedef struct void* ClientData; } cmLoadedCommandInfo; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*); #ifdef __cplusplus diff --git a/Source/cmListFileLexer.h b/Source/cmListFileLexer.h index 8962396..ec6b3cd 100644 --- a/Source/cmListFileLexer.h +++ b/Source/cmListFileLexer.h @@ -3,6 +3,11 @@ #ifndef cmListFileLexer_h #define cmListFileLexer_h +#ifdef __cplusplus +extern "C" { +#endif + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef enum cmListFileLexer_Type_e { cmListFileLexer_Token_None, @@ -20,6 +25,7 @@ typedef enum cmListFileLexer_Type_e cmListFileLexer_Token_BadString } cmListFileLexer_Type; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct cmListFileLexer_Token_s cmListFileLexer_Token; struct cmListFileLexer_Token_s { @@ -40,14 +46,13 @@ enum cmListFileLexer_BOM_e cmListFileLexer_BOM_UTF32BE, cmListFileLexer_BOM_UTF32LE }; + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct cmListFileLexer_s cmListFileLexer; -#ifdef __cplusplus -extern "C" { -#endif - cmListFileLexer* cmListFileLexer_New(void); int cmListFileLexer_SetFileName(cmListFileLexer*, const char*, cmListFileLexer_BOM* bom); -- cgit v0.12