clang-tidy: Replace typedef with using

This commit is contained in:
Regina Pfeifer
2019-09-03 13:21:26 -04:00
committed by Brad King
parent 711e1c3ada
commit 62e5f72289
80 changed files with 164 additions and 162 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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
{
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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
{
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -13,8 +13,8 @@
class cmParseBlanketJSCoverage::JSONParser
{
public:
typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector
FileLinesType;
using FileLinesType =
cmCTestCoverageHandlerContainer::SingleFileCoverageVector;
JSONParser(cmCTestCoverageHandlerContainer& cont)
: Coverage(cont)
{
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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;
};
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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()
{
+1 -1
View File
@@ -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
{
+3 -3
View File
@@ -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();
+4 -4
View File
@@ -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();
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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);
+6 -6
View File
@@ -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
+1 -1
View File
@@ -24,7 +24,7 @@
*/
class cmDefinitions
{
typedef cmLinkedTree<cmDefinitions>::iterator StackIter;
using StackIter = cmLinkedTree<cmDefinitions>::iterator;
public:
// -- Static member functions
+4 -4
View File
@@ -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;
+16 -16
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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)
{
+6 -6
View File
@@ -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;
+1 -1
View File
@@ -21,7 +21,7 @@ public:
#if defined(_WIN32)
typedef DWORD Error;
#else
typedef int Error;
using Error = int;
#endif
/**
+1 -1
View File
@@ -14,7 +14,7 @@
class cmFileTime
{
public:
typedef long long NSC;
using NSC = long long;
static constexpr NSC NsPerS = 1000000000;
cmFileTime() = default;
+1 -1
View File
@@ -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>
+2 -2
View File
@@ -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
{
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -153,7 +153,7 @@ class cmGlobalGhsMultiGenerator::OrderedTargetDependSet
derived;
public:
typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
using TargetDependSet = cmGlobalGenerator::TargetDependSet;
OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
};
@@ -3,6 +3,7 @@
#include "cmGlobalVisualStudio7Generator.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
@@ -4,6 +4,7 @@
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
+3 -3
View File
@@ -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,
+1
View File
@@ -3,6 +3,7 @@
#include "cmInstalledFile.h"
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
+4 -5
View File
@@ -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
{
+1 -1
View File
@@ -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 &&
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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) {
+1
View File
@@ -4,6 +4,7 @@
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalVisualStudio7Generator.h"
#include "cmMakefile.h"
+1 -1
View File
@@ -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));
+5 -5
View File
@@ -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,
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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;
/**
+4 -4
View File
@@ -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>
{
+1 -1
View File
@@ -17,7 +17,7 @@
class cmProcessTools
{
public:
typedef cmProcessOutput::Encoding Encoding;
using Encoding = cmProcessOutput::Encoding;
/** Abstract interface for process output parsers. */
class OutputParser
{
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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();
+3 -3
View File
@@ -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;
/**
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -10,7 +10,7 @@
namespace cmStateDetail {
struct SnapshotDataType;
typedef cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator PositionType;
using PositionType = cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator;
}
namespace cmStateEnums {
+3 -3
View File
@@ -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
{
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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);
+4 -5
View File
@@ -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;
+3 -3
View File
@@ -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:
/**
+1 -1
View File
@@ -126,7 +126,7 @@ public:
/**
* Job handle type
*/
typedef std::unique_ptr<JobT> JobHandleT;
using JobHandleT = std::unique_ptr<JobT>;
/**
* Fence job base class
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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();
+2 -2
View File
@@ -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
{
+1 -1
View File
@@ -26,7 +26,7 @@ public:
return emptyString;
}
};
typedef std::vector<CommandType> TranslationUnitsType;
using TranslationUnitsType = std::vector<CommandType>;
CompileCommandParser(std::istream& input)
: Input(input)