From 62e5f722899cfa7c51791be7697c9030aee3a19b Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Fri, 23 Aug 2019 23:25:56 +0200 Subject: clang-tidy: Replace typedef with using --- Source/CPack/cmCPackFreeBSDGenerator.cxx | 2 +- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBZR.cxx | 4 ++-- Source/CTest/cmCTestCVS.cxx | 2 +- Source/CTest/cmCTestGIT.cxx | 4 ++-- Source/CTest/cmCTestHG.cxx | 4 ++-- Source/CTest/cmCTestP4.cxx | 4 ++-- Source/CTest/cmCTestSVN.cxx | 4 ++-- Source/CTest/cmCTestSubmitHandler.cxx | 2 +- Source/CTest/cmCTestTestHandler.cxx | 4 ++-- Source/CTest/cmParseBlanketJSCoverage.cxx | 4 ++-- Source/CTest/cmParseCoberturaCoverage.cxx | 4 ++-- Source/CTest/cmParseDelphiCoverage.cxx | 4 ++-- Source/CTest/cmParseJacocoCoverage.cxx | 4 ++-- Source/cmAffinity.cxx | 2 +- Source/cmAlgorithms.h | 6 +++--- Source/cmArchiveWrite.cxx | 2 +- Source/cmCPluginAPI.cxx | 6 +++--- Source/cmCTest.h | 2 +- Source/cmComputeComponentGraph.h | 6 +++--- Source/cmComputeLinkDepends.h | 8 ++++---- Source/cmComputeLinkInformation.h | 2 +- Source/cmComputeTargetDepends.h | 6 +++--- Source/cmConditionEvaluator.h | 2 +- Source/cmCustomCommandLines.h | 12 ++++++------ Source/cmDefinitions.h | 2 +- Source/cmDependsFortran.cxx | 8 ++++---- Source/cmELF.cxx | 32 +++++++++++++++---------------- Source/cmExecProgramCommand.cxx | 2 +- Source/cmFileCommand.cxx | 2 +- Source/cmFileLockPool.h | 12 ++++++------ Source/cmFileLockResult.h | 2 +- Source/cmFileTime.h | 2 +- Source/cmFindLibraryCommand.cxx | 2 +- Source/cmFindPackageCommand.h | 4 ++-- Source/cmFortranParser.h | 2 +- Source/cmGeneratedFileStream.h | 4 ++-- Source/cmGeneratorExpressionParser.cxx | 4 ++-- Source/cmGeneratorTarget.cxx | 2 +- Source/cmGlobalGenerator.h | 4 ++-- Source/cmGlobalGhsMultiGenerator.h | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 1 + Source/cmGlobalVisualStudio8Generator.cxx | 1 + Source/cmInstallTargetGenerator.h | 6 +++--- Source/cmInstalledFile.cxx | 1 + Source/cmInstalledFile.h | 9 ++++----- Source/cmLinkLineComputer.cxx | 2 +- Source/cmLinkLineDeviceComputer.cxx | 4 ++-- Source/cmLinkedTree.h | 6 +++--- Source/cmListCommand.cxx | 2 +- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 1 + Source/cmMakefile.cxx | 2 +- Source/cmMakefile.h | 10 +++++----- Source/cmNinjaTypes.h | 4 ++-- Source/cmOutputRequiredFilesCommand.cxx | 2 +- Source/cmParseArgumentsCommand.cxx | 8 ++++---- Source/cmProcessTools.h | 2 +- Source/cmQtAutoGen.cxx | 4 ++-- Source/cmQtAutoGen.h | 2 +- Source/cmQtAutoGenInitializer.h | 2 +- Source/cmQtAutoGenerator.cxx | 2 +- Source/cmQtAutoMocUic.h | 6 +++--- Source/cmScriptGenerator.h | 2 +- Source/cmSourceGroupCommand.h | 2 +- Source/cmStatePrivate.h | 2 +- Source/cmStateTypes.h | 2 +- Source/cmString.hxx | 6 +++--- Source/cmStringAlgorithms.h | 2 +- Source/cmSystemTools.h | 4 ++-- Source/cmTarget.h | 2 +- Source/cmUVHandlePtr.h | 4 ++-- Source/cmUuid.cxx | 2 +- Source/cmVariableWatch.h | 9 ++++----- Source/cmWorkerPool.cxx | 6 +++--- Source/cmWorkerPool.h | 2 +- Source/cmXMLParser.h | 2 +- Source/cmake.h | 6 +++--- Source/cmcmd.cxx | 4 ++-- Tests/CMakeLib/run_compile_commands.cxx | 2 +- 80 files changed, 164 insertions(+), 162 deletions(-) diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index a35977c..bbba8a1 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -131,7 +131,7 @@ public: class ManifestKeyListValue : public ManifestKey { public: - typedef std::vector VList; + using VList = std::vector; VList value; ManifestKeyListValue(const std::string& k) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 69dac88..b4b320d 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -157,7 +157,7 @@ int main(int argc, char const* const* argv) cmsys::CommandLineArguments arg; arg.Initialize(argc, argv); - typedef cmsys::CommandLineArguments argT; + using argT = cmsys::CommandLineArguments; // Help arguments arg.AddArgument("--help", argT::NO_ARGUMENT, &help, "CPack help"); arg.AddArgument("--help-full", argT::SPACE_ARGUMENT, &helpFull, diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index b957856..52dc0ac 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -200,8 +200,8 @@ public: private: cmCTestBZR* BZR; - typedef cmCTestBZR::Revision Revision; - typedef cmCTestBZR::Change Change; + using Revision = cmCTestBZR::Revision; + using Change = cmCTestBZR::Change; Revision Rev; std::vector Changes; Change CurChange; diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 560c169..b9b90c8 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -105,7 +105,7 @@ bool cmCTestCVS::UpdateImpl() class cmCTestCVS::LogParser : public cmCTestVC::LineParser { public: - typedef cmCTestCVS::Revision Revision; + using Revision = cmCTestCVS::Revision; LogParser(cmCTestCVS* cvs, const char* prefix, std::vector& revs) : CVS(cvs) , Revisions(revs) diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index f7319ef..3ae464d 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -333,7 +333,7 @@ public: this->SetLog(&git->Log, prefix); } - typedef cmCTestGIT::Change Change; + using Change = cmCTestGIT::Change; std::vector Changes; protected: @@ -456,7 +456,7 @@ public: } private: - typedef cmCTestGIT::Revision Revision; + using Revision = cmCTestGIT::Revision; enum SectionType { SectionHeader, diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index ba2252a..297077e 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -174,8 +174,8 @@ public: private: cmCTestHG* HG; - typedef cmCTestHG::Revision Revision; - typedef cmCTestHG::Change Change; + using Revision = cmCTestHG::Revision; + using Change = cmCTestHG::Change; Revision Rev; std::vector Changes; Change CurChange; diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 64354e8..9bca7cb 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -204,8 +204,8 @@ private: cmsys::RegularExpression RegexDiff; cmCTestP4* P4; - typedef cmCTestP4::Revision Revision; - typedef cmCTestP4::Change Change; + using Revision = cmCTestP4::Revision; + using Change = cmCTestP4::Change; std::vector Changes; enum SectionType { diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index dc1472b..6d8077f 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -307,8 +307,8 @@ private: cmCTestSVN* SVN; cmCTestSVN::SVNInfo& SVNRepo; - typedef cmCTestSVN::Revision Revision; - typedef cmCTestSVN::Change Change; + using Revision = cmCTestSVN::Revision; + using Change = cmCTestSVN::Change; Revision Rev; std::vector Changes; Change CurChange; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index a178b44..f215911 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -26,7 +26,7 @@ #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120 -typedef std::vector cmCTestSubmitHandlerVectorOfChar; +using cmCTestSubmitHandlerVectorOfChar = std::vector; class cmCTestSubmitHandler::ResponseParser : public cmXMLParser { diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b90209e..2b5a406 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -939,9 +939,9 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const // Prepare some maps to help us find setup and cleanup tests for // any given fixture - typedef ListOfTests::const_iterator TestIterator; + using TestIterator = ListOfTests::const_iterator; typedef std::multimap FixtureDependencies; - typedef FixtureDependencies::const_iterator FixtureDepsIterator; + using FixtureDepsIterator = FixtureDependencies::const_iterator; FixtureDependencies fixtureSetups; FixtureDependencies fixtureCleanups; diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index b74decb..191100c 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -13,8 +13,8 @@ class cmParseBlanketJSCoverage::JSONParser { public: - typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector - FileLinesType; + using FileLinesType = + cmCTestCoverageHandlerContainer::SingleFileCoverageVector; JSONParser(cmCTestCoverageHandlerContainer& cont) : Coverage(cont) { diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index e0186c9..e4f353b 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -142,8 +142,8 @@ private: bool InSource = false; bool SkipThisClass = false; std::vector FilePaths; - typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector - FileLinesType; + using FileLinesType = + cmCTestCoverageHandlerContainer::SingleFileCoverageVector; cmCTest* CTest; cmCTestCoverageHandlerContainer& Coverage; std::string CurFileName; diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 9eda6f8..e8a184a 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -12,8 +12,8 @@ class cmParseDelphiCoverage::HTMLParser { public: - typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector - FileLinesType; + using FileLinesType = + cmCTestCoverageHandlerContainer::SingleFileCoverageVector; HTMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont) : CTest(ctest) , Coverage(cont) diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 374acad..6a2d0cc 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -133,8 +133,8 @@ private: std::string FilePath; std::string PackagePath; std::string PackageName; - typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector - FileLinesType; + using FileLinesType = + cmCTestCoverageHandlerContainer::SingleFileCoverageVector; cmCTest* CTest; cmCTestCoverageHandlerContainer& Coverage; }; diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx index 09b0298..fa5e4b9 100644 --- a/Source/cmAffinity.cxx +++ b/Source/cmAffinity.cxx @@ -20,7 +20,7 @@ # include # endif # if defined(__linux__) -typedef cpu_set_t cm_cpuset_t; +using cm_cpuset_t = cpu_set_t; # else typedef cpuset_t cm_cpuset_t; # endif diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 59aa86f..6775f9d 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -115,7 +115,7 @@ FwdIt RemoveN(FwdIt i1, FwdIt i2, size_t n) template struct BinarySearcher { - typedef typename Range::value_type argument_type; + using argument_type = typename Range::value_type; BinarySearcher(Range const& r) : m_range(r) { @@ -132,8 +132,8 @@ private: } class cmListFileBacktrace; -typedef cmRange::const_iterator> - cmBacktraceRange; +using cmBacktraceRange = + cmRange::const_iterator>; template void cmDeleteAll(Range const& r) diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a063fd9..a6c25e1 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -333,7 +333,7 @@ bool cmArchiveWrite::AddData(const char* file, size_t size) char buffer[16384]; size_t nleft = size; while (nleft > 0) { - typedef std::streamsize ssize_type; + using ssize_type = std::streamsize; size_t const nnext = nleft > sizeof(buffer) ? sizeof(buffer) : nleft; ssize_type const nnext_s = static_cast(nnext); fin.read(buffer, nnext_s); diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b20f595..e814d67 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -490,9 +490,9 @@ class cmCPluginAPISourceFileMap : public std::map { public: - typedef std::map derived; - typedef derived::iterator iterator; - typedef derived::value_type value_type; + using derived = std::map; + using iterator = derived::iterator; + using value_type = derived::value_type; cmCPluginAPISourceFileMap() = default; ~cmCPluginAPISourceFileMap() { diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 7fe3455..41dac85 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -41,7 +41,7 @@ class cmXMLWriter; class cmCTest { public: - typedef cmProcessOutput::Encoding Encoding; + using Encoding = cmProcessOutput::Encoding; /** Enumerate parts of the testing and submission process. */ enum Part { diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index 8cd4fe7..5493769 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -24,9 +24,9 @@ class cmComputeComponentGraph { public: // Represent the graph with an adjacency list. - typedef cmGraphNodeList NodeList; - typedef cmGraphEdgeList EdgeList; - typedef cmGraphAdjacencyList Graph; + using NodeList = cmGraphNodeList; + using EdgeList = cmGraphEdgeList; + using Graph = cmGraphAdjacencyList; cmComputeComponentGraph(Graph const& input); ~cmComputeComponentGraph(); diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 839c27a..f0ac771 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -44,7 +44,7 @@ public: bool IsFlag = false; }; - typedef std::vector EntryVector; + using EntryVector = std::vector; EntryVector const& Compute(); void SetOldLinkDirMode(bool b); @@ -111,9 +111,9 @@ private: void InferDependencies(); // Ordering constraint graph adjacency list. - typedef cmGraphNodeList NodeList; - typedef cmGraphEdgeList EdgeList; - typedef cmGraphAdjacencyList Graph; + using NodeList = cmGraphNodeList; + using EdgeList = cmGraphEdgeList; + using Graph = cmGraphAdjacencyList; Graph EntryConstraintGraph; void CleanConstraintGraph(); void DisplayConstraintGraph(); diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 784d3fa..0f71381 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -42,7 +42,7 @@ public: bool IsPath = true; cmGeneratorTarget const* Target = nullptr; }; - typedef std::vector ItemVector; + using ItemVector = std::vector; ItemVector const& GetItems() const; std::vector const& GetDirectories() const; std::vector const& GetDepends() const; diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index 3840bd7..6087574 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -70,9 +70,9 @@ private: // Represent the target dependency graph. The entry at each // top-level index corresponds to a depender whose dependencies are // listed. - typedef cmGraphNodeList NodeList; - typedef cmGraphEdgeList EdgeList; - typedef cmGraphAdjacencyList Graph; + using NodeList = cmGraphNodeList; + using EdgeList = cmGraphEdgeList; + using Graph = cmGraphAdjacencyList; Graph InitialGraph; Graph FinalGraph; void DisplayGraph(Graph const& graph, const std::string& name); diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 59e1396..082534c 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -19,7 +19,7 @@ class cmMakefile; class cmConditionEvaluator { public: - typedef std::list cmArgumentList; + using cmArgumentList = std::list; cmConditionEvaluator(cmMakefile& makefile, cmListFileContext context, cmListFileBacktrace bt); diff --git a/Source/cmCustomCommandLines.h b/Source/cmCustomCommandLines.h index 36838f2..35a15ba 100644 --- a/Source/cmCustomCommandLines.h +++ b/Source/cmCustomCommandLines.h @@ -12,18 +12,18 @@ class cmCustomCommandLine : public std::vector { public: - typedef std::vector Superclass; - typedef Superclass::iterator iterator; - typedef Superclass::const_iterator const_iterator; + using Superclass = std::vector; + using iterator = Superclass::iterator; + using const_iterator = Superclass::const_iterator; }; /** Data structure to represent a list of command lines. */ class cmCustomCommandLines : public std::vector { public: - typedef std::vector Superclass; - typedef Superclass::iterator iterator; - typedef Superclass::const_iterator const_iterator; + using Superclass = std::vector; + using iterator = Superclass::iterator; + using const_iterator = Superclass::const_iterator; }; #endif diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index b4d6419..008821d 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -24,7 +24,7 @@ */ class cmDefinitions { - typedef cmLinkedTree::iterator StackIter; + using StackIter = cmLinkedTree::iterator; public: // -- Static member functions diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 6c77db9..8df9938 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -170,7 +170,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, } // Actually write dependencies to the streams. - typedef cmDependsFortranInternals::ObjectInfoMap ObjectInfoMap; + using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap; ObjectInfoMap const& objInfo = this->Internal->ObjectInfo; for (auto const& i : objInfo) { if (!this->WriteDependenciesReal(i.first, i.second, mod_dir, stamp_dir, @@ -222,7 +222,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, void cmDependsFortran::LocateModules() { // Collect the set of modules provided and required by all sources. - typedef cmDependsFortranInternals::ObjectInfoMap ObjectInfoMap; + using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap; ObjectInfoMap const& objInfo = this->Internal->ObjectInfo; for (auto const& infoI : objInfo) { cmFortranSourceInfo const& info = infoI.second; @@ -303,7 +303,7 @@ void cmDependsFortran::ConsiderModule(const std::string& name, const std::string& stampDir) { // Locate each required module. - typedef cmDependsFortranInternals::TargetRequiresMap TargetRequiresMap; + using TargetRequiresMap = cmDependsFortranInternals::TargetRequiresMap; TargetRequiresMap::iterator required = this->Internal->TargetRequires.find(name); if (required != this->Internal->TargetRequires.end() && @@ -321,7 +321,7 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj, std::ostream& makeDepends, std::ostream& internalDepends) { - typedef cmDependsFortranInternals::TargetRequiresMap TargetRequiresMap; + using TargetRequiresMap = cmDependsFortranInternals::TargetRequiresMap; // Get the source file for this object. std::string const& src = info.Source; diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 096016d..425f1a8 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -102,7 +102,7 @@ void cmELFByteSwap(T& x) class cmELFInternal { public: - typedef cmELF::StringEntry StringEntry; + using StringEntry = cmELF::StringEntry; enum ByteOrderType { ByteOrderMSB, @@ -200,11 +200,11 @@ protected: // Configure the implementation template for 32-bit ELF files. struct cmELFTypes32 { - typedef Elf32_Ehdr ELF_Ehdr; - typedef Elf32_Shdr ELF_Shdr; - typedef Elf32_Dyn ELF_Dyn; - typedef Elf32_Half ELF_Half; - typedef KWIML_INT_uint32_t tagtype; + using ELF_Ehdr = Elf32_Ehdr; + using ELF_Shdr = Elf32_Shdr; + using ELF_Dyn = Elf32_Dyn; + using ELF_Half = Elf32_Half; + using tagtype = ::uint32_t; static const char* GetName() { return "32-bit"; } }; @@ -212,11 +212,11 @@ struct cmELFTypes32 #ifndef _SCO_DS struct cmELFTypes64 { - typedef Elf64_Ehdr ELF_Ehdr; - typedef Elf64_Shdr ELF_Shdr; - typedef Elf64_Dyn ELF_Dyn; - typedef Elf64_Half ELF_Half; - typedef KWIML_INT_uint64_t tagtype; + using ELF_Ehdr = Elf64_Ehdr; + using ELF_Shdr = Elf64_Shdr; + using ELF_Dyn = Elf64_Dyn; + using ELF_Half = Elf64_Half; + using tagtype = ::uint64_t; static const char* GetName() { return "64-bit"; } }; #endif @@ -227,11 +227,11 @@ class cmELFInternalImpl : public cmELFInternal { public: // Copy the ELF file format types from our configuration parameter. - typedef typename Types::ELF_Ehdr ELF_Ehdr; - typedef typename Types::ELF_Shdr ELF_Shdr; - typedef typename Types::ELF_Dyn ELF_Dyn; - typedef typename Types::ELF_Half ELF_Half; - typedef typename Types::tagtype tagtype; + using ELF_Ehdr = typename Types::ELF_Ehdr; + using ELF_Shdr = typename Types::ELF_Shdr; + using ELF_Dyn = typename Types::ELF_Dyn; + using ELF_Half = typename Types::ELF_Half; + using tagtype = typename Types::tagtype; // Construct with a stream and byte swap indicator. cmELFInternalImpl(cmELF* external, std::unique_ptr fin, diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 7f41640..74e9c55 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -11,7 +11,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -typedef cmProcessOutput::Encoding Encoding; +using Encoding = cmProcessOutput::Encoding; namespace { bool RunCommand(std::string command, std::string& output, int& retVal, diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 5589537..36a7dc3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1421,7 +1421,7 @@ bool HandleNativePathCommand(std::vector const& args, #if !defined(CMAKE_BOOTSTRAP) // Stuff for curl download/upload -typedef std::vector cmFileCommandVectorOfChar; +using cmFileCommandVectorOfChar = std::vector; size_t cmWriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data) { diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index 41203ba..dae68dd 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -72,17 +72,17 @@ private: bool IsAlreadyLocked(const std::string& filename) const; private: - typedef std::vector List; - typedef List::iterator It; - typedef List::const_iterator CIt; + using List = std::vector; + using It = List::iterator; + using CIt = List::const_iterator; List Locks; }; - typedef std::vector List; + using List = std::vector; - typedef List::iterator It; - typedef List::const_iterator CIt; + using It = List::iterator; + using CIt = List::const_iterator; List FunctionScopes; List FileScopes; diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 8b4929a..c452814 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -21,7 +21,7 @@ public: #if defined(_WIN32) typedef DWORD Error; #else - typedef int Error; + using Error = int; #endif /** diff --git a/Source/cmFileTime.h b/Source/cmFileTime.h index d4de4e0..e9a8559 100644 --- a/Source/cmFileTime.h +++ b/Source/cmFileTime.h @@ -14,7 +14,7 @@ class cmFileTime { public: - typedef long long NSC; + using NSC = long long; static constexpr NSC NsPerS = 1000000000; cmFileTime() = default; diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 924a14e..92c64c8 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -191,7 +191,7 @@ struct cmFindLibraryHelper std::string SuffixRegexStr; // Keep track of the best library file found so far. - typedef std::vector::size_type size_type; + using size_type = std::vector::size_type; std::string BestPath; // Support for OpenBSD shared library naming: lib.so.. diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index f6645ae..d57b38a 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -235,8 +235,8 @@ namespace std { template <> struct hash { - typedef cmFindPackageCommand::ConfigFileInfo argument_type; - typedef size_t result_type; + using argument_type = cmFindPackageCommand::ConfigFileInfo; + using result_type = size_t; result_type operator()(argument_type const& s) const noexcept { diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index 6a33be5..825876c 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -15,7 +15,7 @@ #include /* size_t */ /* Forward declare parser object type. */ -typedef struct cmFortranParser_s cmFortranParser; +using cmFortranParser = struct cmFortranParser_s; /* Functions to enter/exit #include'd files in order. */ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname); diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index 5b1eb51..3d94cdc 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -72,8 +72,8 @@ class cmGeneratedFileStream , public cmsys::ofstream { public: - typedef cmsys::ofstream Stream; - typedef codecvt::Encoding Encoding; + using Stream = cmsys::ofstream; + using Encoding = codecvt::Encoding; /** * This constructor prepares a default stream. The open method must diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index 304378d..e7effca 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -174,8 +174,8 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression( if (!parameters.empty()) { extendText(result, colonToken); - typedef std::vector EvaluatorVector; - typedef std::vector TokenVector; + using EvaluatorVector = std::vector; + using TokenVector = std::vector; std::vector::const_iterator pit = parameters.begin(); const std::vector::const_iterator pend = parameters.end(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8896e15..48ffcec 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2602,7 +2602,7 @@ private: cmMakefile* Makefile; cmLocalGenerator* LocalGenerator; cmGlobalGenerator const* GlobalGenerator; - typedef cmGeneratorTarget::SourceEntry SourceEntry; + using SourceEntry = cmGeneratorTarget::SourceEntry; SourceEntry* CurrentEntry; std::queue SourceQueue; std::set SourcesQueued; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 830974d..36e5d0e 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -376,7 +376,7 @@ public: virtual std::string GetEditCacheCommand() const { return ""; } // Class to track a set of dependencies. - typedef cmTargetDependSet TargetDependSet; + using TargetDependSet = cmTargetDependSet; // what targets does the specified target depend on directly // via a target_link_libraries or add_dependencies @@ -476,7 +476,7 @@ public: int RecursionDepth; protected: - typedef std::vector GeneratorVector; + using GeneratorVector = std::vector; // for a project collect all its targets by following depend // information, and also collect all the targets void GetTargetSets(TargetDependSet& projectTargets, diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index 98358c7..9b5bf63 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -153,7 +153,7 @@ class cmGlobalGhsMultiGenerator::OrderedTargetDependSet derived; public: - typedef cmGlobalGenerator::TargetDependSet TargetDependSet; + using TargetDependSet = cmGlobalGenerator::TargetDependSet; OrderedTargetDependSet(TargetDependSet const&, std::string const& first); }; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 26ceedd..b355775 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -3,6 +3,7 @@ #include "cmGlobalVisualStudio7Generator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index f4c47ce..5e60108 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -4,6 +4,7 @@ #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 9ccad63..3097bec 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -74,9 +74,9 @@ protected: void GenerateScriptForConfigObjectLibrary(std::ostream& os, const std::string& config, Indent indent); - typedef void (cmInstallTargetGenerator::*TweakMethod)(std::ostream&, Indent, - const std::string&, - std::string const&); + using TweakMethod = void (cmInstallTargetGenerator::*)(std::ostream&, Indent, + const std::string&, + const std::string&); void AddTweak(std::ostream& os, Indent indent, const std::string& config, std::string const& file, TweakMethod tweak); void AddTweak(std::ostream& os, Indent indent, const std::string& config, diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index 1e6c385..11f6efb 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -3,6 +3,7 @@ #include "cmInstalledFile.h" #include "cmAlgorithms.h" +#include "cmGeneratorExpression.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmStringAlgorithms.h" diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index eb827be..e00e666 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -5,13 +5,12 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmGeneratorExpression.h" - #include #include #include #include +class cmCompiledGeneratorExpression; class cmMakefile; /** \class cmInstalledFile @@ -22,10 +21,10 @@ class cmMakefile; class cmInstalledFile { public: - typedef std::unique_ptr - CompiledGeneratorExpressionPtrType; + using CompiledGeneratorExpressionPtrType = + std::unique_ptr; - typedef std::vector ExpressionVectorType; + using ExpressionVectorType = std::vector; struct Property { diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 5e3c790..91c551f 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -56,7 +56,7 @@ std::string cmLinkLineComputer::ConvertToLinkReference( std::string cmLinkLineComputer::ComputeLinkLibs(cmComputeLinkInformation& cli) { std::string linkLibs; - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; ItemVector const& items = cli.GetItems(); for (auto const& item : items) { if (item.Target && diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index 96af388..9c0e20f 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -51,7 +51,7 @@ bool cmLinkLineDeviceComputer::ComputeRequiresDeviceLinking( { // Determine if this item might requires device linking. // For this we only consider targets - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; ItemVector const& items = cli.GetItems(); std::string config = cli.GetConfig(); for (auto const& item : items) { @@ -78,7 +78,7 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries( // with device symbols only needs to be listed once as it doesn't // care about link order. std::set emitted; - typedef cmComputeLinkInformation::ItemVector ItemVector; + using ItemVector = cmComputeLinkInformation::ItemVector; ItemVector const& items = cli.GetItems(); std::string config = cli.GetConfig(); bool skipItemAfterFramework = false; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 099fb6d..8b91162 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -27,9 +27,9 @@ template class cmLinkedTree { - typedef typename std::vector::size_type PositionType; - typedef T* PointerType; - typedef T& ReferenceType; + using PositionType = typename std::vector::size_type; + using PointerType = T*; + using ReferenceType = T&; public: class iterator diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index d2c051e..57eeedb 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -1080,7 +1080,7 @@ public: }; protected: - typedef std::string (*StringFilter)(const std::string& in); + using StringFilter = std::string (*)(const std::string&); StringFilter GetCompareFilter(Compare compare) { return (compare == Compare::FILE_BASENAME) ? cmSystemTools::GetFilenameName diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index df1a5bd..f0145c5 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -323,7 +323,7 @@ void cmLocalGenerator::GenerateTestFiles() tester->Compute(this); tester->Generate(fout, config, configurationTypes); } - typedef std::vector vec_t; + using vec_t = std::vector; vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren(); std::string parentBinDir = this->GetCurrentBinaryDirectory(); for (cmStateSnapshot const& i : children) { diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f88c3e9..357ccc8 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -4,6 +4,7 @@ #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalVisualStudio7Generator.h" #include "cmMakefile.h" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4b26ec6..dfe0086 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4321,7 +4321,7 @@ bool cmMakefile::HasCMP0054AlreadyBeenReported( void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm) { /* Record the setting of every policy. */ - typedef cmPolicies::PolicyID PolicyID; + using PolicyID = cmPolicies::PolicyID; for (PolicyID pid = cmPolicies::CMP0000; pid != cmPolicies::CMPCOUNT; pid = PolicyID(pid + 1)) { pm.Set(pid, this->GetPolicyStatus(pid)); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 6b9fa6b..09f53c9 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -385,7 +385,7 @@ public: } // -- List of targets - typedef std::unordered_map cmTargetMap; + using cmTargetMap = std::unordered_map; /** Get the target map */ cmTargetMap& GetTargets() { return this->Targets; } /** Get the target map - const version */ @@ -914,7 +914,7 @@ protected: mutable cmTargetMap Targets; std::map AliasTargets; - typedef std::vector SourceFileVec; + using SourceFileVec = std::vector; SourceFileVec SourceFiles; // Because cmSourceFile names are compared in a fuzzy way (see @@ -923,7 +923,7 @@ protected: // Name portion of the cmSourceFileLocation and then compare on the list of // cmSourceFiles that might match that name. Note that on platforms which // have a case-insensitive filesystem we store the key in all lowercase. - typedef std::unordered_map SourceFileMap; + using SourceFileMap = std::unordered_map; SourceFileMap SourceFileSearchIndex; // For "Known" paths we can store a direct filename to cmSourceFile map @@ -997,7 +997,7 @@ private: friend class cmParseFileScope; std::vector ImportedTargetsOwned; - typedef std::unordered_map TargetMap; + using TargetMap = std::unordered_map; TargetMap ImportedTargets; // Internal policy stack management. @@ -1039,7 +1039,7 @@ private: cmSourceFile* LinearGetSourceFileWithOutput(const std::string& cname) const; // A map for fast output to input look up. - typedef std::unordered_map OutputToSourceMap; + using OutputToSourceMap = std::unordered_map; OutputToSourceMap OutputToSource; void UpdateOutputToSourceMap(std::vector const& outputs, diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index 52c05b6..89afbbd 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -17,8 +17,8 @@ enum cmNinjaTargetDepends DependOnTargetOrdering }; -typedef std::vector cmNinjaDeps; -typedef std::set cmNinjaOuts; +using cmNinjaDeps = std::vector; +using cmNinjaOuts = std::set; typedef std::map cmNinjaVars; class cmNinjaRule diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 187f0ab..1a854dc 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -36,7 +36,7 @@ public: /** * The set of files on which this one depends. */ - typedef std::set DependencySetType; + using DependencySetType = std::set; DependencySetType DependencySet; /** diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index aad9f74..a4dd70d 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -37,10 +37,10 @@ static std::string JoinList(std::vector const& arg, bool escape) namespace { -typedef std::map options_map; -typedef std::map single_map; -typedef std::map> multi_map; -typedef std::set options_set; +using options_map = std::map; +using single_map = std::map; +using multi_map = std::map>; +using options_set = std::set; struct UserArgumentParser : public cmArgumentParser { diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index 7616316..c205a8f 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -17,7 +17,7 @@ class cmProcessTools { public: - typedef cmProcessOutput::Encoding Encoding; + using Encoding = cmProcessOutput::Encoding; /** Abstract interface for process output parsers. */ class OutputParser { diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx index d890f8e..83df335 100644 --- a/Source/cmQtAutoGen.cxx +++ b/Source/cmQtAutoGen.cxx @@ -24,8 +24,8 @@ void MergeOptions(std::vector& baseOpts, std::vector const& newOpts, std::initializer_list valueOpts, bool isQt5) { - typedef std::vector::iterator Iter; - typedef std::vector::const_iterator CIter; + using Iter = std::vector::iterator; + using CIter = std::vector::const_iterator; if (newOpts.empty()) { return; } diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h index 939ceb3..fb15586 100644 --- a/Source/cmQtAutoGen.h +++ b/Source/cmQtAutoGen.h @@ -50,7 +50,7 @@ public: std::string HelpOutput; std::vector ListOptions; }; - typedef std::shared_ptr CompilerFeaturesHandle; + using CompilerFeaturesHandle = std::shared_ptr; /// @brief AutoGen generator type enum class GenT diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index 65666a6..84a27e4 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -55,7 +55,7 @@ public: bool MocIt = false; bool UicIt = false; }; - typedef std::unique_ptr MUFileHandle; + using MUFileHandle = std::unique_ptr; /// @brief Abstract moc/uic/rcc generator variables base class struct GenVarsT diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 3bcc1c9..80b8741 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -169,7 +169,7 @@ bool cmQtAutoGenerator::FileRead(std::string& content, return false; } content.reserve(length); - typedef std::istreambuf_iterator IsIt; + using IsIt = std::istreambuf_iterator; content.assign(IsIt{ ifs }, IsIt{}); if (!ifs) { content.clear(); diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h index f676c57..076e460 100644 --- a/Source/cmQtAutoMocUic.h +++ b/Source/cmQtAutoMocUic.h @@ -106,7 +106,7 @@ public: std::vector Depends; } Uic; }; - typedef std::shared_ptr FileHandleT; + using FileHandleT = std::shared_ptr; typedef std::pair GetOrInsertT; public: @@ -146,7 +146,7 @@ public: bool Moc = false; bool Uic = false; }; - typedef std::shared_ptr SourceFileHandleT; + using SourceFileHandleT = std::shared_ptr; typedef std::map SourceFileMapT; /** @@ -159,7 +159,7 @@ public: std::string IncludeString; std::vector IncluderFiles; }; - typedef std::shared_ptr MappingHandleT; + using MappingHandleT = std::shared_ptr; typedef std::map MappingMapT; /** diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index e334d5b..eee331f 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -56,7 +56,7 @@ public: std::vector const& configurationTypes); protected: - typedef cmScriptGeneratorIndent Indent; + using Indent = cmScriptGeneratorIndent; virtual void GenerateScript(std::ostream& os); virtual void GenerateScriptConfigs(std::ostream& os, Indent indent); virtual void GenerateScriptActions(std::ostream& os, Indent indent); diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index eec4ec0..45438a9 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -41,7 +41,7 @@ public: private: typedef std::map> ParsedArguments; - typedef std::vector ExpectedOptions; + using ExpectedOptions = std::vector; ExpectedOptions getExpectedOptions() const; diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index ec0ed6c..4efaf97 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -48,7 +48,7 @@ struct cmStateDetail::SnapshotDataType struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap { - typedef cmPolicies::PolicyMap derived; + using derived = cmPolicies::PolicyMap; PolicyStackEntry(bool w = false) : Weak(w) { diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h index 7d6158e..d089ea7 100644 --- a/Source/cmStateTypes.h +++ b/Source/cmStateTypes.h @@ -10,7 +10,7 @@ namespace cmStateDetail { struct SnapshotDataType; -typedef cmLinkedTree::iterator PositionType; +using PositionType = cmLinkedTree::iterator; } namespace cmStateEnums { diff --git a/Source/cmString.hxx b/Source/cmString.hxx index 226ac67..050a2fd 100644 --- a/Source/cmString.hxx +++ b/Source/cmString.hxx @@ -714,7 +714,7 @@ template struct StringAdd { static const bool value = AsStringView::value; - typedef string_view temp_type; + using temp_type = string_view; template static temp_type temp(S&& s) { @@ -802,8 +802,8 @@ namespace std { template <> struct hash { - typedef cm::String argument_type; - typedef size_t result_type; + using argument_type = cm::String; + using result_type = size_t; result_type operator()(argument_type const& s) const noexcept { diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h index 5b8b878..7f442d8 100644 --- a/Source/cmStringAlgorithms.h +++ b/Source/cmStringAlgorithms.h @@ -16,7 +16,7 @@ #include /** String range type. */ -typedef cmRange::const_iterator> cmStringRange; +using cmStringRange = cmRange::const_iterator>; /** Callable string comparison struct. */ struct cmStrCmp diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 953a358..863db3f 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -25,8 +25,8 @@ class cmSystemTools : public cmsys::SystemTools { public: - typedef cmsys::SystemTools Superclass; - typedef cmProcessOutput::Encoding Encoding; + using Superclass = cmsys::SystemTools; + using Encoding = cmProcessOutput::Encoding; /** * Look for and replace registry values in a string diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 783c278..fa420af 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -108,7 +108,7 @@ public: //! how we identify a library, by name and type typedef std::pair LibraryID; - typedef std::vector LinkLibraryVectorType; + using LinkLibraryVectorType = std::vector; LinkLibraryVectorType const& GetOriginalLinkLibraries() const; //! Clear the dependency information recorded for this target, if any. diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h index c09e4bf..3083b60 100644 --- a/Source/cmUVHandlePtr.h +++ b/Source/cmUVHandlePtr.h @@ -240,8 +240,8 @@ struct uv_tty_ptr : public uv_handle_ptr_ int init(uv_loop_t& loop, int fd, int readable, void* data = nullptr); }; -typedef uv_handle_ptr_ uv_stream_ptr; -typedef uv_handle_ptr_ uv_handle_ptr; +using uv_stream_ptr = uv_handle_ptr_; +using uv_handle_ptr = uv_handle_ptr_; #ifndef cmUVHandlePtr_cxx diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 0dc6ca7..91c8af3 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -53,7 +53,7 @@ void cmUuid::CreateHashInput(std::vector const& uuidNamespace, std::string cmUuid::FromDigest(const unsigned char* digest, unsigned char version) const { - typedef unsigned char byte_t; + using byte_t = unsigned char; byte_t uuid[16] = { 0 }; memcpy(uuid, digest, 16); diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index acac2c1..32445d5 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -20,10 +20,9 @@ class cmMakefile; class cmVariableWatch { public: - typedef void (*WatchMethod)(const std::string& variable, int access_type, - void* client_data, const char* newValue, - const cmMakefile* mf); - typedef void (*DeleteData)(void* client_data); + using WatchMethod = void (*)(const std::string&, int, void*, const char*, + const cmMakefile*); + using DeleteData = void (*)(void*); cmVariableWatch(); ~cmVariableWatch(); @@ -77,7 +76,7 @@ protected: Pair& operator=(const Pair&) = delete; }; - typedef std::vector> VectorOfPairs; + using VectorOfPairs = std::vector>; typedef std::map StringToVectorOfPairs; StringToVectorOfPairs WatchMap; diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx index baf326a..2e4d00b 100644 --- a/Source/cmWorkerPool.cxx +++ b/Source/cmWorkerPool.cxx @@ -25,10 +25,10 @@ class cmUVPipeBuffer { public: - typedef cmRange DataRange; - typedef std::function DataFunction; + using DataRange = cmRange; + using DataFunction = std::function; /// On error the ssize_t argument is a non zero libuv error code - typedef std::function EndFunction; + using EndFunction = std::function; public: /** diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index d708118..b541ce3 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -126,7 +126,7 @@ public: /** * Job handle type */ - typedef std::unique_ptr JobHandleT; + using JobHandleT = std::unique_ptr; /** * Fence job base class diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h index 98ba049..1bc8d64 100644 --- a/Source/cmXMLParser.h +++ b/Source/cmXMLParser.h @@ -42,7 +42,7 @@ public: virtual int ParseChunk(const char* inputString, std::string::size_type length); virtual int CleanupParser(); - typedef void (*ReportFunction)(int, const char*, void*); + using ReportFunction = void (*)(int, const char*, void*); void SetErrorCallback(ReportFunction f, void* d) { this->ReportCallback = f; diff --git a/Source/cmake.h b/Source/cmake.h index 081e120..cc44b92 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -503,10 +503,10 @@ protected: void RunCheckForUnusedVariables(); int HandleDeleteCacheVariables(const std::string& var); - typedef std::vector RegisteredGeneratorsVector; + using RegisteredGeneratorsVector = std::vector; RegisteredGeneratorsVector Generators; - typedef std::vector - RegisteredExtraGeneratorsVector; + using RegisteredExtraGeneratorsVector = + std::vector; RegisteredExtraGeneratorsVector ExtraGenerators; void AddScriptingCommands(); void AddProjectCommands(); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 071eec9..a79a2ff 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -339,8 +339,8 @@ static int HandleCppCheck(const std::string& runCmd, return ret; } -typedef int (*CoCompileHandler)(const std::string&, const std::string&, - const std::vector&); +using CoCompileHandler = int (*)(const std::string&, const std::string&, + const std::vector&); struct CoCompiler { diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index b49803b..b1541e2 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -26,7 +26,7 @@ public: return emptyString; } }; - typedef std::vector TranslationUnitsType; + using TranslationUnitsType = std::vector; CompileCommandParser(std::istream& input) : Input(input) -- cgit v0.12