Commit a1ddf2d0 authored by wahikihiki's avatar wahikihiki
Browse files

clang-tidy: Replace typedef with using

Automate the conversion with

  perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g'

then manually fix a few places.
parent ee15bc7d
......@@ -29,12 +29,12 @@ class cmCPackIFWGenerator
public:
cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
typedef std::map<std::string, cmCPackIFWPackage> PackagesMap;
typedef std::map<std::string, cmCPackIFWRepository> RepositoriesMap;
typedef std::map<std::string, cmCPackComponent> ComponentsMap;
typedef std::map<std::string, cmCPackComponentGroup> ComponentGoupsMap;
typedef std::map<std::string, cmCPackIFWPackage::DependenceStruct>
DependenceMap;
using PackagesMap = std::map<std::string, cmCPackIFWPackage>;
using RepositoriesMap = std::map<std::string, cmCPackIFWRepository>;
using ComponentsMap = std::map<std::string, cmCPackComponent>;
using ComponentGoupsMap = std::map<std::string, cmCPackComponentGroup>;
using DependenceMap =
std::map<std::string, cmCPackIFWPackage::DependenceStruct>;
using cmCPackIFWCommon::GetOption;
using cmCPackIFWCommon::IsOn;
......
......@@ -22,8 +22,8 @@ class cmCPackIFWInstaller : public cmCPackIFWCommon
public:
// Types
typedef std::map<std::string, cmCPackIFWPackage*> PackagesMap;
typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
using PackagesMap = std::map<std::string, cmCPackIFWPackage*>;
using RepositoriesVector = std::vector<cmCPackIFWRepository*>;
public:
// Constructor
......
......@@ -28,7 +28,7 @@ public:
Replace
};
typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
using RepositoriesVector = std::vector<cmCPackIFWRepository*>;
public:
// Constructor
......
......@@ -44,9 +44,9 @@ protected:
bool SupportsComponentInstallation() const override { return true; }
private:
typedef std::map<std::string, std::string> id_map_t;
typedef std::map<std::string, size_t> ambiguity_map_t;
typedef std::set<std::string> extension_set_t;
using id_map_t = std::map<std::string, std::string>;
using ambiguity_map_t = std::map<std::string, size_t>;
using extension_set_t = std::set<std::string>;
enum class DefinitionType
{
......
......@@ -36,8 +36,8 @@ struct cmWIXPatchElement : cmWIXPatchNode
~cmWIXPatchElement();
typedef std::vector<cmWIXPatchNode*> child_list_t;
typedef std::map<std::string, std::string> attributes_t;
using child_list_t = std::vector<cmWIXPatchNode*>;
using attributes_t = std::map<std::string, std::string>;
std::string name;
child_list_t children;
......@@ -50,7 +50,7 @@ struct cmWIXPatchElement : cmWIXPatchNode
class cmWIXPatchParser : public cmXMLParser
{
public:
typedef std::map<std::string, cmWIXPatchElement> fragment_map_t;
using fragment_map_t = std::map<std::string, cmWIXPatchElement>;
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
......
......@@ -25,7 +25,7 @@ cmWIXRichTextFormatWriter::~cmWIXRichTextFormatWriter()
void cmWIXRichTextFormatWriter::AddText(std::string const& text)
{
typedef unsigned char rtf_byte_t;
using rtf_byte_t = unsigned char;
for (size_t i = 0; i < text.size(); ++i) {
rtf_byte_t c = rtf_byte_t(text[i]);
......
......@@ -28,8 +28,8 @@ public:
STARTUP
};
typedef std::vector<cmWIXShortcut> shortcut_list_t;
typedef std::map<std::string, shortcut_list_t> shortcut_id_map_t;
using shortcut_list_t = std::vector<cmWIXShortcut>;
using shortcut_id_map_t = std::map<std::string, shortcut_list_t>;
void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
......@@ -46,7 +46,7 @@ public:
cmInstalledFile const& installedFile);
private:
typedef std::map<Type, shortcut_id_map_t> shortcut_type_map_t;
using shortcut_type_map_t = std::map<Type, shortcut_id_map_t>;
void CreateFromProperty(std::string const& propertyName, Type type,
std::string const& id,
......
......@@ -22,7 +22,7 @@ class cmCPackComponent;
class cmCPackArchiveGenerator : public cmCPackGenerator
{
public:
typedef cmCPackGenerator Superclass;
using Superclass = cmCPackGenerator;
/**
* Construct generator
......
......@@ -326,7 +326,7 @@ protected:
};
#define cmCPackTypeMacro(klass, superclass) \
typedef superclass Superclass; \
using Superclass = superclass; \
const char* GetNameOfClass() override { return #klass; } \
static cmCPackGenerator* CreateGenerator() { return new klass; } \
class cmCPackTypeMacro_UseTrailingSemicolon
......
......@@ -29,7 +29,7 @@ public:
cmCPackGenerator* NewGenerator(const std::string& name);
void DeleteGenerator(cmCPackGenerator* gen);
typedef cmCPackGenerator* CreateGeneratorCall();
using CreateGeneratorCall = cmCPackGenerator*();
void RegisterGenerator(const std::string& name,
const char* generatorDescription,
......@@ -37,7 +37,7 @@ public:
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
typedef std::map<std::string, std::string> DescriptionsMap;
using DescriptionsMap = std::map<std::string, std::string>;
const DescriptionsMap& GetGeneratorsList() const
{
return this->GeneratorDescriptions;
......@@ -47,7 +47,7 @@ private:
cmCPackGenerator* NewGeneratorInternal(const std::string& name);
std::vector<cmCPackGenerator*> Generators;
typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
using t_GeneratorCreatorsMap = std::map<std::string, CreateGeneratorCall*>;
t_GeneratorCreatorsMap GeneratorCreators;
DescriptionsMap GeneratorDescriptions;
cmCPackLog* Logger;
......
......@@ -66,7 +66,7 @@ int cpackUnknownArgument(const char* /*unused*/, void* /*unused*/)
struct cpackDefinitions
{
typedef std::map<std::string, std::string> MapType;
using MapType = std::map<std::string, std::string>;
MapType Map;
cmCPackLog* Log;
};
......
......@@ -22,7 +22,7 @@ class cmake;
class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
using Superclass = cmCTestGenericHandler;
/*
* The main entry point for this class
......
......@@ -529,7 +529,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
// Sort XML fragments in chronological order.
cmFileTimeCache ftc;
FragmentCompare fragmentCompare(&ftc);
typedef std::set<std::string, FragmentCompare> Fragments;
using Fragments = std::set<std::string, FragmentCompare>;
Fragments fragments(fragmentCompare);
// only report the first 50 warnings and first 50 errors
......
......@@ -28,8 +28,8 @@ class cmXMLWriter;
class cmCTestBuildHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
typedef cmProcessOutput::Encoding Encoding;
using Superclass = cmCTestGenericHandler;
using Encoding = cmProcessOutput::Encoding;
/*
* The main entry point for this class
......@@ -111,7 +111,7 @@ private:
std::vector<cmsys::RegularExpression> WarningMatchRegex;
std::vector<cmsys::RegularExpression> WarningExceptionRegex;
typedef std::deque<char> t_BuildProcessingQueueType;
using t_BuildProcessingQueueType = std::deque<char>;
void ProcessBuffer(const char* data, size_t length, size_t& tick,
size_t tick_len, std::ostream& ofs,
......@@ -126,7 +126,7 @@ private:
std::string SimplifySourceDir;
std::string SimplifyBuildDir;
size_t OutputLineCounter;
typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector;
using t_ErrorsAndWarningsVector = std::vector<cmCTestBuildErrorWarning>;
t_ErrorsAndWarningsVector ErrorsAndWarnings;
t_ErrorsAndWarningsVector::iterator LastErrorOrWarning;
size_t PostContextCount;
......
......@@ -14,7 +14,7 @@
class cmCTestConfigureHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
using Superclass = cmCTestGenericHandler;
/*
* The main entry point for this class
......
......@@ -42,7 +42,7 @@ public:
*/
std::string GetName() const override { return "ctest_coverage"; }
typedef cmCTestHandlerCommand Superclass;
using Superclass = cmCTestHandlerCommand;
protected:
cmCTestGenericHandler* InitializeHandler() override;
......
......@@ -24,8 +24,8 @@ public:
int Error;
std::string SourceDir;
std::string BinaryDir;
typedef std::vector<int> SingleFileCoverageVector;
typedef std::map<std::string, SingleFileCoverageVector> TotalCoverageMap;
using SingleFileCoverageVector = std::vector<int>;
using TotalCoverageMap = std::map<std::string, SingleFileCoverageVector>;
TotalCoverageMap TotalCoverage;
std::ostream* OFS;
bool Quiet;
......@@ -37,7 +37,7 @@ public:
class cmCTestCoverageHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
using Superclass = cmCTestGenericHandler;
/*
* The main entry point for this class
......@@ -128,12 +128,12 @@ private:
class LabelSet : public std::set<int>
{
};
typedef std::map<std::string, LabelSet> LabelMapType;
using LabelMapType = std::map<std::string, LabelSet>;
LabelMapType SourceLabels;
LabelMapType TargetDirs;
// Map from label name to label id.
typedef std::map<std::string, int> LabelIdMapType;
using LabelIdMapType = std::map<std::string, int>;
LabelIdMapType LabelIdMap;
std::vector<std::string> Labels;
int GetLabelId(std::string const& label);
......
......@@ -71,7 +71,7 @@ public:
cmCTestGenericHandler();
virtual ~cmCTestGenericHandler();
typedef std::map<std::string, std::string> t_StringToString;
using t_StringToString = std::map<std::string, std::string>;
void SetPersistentOption(const std::string& op, const char* value);
void SetOption(const std::string& op, const char* value);
......
......@@ -22,7 +22,7 @@ class cmCTestMemCheckHandler : public cmCTestTestHandler
friend class cmCTestRunTest;
public:
typedef cmCTestTestHandler Superclass;
using Superclass = cmCTestTestHandler;
void PopulateCustomVectors(cmMakefile* mf) override;
......
......@@ -58,7 +58,7 @@ class cmake;
class cmCTestScriptHandler : public cmCTestGenericHandler
{
public:
typedef cmCTestGenericHandler Superclass;
using Superclass = cmCTestGenericHandler;
/**
* Add a script to run, and if is should run in the current process
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment