diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-08-23 21:25:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-03 17:21:26 (GMT) |
commit | 62e5f722899cfa7c51791be7697c9030aee3a19b (patch) | |
tree | afbde974693e3473db968a5b4a50fe9126e71d14 /Source | |
parent | 711e1c3ada26d952fa6360e671379b7bf1be2f17 (diff) | |
download | CMake-62e5f722899cfa7c51791be7697c9030aee3a19b.zip CMake-62e5f722899cfa7c51791be7697c9030aee3a19b.tar.gz CMake-62e5f722899cfa7c51791be7697c9030aee3a19b.tar.bz2 |
clang-tidy: Replace typedef with using
Diffstat (limited to 'Source')
79 files changed, 163 insertions, 161 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<std::string> VList; + using VList = std::vector<std::string>; 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<Change> 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<Revision>& 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<Change> 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<Change> 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<Change> 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<Change> 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<char> cmCTestSubmitHandlerVectorOfChar; +using cmCTestSubmitHandlerVectorOfChar = std::vector<char>; 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<std::string, TestIterator> 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<std::string> 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 <sys/param.h> # 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 <typename Range> 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<std::vector<cmListFileBacktrace>::const_iterator> - cmBacktraceRange; +using cmBacktraceRange = + cmRange<std::vector<cmListFileBacktrace>::const_iterator>; template <typename Range> 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<ssize_type>(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<cmSourceFile*, cmCPluginAPISourceFile*> { public: - typedef std::map<cmSourceFile*, cmCPluginAPISourceFile*> derived; - typedef derived::iterator iterator; - typedef derived::value_type value_type; + using derived = std::map<cmSourceFile*, cmCPluginAPISourceFile*>; + 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<LinkEntry> EntryVector; + using EntryVector = std::vector<LinkEntry>; 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<Item> ItemVector; + using ItemVector = std::vector<Item>; ItemVector const& GetItems() const; std::vector<std::string> const& GetDirectories() const; std::vector<std::string> 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<cmExpandedCommandArgument> cmArgumentList; + using cmArgumentList = std::list<cmExpandedCommandArgument>; 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<std::string> { public: - typedef std::vector<std::string> Superclass; - typedef Superclass::iterator iterator; - typedef Superclass::const_iterator const_iterator; + using Superclass = std::vector<std::string>; + using iterator = Superclass::iterator; + using const_iterator = Superclass::const_iterator; }; /** Data structure to represent a list of command lines. */ class cmCustomCommandLines : public std::vector<cmCustomCommandLine> { public: - typedef std::vector<cmCustomCommandLine> Superclass; - typedef Superclass::iterator iterator; - typedef Superclass::const_iterator const_iterator; + using Superclass = std::vector<cmCustomCommandLine>; + 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<cmDefinitions>::iterator StackIter; + using StackIter = cmLinkedTree<cmDefinitions>::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<std::istream> 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<std::string> const& args, #if !defined(CMAKE_BOOTSTRAP) // Stuff for curl download/upload -typedef std::vector<char> cmFileCommandVectorOfChar; +using cmFileCommandVectorOfChar = std::vector<char>; 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<cmFileLock*> List; - typedef List::iterator It; - typedef List::const_iterator CIt; + using List = std::vector<cmFileLock*>; + using It = List::iterator; + using CIt = List::const_iterator; List Locks; }; - typedef std::vector<ScopePool*> List; + using List = std::vector<ScopePool*>; - 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<std::string>::size_type size_type; + using size_type = std::vector<std::string>::size_type; std::string BestPath; // Support for OpenBSD shared library naming: lib<name>.so.<major>.<minor> 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<cmFindPackageCommand::ConfigFileInfo> { - 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 <stddef.h> /* 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<cmGeneratorExpressionEvaluator*> EvaluatorVector; - typedef std::vector<cmGeneratorExpressionToken> TokenVector; + using EvaluatorVector = std::vector<cmGeneratorExpressionEvaluator*>; + using TokenVector = std::vector<cmGeneratorExpressionToken>; std::vector<EvaluatorVector>::const_iterator pit = parameters.begin(); const std::vector<EvaluatorVector>::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<cmSourceFile*> SourceQueue; std::set<cmSourceFile*> 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<cmLocalGenerator*> GeneratorVector; + using GeneratorVector = std::vector<cmLocalGenerator*>; // 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 <map> #include <memory> #include <string> #include <vector> +class cmCompiledGeneratorExpression; class cmMakefile; /** \class cmInstalledFile @@ -22,10 +21,10 @@ class cmMakefile; class cmInstalledFile { public: - typedef std::unique_ptr<cmCompiledGeneratorExpression> - CompiledGeneratorExpressionPtrType; + using CompiledGeneratorExpressionPtrType = + std::unique_ptr<cmCompiledGeneratorExpression>; - typedef std::vector<cmCompiledGeneratorExpression*> ExpressionVectorType; + using ExpressionVectorType = std::vector<cmCompiledGeneratorExpression*>; 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<std::string> 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 <typename T> class cmLinkedTree { - typedef typename std::vector<T>::size_type PositionType; - typedef T* PointerType; - typedef T& ReferenceType; + using PositionType = typename std::vector<T>::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<cmStateSnapshot> vec_t; + using vec_t = std::vector<cmStateSnapshot>; 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<std::string, cmTarget> cmTargetMap; + using cmTargetMap = std::unordered_map<std::string, cmTarget>; /** 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<std::string, std::string> AliasTargets; - typedef std::vector<cmSourceFile*> SourceFileVec; + using SourceFileVec = std::vector<cmSourceFile*>; 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<std::string, SourceFileVec> SourceFileMap; + using SourceFileMap = std::unordered_map<std::string, SourceFileVec>; SourceFileMap SourceFileSearchIndex; // For "Known" paths we can store a direct filename to cmSourceFile map @@ -997,7 +997,7 @@ private: friend class cmParseFileScope; std::vector<cmTarget*> ImportedTargetsOwned; - typedef std::unordered_map<std::string, cmTarget*> TargetMap; + using TargetMap = std::unordered_map<std::string, cmTarget*>; 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<std::string, cmSourceFile*> OutputToSourceMap; + using OutputToSourceMap = std::unordered_map<std::string, cmSourceFile*>; OutputToSourceMap OutputToSource; void UpdateOutputToSourceMap(std::vector<std::string> 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<std::string> cmNinjaDeps; -typedef std::set<std::string> cmNinjaOuts; +using cmNinjaDeps = std::vector<std::string>; +using cmNinjaOuts = std::set<std::string>; typedef std::map<std::string, std::string> 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<cmDependInformation*> DependencySetType; + using DependencySetType = std::set<cmDependInformation*>; 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<std::string> const& arg, bool escape) namespace { -typedef std::map<std::string, bool> options_map; -typedef std::map<std::string, std::string> single_map; -typedef std::map<std::string, std::vector<std::string>> multi_map; -typedef std::set<std::string> options_set; +using options_map = std::map<std::string, bool>; +using single_map = std::map<std::string, std::string>; +using multi_map = std::map<std::string, std::vector<std::string>>; +using options_set = std::set<std::string>; struct UserArgumentParser : public cmArgumentParser<void> { 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<std::string>& baseOpts, std::vector<std::string> const& newOpts, std::initializer_list<cm::string_view> valueOpts, bool isQt5) { - typedef std::vector<std::string>::iterator Iter; - typedef std::vector<std::string>::const_iterator CIter; + using Iter = std::vector<std::string>::iterator; + using CIter = std::vector<std::string>::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<std::string> ListOptions; }; - typedef std::shared_ptr<CompilerFeatures> CompilerFeaturesHandle; + using CompilerFeaturesHandle = std::shared_ptr<CompilerFeatures>; /// @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<MUFile> MUFileHandle; + using MUFileHandle = std::unique_ptr<MUFile>; /// @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<char> IsIt; + using IsIt = std::istreambuf_iterator<char>; 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<std::string> Depends; } Uic; }; - typedef std::shared_ptr<FileT> FileHandleT; + using FileHandleT = std::shared_ptr<FileT>; typedef std::pair<FileHandleT, bool> GetOrInsertT; public: @@ -146,7 +146,7 @@ public: bool Moc = false; bool Uic = false; }; - typedef std::shared_ptr<SourceFileT> SourceFileHandleT; + using SourceFileHandleT = std::shared_ptr<SourceFileT>; typedef std::map<std::string, SourceFileHandleT> SourceFileMapT; /** @@ -159,7 +159,7 @@ public: std::string IncludeString; std::vector<SourceFileHandleT> IncluderFiles; }; - typedef std::shared_ptr<MappingT> MappingHandleT; + using MappingHandleT = std::shared_ptr<MappingT>; typedef std::map<std::string, MappingHandleT> 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<std::string> 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<std::string, std::vector<std::string>> ParsedArguments; - typedef std::vector<std::string> ExpectedOptions; + using ExpectedOptions = std::vector<std::string>; 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<cmStateDetail::SnapshotDataType>::iterator PositionType; +using PositionType = cmLinkedTree<cmStateDetail::SnapshotDataType>::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 <typename T> struct StringAdd { static const bool value = AsStringView<T>::value; - typedef string_view temp_type; + using temp_type = string_view; template <typename S> static temp_type temp(S&& s) { @@ -802,8 +802,8 @@ namespace std { template <> struct hash<cm::String> { - 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 <vector> /** String range type. */ -typedef cmRange<std::vector<std::string>::const_iterator> cmStringRange; +using cmStringRange = cmRange<std::vector<std::string>::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<std::string, cmTargetLinkLibraryType> LibraryID; - typedef std::vector<LibraryID> LinkLibraryVectorType; + using LinkLibraryVectorType = std::vector<LibraryID>; 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_<uv_tty_t> int init(uv_loop_t& loop, int fd, int readable, void* data = nullptr); }; -typedef uv_handle_ptr_<uv_stream_t> uv_stream_ptr; -typedef uv_handle_ptr_<uv_handle_t> uv_handle_ptr; +using uv_stream_ptr = uv_handle_ptr_<uv_stream_t>; +using uv_handle_ptr = uv_handle_ptr_<uv_handle_t>; #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<unsigned char> 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<std::shared_ptr<Pair>> VectorOfPairs; + using VectorOfPairs = std::vector<std::shared_ptr<Pair>>; typedef std::map<std::string, VectorOfPairs> 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<char const*> DataRange; - typedef std::function<void(DataRange)> DataFunction; + using DataRange = cmRange<const char*>; + using DataFunction = std::function<void(DataRange)>; /// On error the ssize_t argument is a non zero libuv error code - typedef std::function<void(ssize_t)> EndFunction; + using EndFunction = std::function<void(ssize_t)>; 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<JobT> JobHandleT; + using JobHandleT = std::unique_ptr<JobT>; /** * 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<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector; + using RegisteredGeneratorsVector = std::vector<cmGlobalGeneratorFactory*>; RegisteredGeneratorsVector Generators; - typedef std::vector<cmExternalMakefileProjectGeneratorFactory*> - RegisteredExtraGeneratorsVector; + using RegisteredExtraGeneratorsVector = + std::vector<cmExternalMakefileProjectGeneratorFactory*>; 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<std::string>&); +using CoCompileHandler = int (*)(const std::string&, const std::string&, + const std::vector<std::string>&); struct CoCompiler { |