aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-02-20 13:38:24 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-02-23 07:38:42 +0000
commite160b26d8c7476c63f6220ac69d1d6405e8ce3aa (patch)
treea63896f1b3d74ab9b50d45070213d6897a8d7248
parent6615e52e4308962a7d10d606eead188fbfe198f3 (diff)
Replace 'typedef' with 'using' where it is possible
One exception is that the 'typedef' for function pointers were skipped due to an additional work is required. Change-Id: I2112fded3abeaee1d1f49f56adfd2914d5db0324 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/app/qbs/commandlinefrontend.h2
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp2
-rw-r--r--src/lib/corelib/api/qmljsrewriter.h2
-rw-r--r--src/lib/corelib/api/rulecommand.h2
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.h2
-rw-r--r--src/lib/corelib/buildgraph/executor.h6
-rw-r--r--src/lib/corelib/buildgraph/forward_decls.h12
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.h8
-rw-r--r--src/lib/corelib/buildgraph/projectbuilddata.h4
-rw-r--r--src/lib/corelib/buildgraph/rescuableartifactdata.h2
-rw-r--r--src/lib/corelib/buildgraph/transformer.cpp2
-rw-r--r--src/lib/corelib/generators/generatordata.h2
-rw-r--r--src/lib/corelib/language/forward_decls.h84
-rw-r--r--src/lib/corelib/language/item.h6
-rw-r--r--src/lib/corelib/language/itemdeclaration.h4
-rw-r--r--src/lib/corelib/language/itempool.h2
-rw-r--r--src/lib/corelib/language/jsimports.h2
-rw-r--r--src/lib/corelib/language/moduleloader.cpp2
-rw-r--r--src/lib/corelib/language/moduleloader.h6
-rw-r--r--src/lib/corelib/language/projectresolver.cpp2
-rw-r--r--src/lib/corelib/language/projectresolver.h2
-rw-r--r--src/lib/corelib/language/property.h4
-rw-r--r--src/lib/corelib/tools/fileinfo.h2
-rw-r--r--src/lib/corelib/tools/filetime.h6
-rw-r--r--src/lib/corelib/tools/iosutils.h4
-rw-r--r--src/lib/corelib/tools/persistence.h2
-rw-r--r--src/lib/corelib/tools/setupprojectparameters.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuildqbsproductproject.h2
-rw-r--r--src/shared/json/json.cpp2
-rw-r--r--src/shared/json/json.h58
-rw-r--r--tests/auto/blackbox/testdata-qt/qml-debugging/main.cpp4
-rw-r--r--tests/benchmarker/benchmarker.h2
32 files changed, 122 insertions, 122 deletions
diff --git a/src/app/qbs/commandlinefrontend.h b/src/app/qbs/commandlinefrontend.h
index 8860324a6..363e0b040 100644
--- a/src/app/qbs/commandlinefrontend.h
+++ b/src/app/qbs/commandlinefrontend.h
@@ -81,7 +81,7 @@ private:
void handleProcessResultReport(const qbs::ProcessResult &result);
void checkCancelStatus();
- typedef QHash<Project, QList<ProductData> > ProductMap;
+ using ProductMap = QHash<Project, QList<ProductData>>;
ProductMap productsToUse() const;
bool resolvingMultipleProjects() const;
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 2ec0df1df..32023e011 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -477,7 +477,7 @@ void CommandLineParser::CommandLineParserPrivate::setupBuildConfigurations()
{
// first: configuration name, second: properties.
// Empty configuration name used for global properties.
- typedef std::pair<QString, QVariantMap> PropertyListItem;
+ using PropertyListItem = std::pair<QString, QVariantMap>;
QList<PropertyListItem> propertiesPerConfiguration;
const QString configurationNameKey = QLatin1String("qbs.configurationName");
diff --git a/src/lib/corelib/api/qmljsrewriter.h b/src/lib/corelib/api/qmljsrewriter.h
index 0a575496c..797b05459 100644
--- a/src/lib/corelib/api/qmljsrewriter.h
+++ b/src/lib/corelib/api/qmljsrewriter.h
@@ -57,7 +57,7 @@ public:
ArrayBinding
};
- typedef ChangeSet::Range Range;
+ using Range = ChangeSet::Range;
public:
Rewriter(const QString &originalText,
diff --git a/src/lib/corelib/api/rulecommand.h b/src/lib/corelib/api/rulecommand.h
index 172e1ad51..438849604 100644
--- a/src/lib/corelib/api/rulecommand.h
+++ b/src/lib/corelib/api/rulecommand.h
@@ -83,7 +83,7 @@ private:
};
-typedef QList<RuleCommand> RuleCommandList;
+using RuleCommandList = QList<RuleCommand>;
} // namespace qbs
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.h b/src/lib/corelib/buildgraph/buildgraphloader.h
index 761c80603..94eb01c5d 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.h
+++ b/src/lib/corelib/buildgraph/buildgraphloader.h
@@ -127,7 +127,7 @@ private:
ArtifactSet children;
ArtifactSet childrenAddedByScanner;
};
- typedef QHash<const Artifact *, ChildrenInfo> ChildListHash;
+ using ChildListHash = QHash<const Artifact *, ChildrenInfo>;
void rescueOldBuildData(const ResolvedProductConstPtr &restoredProduct,
const ResolvedProductPtr &newlyResolvedProduct,
const ChildListHash &childLists,
diff --git a/src/lib/corelib/buildgraph/executor.h b/src/lib/corelib/buildgraph/executor.h
index 2756a7120..003ba9a22 100644
--- a/src/lib/corelib/buildgraph/executor.h
+++ b/src/lib/corelib/buildgraph/executor.h
@@ -109,8 +109,8 @@ private:
bool operator() (const BuildGraphNode *x, const BuildGraphNode *y) const;
};
- typedef std::priority_queue<BuildGraphNode *, std::vector<BuildGraphNode *>,
- ComparePriority> Leaves;
+ using Leaves = std::priority_queue<BuildGraphNode *, std::vector<BuildGraphNode *>,
+ ComparePriority>;
void doBuild();
void prepareAllNodes();
@@ -158,7 +158,7 @@ private:
void updateJobCounts(const Transformer *transformer, int diff);
bool schedulingBlockedByJobLimit(const BuildGraphNode *node);
- typedef QHash<ExecutorJob *, TransformerPtr> JobMap;
+ using JobMap = QHash<ExecutorJob *, TransformerPtr>;
JobMap m_processingJobs;
ProductInstaller *m_productInstaller;
diff --git a/src/lib/corelib/buildgraph/forward_decls.h b/src/lib/corelib/buildgraph/forward_decls.h
index f39c9eb6f..a76272288 100644
--- a/src/lib/corelib/buildgraph/forward_decls.h
+++ b/src/lib/corelib/buildgraph/forward_decls.h
@@ -51,20 +51,20 @@ class ProductBuildData;
class RuleNode;
class Transformer;
-typedef std::shared_ptr<Transformer> TransformerPtr;
-typedef std::shared_ptr<const Transformer> TransformerConstPtr;
+using TransformerPtr = std::shared_ptr<Transformer>;
+using TransformerConstPtr = std::shared_ptr<const Transformer>;
class RulesEvaluationContext;
-typedef std::shared_ptr<RulesEvaluationContext> RulesEvaluationContextPtr;
+using RulesEvaluationContextPtr = std::shared_ptr<RulesEvaluationContext>;
class AbstractCommand;
-typedef std::shared_ptr<AbstractCommand> AbstractCommandPtr;
+using AbstractCommandPtr = std::shared_ptr<AbstractCommand>;
class ProcessCommand;
-typedef std::shared_ptr<ProcessCommand> ProcessCommandPtr;
+using ProcessCommandPtr = std::shared_ptr<ProcessCommand>;
class JavaScriptCommand;
-typedef std::shared_ptr<JavaScriptCommand> JavaScriptCommandPtr;
+using JavaScriptCommandPtr = std::shared_ptr<JavaScriptCommand>;
template<typename T> class Set;
using ArtifactSet = Set<Artifact *>;
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.h b/src/lib/corelib/buildgraph/inputartifactscanner.h
index c88f9fd96..92d5f516f 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.h
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.h
@@ -60,7 +60,7 @@ class RawScanResults;
class PropertyMapInternal;
class DependencyScanner;
-typedef std::shared_ptr<DependencyScanner> DependencyScannerPtr;
+using DependencyScannerPtr = std::shared_ptr<DependencyScanner>;
class ResolvedDependency
{
@@ -83,7 +83,7 @@ class InputArtifactScannerContext
ResolvedDependency resolvedDependency;
};
- typedef QHash<QString, QHash<QString, ResolvedDependencyCacheItem> > ResolvedDependenciesCache;
+ using ResolvedDependenciesCache = QHash<QString, QHash<QString, ResolvedDependencyCacheItem>>;
struct ScannerResolvedDependenciesCache
{
@@ -105,11 +105,11 @@ class InputArtifactScannerContext
QList<DependencyScannerPtr> scanners;
};
- typedef QHash<const void *, ScannerResolvedDependenciesCache> CacheItem;
+ using CacheItem = QHash<const void *, ScannerResolvedDependenciesCache>;
QHash<PropertyMapConstPtr, CacheItem> cachePerProperties;
QHash<Artifact *, CacheItem> cachePerFile;
- QHash<ResolvedProduct*, QHash<FileTag, DependencyScannerCacheItem> > scannersCache;
+ QHash<ResolvedProduct*, QHash<FileTag, DependencyScannerCacheItem>> scannersCache;
friend class InputArtifactScanner;
};
diff --git a/src/lib/corelib/buildgraph/projectbuilddata.h b/src/lib/corelib/buildgraph/projectbuilddata.h
index 0df303c0b..785a86cbb 100644
--- a/src/lib/corelib/buildgraph/projectbuilddata.h
+++ b/src/lib/corelib/buildgraph/projectbuilddata.h
@@ -99,8 +99,8 @@ private:
pool.serializationOp<opType>(fileDependencies, rawScanResults);
}
- typedef QHash<QString, QList<FileResourceBase *> > ResultsPerDirectory;
- typedef QHash<QString, ResultsPerDirectory> ArtifactLookupTable;
+ using ResultsPerDirectory = QHash<QString, QList<FileResourceBase *>>;
+ using ArtifactLookupTable = QHash<QString, ResultsPerDirectory>;
ArtifactLookupTable m_artifactLookupTable;
bool m_doCleanupInDestructor = true;
bool m_isDirty = true;
diff --git a/src/lib/corelib/buildgraph/rescuableartifactdata.h b/src/lib/corelib/buildgraph/rescuableartifactdata.h
index 068c543ed..3e4d6e25f 100644
--- a/src/lib/corelib/buildgraph/rescuableartifactdata.h
+++ b/src/lib/corelib/buildgraph/rescuableartifactdata.h
@@ -128,7 +128,7 @@ public:
PropertyMapPtr properties;
};
-typedef QHash<QString, RescuableArtifactData> AllRescuableArtifactData;
+using AllRescuableArtifactData = QHash<QString, RescuableArtifactData>;
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/buildgraph/transformer.cpp b/src/lib/corelib/buildgraph/transformer.cpp
index ccde486ab..e828260c1 100644
--- a/src/lib/corelib/buildgraph/transformer.cpp
+++ b/src/lib/corelib/buildgraph/transformer.cpp
@@ -149,7 +149,7 @@ QScriptValue Transformer::translateInOutputs(ScriptEngine *scriptEngine,
const ArtifactSet &artifacts,
const QString &defaultModuleName)
{
- typedef QMap<QString, QList<Artifact*> > TagArtifactsMap;
+ using TagArtifactsMap = QMap<QString, QList<Artifact*>>;
TagArtifactsMap tagArtifactsMap;
for (Artifact *artifact : artifacts)
for (const FileTag &fileTag : artifact->fileTags())
diff --git a/src/lib/corelib/generators/generatordata.h b/src/lib/corelib/generators/generatordata.h
index fcf4c0368..b6200339e 100644
--- a/src/lib/corelib/generators/generatordata.h
+++ b/src/lib/corelib/generators/generatordata.h
@@ -50,7 +50,7 @@
namespace qbs {
-typedef QMap<QString, Project> GeneratableProjectMap;
+using GeneratableProjectMap = QMap<QString, Project>;
template <typename U> struct IMultiplexableContainer {
QMap<QString, U> data;
diff --git a/src/lib/corelib/language/forward_decls.h b/src/lib/corelib/language/forward_decls.h
index 5ce333ce9..6697ac8c9 100644
--- a/src/lib/corelib/language/forward_decls.h
+++ b/src/lib/corelib/language/forward_decls.h
@@ -47,89 +47,89 @@ namespace Internal {
enum class ObserveMode;
class Value;
-typedef std::shared_ptr<Value> ValuePtr;
-typedef std::shared_ptr<const Value> ValueConstPtr;
+using ValuePtr = std::shared_ptr<Value>;
+using ValueConstPtr = std::shared_ptr<const Value>;
class ItemValue;
-typedef std::shared_ptr<ItemValue> ItemValuePtr;
-typedef std::shared_ptr<const ItemValue> ItemValueConstPtr;
+using ItemValuePtr = std::shared_ptr<ItemValue>;
+using ItemValueConstPtr = std::shared_ptr<const ItemValue>;
class JSSourceValue;
-typedef std::shared_ptr<JSSourceValue> JSSourceValuePtr;
-typedef std::shared_ptr<const JSSourceValue> JSSourceValueConstPtr;
+using JSSourceValuePtr = std::shared_ptr<JSSourceValue>;
+using JSSourceValueConstPtr = std::shared_ptr<const JSSourceValue>;
class VariantValue;
-typedef std::shared_ptr<VariantValue> VariantValuePtr;
-typedef std::shared_ptr<const VariantValue> VariantValueConstPtr;
+using VariantValuePtr = std::shared_ptr<VariantValue>;
+using VariantValueConstPtr = std::shared_ptr<const VariantValue>;
class FileContext;
-typedef std::shared_ptr<FileContext> FileContextPtr;
-typedef std::shared_ptr<const FileContext> FileContextConstPtr;
+using FileContextPtr = std::shared_ptr<FileContext>;
+using FileContextConstPtr = std::shared_ptr<const FileContext>;
class FileContextBase;
-typedef std::shared_ptr<FileContextBase> FileContextBasePtr;
-typedef std::shared_ptr<const FileContextBase> FileContextBaseConstPtr;
+using FileContextBasePtr = std::shared_ptr<FileContextBase>;
+using FileContextBaseConstPtr = std::shared_ptr<const FileContextBase>;
class Probe;
-typedef std::shared_ptr<Probe> ProbePtr;
-typedef std::shared_ptr<const Probe> ProbeConstPtr;
+using ProbePtr = std::shared_ptr<Probe>;
+using ProbeConstPtr = std::shared_ptr<const Probe>;
class PropertyMapInternal;
-typedef std::shared_ptr<PropertyMapInternal> PropertyMapPtr;
-typedef std::shared_ptr<const PropertyMapInternal> PropertyMapConstPtr;
+using PropertyMapPtr = std::shared_ptr<PropertyMapInternal>;
+using PropertyMapConstPtr = std::shared_ptr<const PropertyMapInternal>;
class FileTagger;
-typedef std::shared_ptr<FileTagger> FileTaggerPtr;
-typedef std::shared_ptr<const FileTagger> FileTaggerConstPtr;
+using FileTaggerPtr = std::shared_ptr<FileTagger>;
+using FileTaggerConstPtr = std::shared_ptr<const FileTagger>;
class ResolvedProduct;
-typedef std::shared_ptr<ResolvedProduct> ResolvedProductPtr;
-typedef std::shared_ptr<const ResolvedProduct> ResolvedProductConstPtr;
+using ResolvedProductPtr = std::shared_ptr<ResolvedProduct>;
+using ResolvedProductConstPtr = std::shared_ptr<const ResolvedProduct>;
class ResolvedProject;
-typedef std::shared_ptr<ResolvedProject> ResolvedProjectPtr;
-typedef std::shared_ptr<const ResolvedProject> ResolvedProjectConstPtr;
+using ResolvedProjectPtr = std::shared_ptr<ResolvedProject>;
+using ResolvedProjectConstPtr = std::shared_ptr<const ResolvedProject>;
class TopLevelProject;
-typedef std::shared_ptr<TopLevelProject> TopLevelProjectPtr;
-typedef std::shared_ptr<const TopLevelProject> TopLevelProjectConstPtr;
+using TopLevelProjectPtr = std::shared_ptr<TopLevelProject>;
+using TopLevelProjectConstPtr = std::shared_ptr<const TopLevelProject>;
class ResolvedFileContext;
-typedef std::shared_ptr<ResolvedFileContext> ResolvedFileContextPtr;
-typedef std::shared_ptr<const ResolvedFileContext> ResolvedFileContextConstPtr;
+using ResolvedFileContextPtr = std::shared_ptr<ResolvedFileContext>;
+using ResolvedFileContextConstPtr = std::shared_ptr<const ResolvedFileContext>;
class Rule;
-typedef std::shared_ptr<Rule> RulePtr;
-typedef std::shared_ptr<const Rule> RuleConstPtr;
+using RulePtr = std::shared_ptr<Rule>;
+using RuleConstPtr = std::shared_ptr<const Rule>;
class ResolvedScanner;
-typedef std::shared_ptr<ResolvedScanner> ResolvedScannerPtr;
-typedef std::shared_ptr<const ResolvedScanner> ResolvedScannerConstPtr;
+using ResolvedScannerPtr = std::shared_ptr<ResolvedScanner>;
+using ResolvedScannerConstPtr = std::shared_ptr<const ResolvedScanner>;
class SourceArtifactInternal;
-typedef std::shared_ptr<SourceArtifactInternal> SourceArtifactPtr;
-typedef std::shared_ptr<const SourceArtifactInternal> SourceArtifactConstPtr;
+using SourceArtifactPtr = std::shared_ptr<SourceArtifactInternal>;
+using SourceArtifactConstPtr = std::shared_ptr<const SourceArtifactInternal>;
class ScriptFunction;
-typedef std::shared_ptr<ScriptFunction> ScriptFunctionPtr;
-typedef std::shared_ptr<const ScriptFunction> ScriptFunctionConstPtr;
+using ScriptFunctionPtr = std::shared_ptr<ScriptFunction>;
+using ScriptFunctionConstPtr = std::shared_ptr<const ScriptFunction>;
class PrivateScriptFunction;
class RuleArtifact;
-typedef std::shared_ptr<RuleArtifact> RuleArtifactPtr;
-typedef std::shared_ptr<const RuleArtifact> RuleArtifactConstPtr;
+using RuleArtifactPtr = std::shared_ptr<RuleArtifact>;
+using RuleArtifactConstPtr = std::shared_ptr<const RuleArtifact>;
class ResolvedModule;
-typedef std::shared_ptr<ResolvedModule> ResolvedModulePtr;
-typedef std::shared_ptr<const ResolvedModule> ResolvedModuleConstPtr;
+using ResolvedModulePtr = std::shared_ptr<ResolvedModule>;
+using ResolvedModuleConstPtr = std::shared_ptr<const ResolvedModule>;
class ResolvedGroup;
-typedef std::shared_ptr<ResolvedGroup> GroupPtr;
-typedef std::shared_ptr<const ResolvedGroup> GroupConstPtr;
+using GroupPtr = std::shared_ptr<ResolvedGroup>;
+using GroupConstPtr = std::shared_ptr<const ResolvedGroup>;
class ArtifactProperties;
-typedef std::shared_ptr<ArtifactProperties> ArtifactPropertiesPtr;
-typedef std::shared_ptr<const ArtifactProperties> ArtifactPropertiesConstPtr;
+using ArtifactPropertiesPtr = std::shared_ptr<ArtifactProperties>;
+using ArtifactPropertiesConstPtr = std::shared_ptr<const ArtifactProperties>;
class ExportedItem;
using ExportedItemPtr = std::shared_ptr<ExportedItem>;
diff --git a/src/lib/corelib/language/item.h b/src/lib/corelib/language/item.h
index 2dafaa774..c5d8ef980 100644
--- a/src/lib/corelib/language/item.h
+++ b/src/lib/corelib/language/item.h
@@ -82,9 +82,9 @@ public:
QVariantMap parameters;
VersionRange versionRange;
};
- typedef std::vector<Module> Modules;
- typedef QMap<QString, PropertyDeclaration> PropertyDeclarationMap;
- typedef QMap<QString, ValuePtr> PropertyMap;
+ using Modules = std::vector<Module>;
+ using PropertyDeclarationMap = QMap<QString, PropertyDeclaration>;
+ using PropertyMap = QMap<QString, ValuePtr>;
static Item *create(ItemPool *pool, ItemType type);
Item *clone() const;
diff --git a/src/lib/corelib/language/itemdeclaration.h b/src/lib/corelib/language/itemdeclaration.h
index f637e6bbb..6da699d28 100644
--- a/src/lib/corelib/language/itemdeclaration.h
+++ b/src/lib/corelib/language/itemdeclaration.h
@@ -57,7 +57,7 @@ public:
ItemType type() const { return m_type; }
- typedef QList<PropertyDeclaration> Properties;
+ using Properties = QList<PropertyDeclaration>;
void setProperties(const Properties &props) { m_properties = props; }
Properties properties() const { return m_properties; }
@@ -66,7 +66,7 @@ public:
ItemDeclaration &operator<<(const PropertyDeclaration &decl);
- typedef Set<ItemType> TypeNames;
+ using TypeNames = Set<ItemType>;
void setAllowedChildTypes(const TypeNames &typeNames) { m_allowedChildTypes = typeNames; }
const TypeNames &allowedChildTypes() const { return m_allowedChildTypes; }
bool isChildTypeAllowed(ItemType type) const;
diff --git a/src/lib/corelib/language/itempool.h b/src/lib/corelib/language/itempool.h
index a4837a057..8ee8562d7 100644
--- a/src/lib/corelib/language/itempool.h
+++ b/src/lib/corelib/language/itempool.h
@@ -62,7 +62,7 @@ public:
private:
QbsQmlJS::MemoryPool m_pool;
- typedef QList<Item *> ItemVector;
+ using ItemVector = QList<Item *>;
ItemVector m_items;
};
diff --git a/src/lib/corelib/language/jsimports.h b/src/lib/corelib/language/jsimports.h
index c4d5ac30e..ebde70b7b 100644
--- a/src/lib/corelib/language/jsimports.h
+++ b/src/lib/corelib/language/jsimports.h
@@ -82,7 +82,7 @@ inline bool operator==(const JsImport &jsi1, const JsImport &jsi2)
return jsi1.scopeName == jsi2.scopeName && jsi1.filePaths.toSet() == jsi2.filePaths.toSet();
}
-typedef std::vector<JsImport> JsImports;
+using JsImports = std::vector<JsImport>;
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 882ac7061..e6ef0eac4 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -3493,7 +3493,7 @@ void ModuleLoader::resolveProbe(ProductContext *productContext, Item *parent, It
QBS_CHECK(configureScript);
if (Q_UNLIKELY(configureScript->sourceCode() == StringConstants::undefinedValue()))
throw ErrorInfo(Tr::tr("Probe.configure must be set."), probe->location());
- typedef std::pair<QString, QScriptValue> ProbeProperty;
+ using ProbeProperty = std::pair<QString, QScriptValue>;
QList<ProbeProperty> probeBindings;
QVariantMap initialProperties;
for (Item *obj = probe; obj; obj = obj->prototype()) {
diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h
index a0a555748..a8190596d 100644
--- a/src/lib/corelib/language/moduleloader.h
+++ b/src/lib/corelib/language/moduleloader.h
@@ -152,7 +152,7 @@ private:
class ProjectContext;
- typedef std::vector<ModuleLoaderResult::ProductInfo::Dependency> ProductDependencies;
+ using ProductDependencies = std::vector<ModuleLoaderResult::ProductInfo::Dependency>;
// This is the data we need to store at the point where a dependency is deferred
// in order to properly resolve the dependency in pass 2.
@@ -241,8 +241,8 @@ private:
TopLevelProjectContext *topLevelProjectContext, Item *projectItem,
const Set<QString> &referencedFilePaths);
- typedef std::vector<VariantValuePtr> MultiplexRow;
- typedef std::vector<MultiplexRow> MultiplexTable;
+ using MultiplexRow = std::vector<VariantValuePtr>;
+ using MultiplexTable = std::vector<MultiplexRow>;
struct MultiplexInfo
{
diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp
index d0af0b7ed..9e9befbf3 100644
--- a/src/lib/corelib/language/projectresolver.cpp
+++ b/src/lib/corelib/language/projectresolver.cpp
@@ -99,7 +99,7 @@ struct ProjectResolver::ProductContext
ResolvedProductPtr product;
QString buildDirectory;
Item *item;
- typedef std::pair<ArtifactPropertiesPtr, std::vector<CodeLocation>> ArtifactPropertiesInfo;
+ using ArtifactPropertiesInfo = std::pair<ArtifactPropertiesPtr, std::vector<CodeLocation>>;
QHash<QStringList, ArtifactPropertiesInfo> artifactPropertiesPerFilter;
ProjectResolver::FileLocations sourceArtifactLocations;
GroupConstPtr currentGroup;
diff --git a/src/lib/corelib/language/projectresolver.h b/src/lib/corelib/language/projectresolver.h
index 777451fa6..0732b1c9b 100644
--- a/src/lib/corelib/language/projectresolver.h
+++ b/src/lib/corelib/language/projectresolver.h
@@ -195,7 +195,7 @@ private:
qint64 m_elapsedTimeGroups;
typedef void (ProjectResolver::*ItemFuncPtr)(Item *item, ProjectContext *projectContext);
- typedef QMap<ItemType, ItemFuncPtr> ItemFuncMap;
+ using ItemFuncMap = QMap<ItemType, ItemFuncPtr>;
void callItemFunction(const ItemFuncMap &mappings, Item *item, ProjectContext *projectContext);
};
diff --git a/src/lib/corelib/language/property.h b/src/lib/corelib/language/property.h
index 8ad992bdb..204704672 100644
--- a/src/lib/corelib/language/property.h
+++ b/src/lib/corelib/language/property.h
@@ -95,8 +95,8 @@ inline uint qHash(const Property &p)
return QT_PREPEND_NAMESPACE(qHash)(p.productName + p.moduleName + p.propertyName);
}
-typedef Set<Property> PropertySet;
-typedef QHash<QString, PropertySet> PropertyHash;
+using PropertySet = Set<Property>;
+using PropertyHash = QHash<QString, PropertySet>;
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/tools/fileinfo.h b/src/lib/corelib/tools/fileinfo.h
index fa101fff9..723d83424 100644
--- a/src/lib/corelib/tools/fileinfo.h
+++ b/src/lib/corelib/tools/fileinfo.h
@@ -92,7 +92,7 @@ private:
quint8 z[36];
};
#elif defined(Q_OS_UNIX)
- typedef struct stat InternalStatType;
+ using InternalStatType = struct stat;
#else
# error unknown platform
#endif
diff --git a/src/lib/corelib/tools/filetime.h b/src/lib/corelib/tools/filetime.h
index 73e9d4544..7daec6415 100644
--- a/src/lib/corelib/tools/filetime.h
+++ b/src/lib/corelib/tools/filetime.h
@@ -75,12 +75,12 @@ class QBS_AUTOTEST_EXPORT FileTime
public:
#if defined(Q_OS_UNIX)
#if HAS_CLOCK_GETTIME
- typedef timespec InternalType;
+ using InternalType = timespec;
#else
- typedef time_t InternalType;
+ using InternalType = time_t;
#endif // HAS_CLOCK_GETTIME
#elif defined(Q_OS_WIN)
- typedef quint64 InternalType;
+ using InternalType = quint64;
#else
# error unknown platform
#endif
diff --git a/src/lib/corelib/tools/iosutils.h b/src/lib/corelib/tools/iosutils.h
index 9374b24b1..1a5faf3c3 100644
--- a/src/lib/corelib/tools/iosutils.h
+++ b/src/lib/corelib/tools/iosutils.h
@@ -49,12 +49,12 @@
#include <locale>
#define QBS_RENAME_IMPL ::_wrename
#define QBS_UNLINK_IMPL ::_wunlink
-typedef std::wstring qbs_filesystem_path_string_type;
+using qbs_filesystem_path_string_type = std::wstring;
#else
#include <unistd.h>
#define QBS_RENAME_IMPL ::rename
#define QBS_UNLINK_IMPL ::unlink
-typedef std::string qbs_filesystem_path_string_type;
+using qbs_filesystem_path_string_type = std::string;
#endif
namespace qbs {
diff --git a/src/lib/corelib/tools/persistence.h b/src/lib/corelib/tools/persistence.h
index 83209113d..6be0ae8e4 100644
--- a/src/lib/corelib/tools/persistence.h
+++ b/src/lib/corelib/tools/persistence.h
@@ -135,7 +135,7 @@ public:
void setHeadData(const HeadData &hd) { m_headData = hd; }
private:
- typedef int PersistentObjectId;
+ using PersistentObjectId = int;
template <typename T> T *idLoad();
template <class T> std::shared_ptr<T> idLoadS();
diff --git a/src/lib/corelib/tools/setupprojectparameters.h b/src/lib/corelib/tools/setupprojectparameters.h
index 10e4310cd..c462ca212 100644
--- a/src/lib/corelib/tools/setupprojectparameters.h
+++ b/src/lib/corelib/tools/setupprojectparameters.h
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
class QProcessEnvironment;
class QStringList;
-typedef QMap<QString, QVariant> QVariantMap;
+using QVariantMap = QMap<QString, QVariant>;
QT_END_NAMESPACE
namespace qbs {
diff --git a/src/plugins/generator/visualstudio/msbuildqbsproductproject.h b/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
index e5624035a..f1a815f36 100644
--- a/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
+++ b/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
@@ -57,7 +57,7 @@ public:
VisualStudioGenerator *parent = nullptr);
private:
- typedef QHash<QString, std::set<Project>> ProjectConfigurations;
+ using ProjectConfigurations = QHash<QString, std::set<Project>>;
void addConfiguration(const GeneratableProject &project, const Project &buildTask,
const ProductData &productData,
diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp
index 321004dc6..17c87a8e3 100644
--- a/src/shared/json/json.cpp
+++ b/src/shared/json/json.cpp
@@ -196,7 +196,7 @@ public:
void operator-=(int i) { *this = (int(*this) - i); }
};
-typedef uint32_t offset;
+using offset = uint32_t;
// round the size up to the next 4 byte boundary
int alignedSize(int size) { return (size + 3) & ~3; }
diff --git a/src/shared/json/json.h b/src/shared/json/json.h
index 3c673fc79..6cb6ec1af 100644
--- a/src/shared/json/json.h
+++ b/src/shared/json/json.h
@@ -245,11 +245,11 @@ public:
public:
JsonArray *a;
int i;
- typedef std::random_access_iterator_tag iterator_category;
- typedef int difference_type;
- typedef JsonValue value_type;
- typedef JsonValueRef reference;
- typedef JsonValueRefPtr pointer;
+ using iterator_category = std::random_access_iterator_tag;
+ using difference_type = int;
+ using value_type = JsonValue;
+ using reference = JsonValueRef;
+ using pointer = JsonValueRefPtr;
iterator() : a(nullptr), i(0) { }
explicit iterator(JsonArray *array, int index) : a(array), i(index) { }
@@ -286,11 +286,11 @@ public:
public:
const JsonArray *a;
int i;
- typedef std::random_access_iterator_tag iterator_category;
- typedef std::ptrdiff_t difference_type;
- typedef JsonValue value_type;
- typedef JsonValue reference;
- typedef JsonValuePtr pointer;
+ using iterator_category = std::random_access_iterator_tag;
+ using difference_type = std::ptrdiff_t;
+ using value_type = JsonValue;
+ using reference = JsonValue;
+ using pointer = JsonValuePtr;
const_iterator() : a(nullptr), i(0) { }
explicit const_iterator(const JsonArray *array, int index) : a(array), i(index) { }
@@ -332,13 +332,13 @@ public:
void pop_front() { removeFirst(); }
void pop_back() { removeLast(); }
bool empty() const { return isEmpty(); }
- typedef int size_type;
- typedef JsonValue value_type;
- typedef value_type *pointer;
- typedef const value_type *const_pointer;
- typedef JsonValueRef reference;
- typedef JsonValue const_reference;
- typedef int difference_type;
+ using size_type = int ;
+ using value_type = JsonValue;
+ using pointer = value_type *;
+ using const_pointer = const value_type *;
+ using reference = JsonValueRef;
+ using const_reference = JsonValue;
+ using difference_type = int;
private:
friend class Internal::Data;
@@ -364,7 +364,7 @@ public:
JsonObject(const JsonObject &other);
JsonObject &operator =(const JsonObject &other);
- typedef std::vector<std::string> Keys;
+ using Keys = std::vector<std::string>;
Keys keys() const;
int size() const;
int count() const { return size(); }
@@ -392,10 +392,10 @@ public:
int i;
public:
- typedef std::bidirectional_iterator_tag iterator_category;
- typedef int difference_type;
- typedef JsonValue value_type;
- typedef JsonValueRef reference;
+ using iterator_category = std::bidirectional_iterator_tag;
+ using difference_type = int;
+ using value_type = JsonValue;
+ using reference = JsonValueRef;
iterator() : o(nullptr), i(0) {}
iterator(JsonObject *obj, int index) : o(obj), i(index) {}
@@ -430,10 +430,10 @@ public:
int i;
public:
- typedef std::bidirectional_iterator_tag iterator_category;
- typedef int difference_type;
- typedef JsonValue value_type;
- typedef JsonValue reference;
+ using iterator_category = std::bidirectional_iterator_tag;
+ using difference_type = int;
+ using value_type = JsonValue;
+ using reference = JsonValue;
const_iterator() : o(nullptr), i(0) {}
const_iterator(const JsonObject *obj, int index)
@@ -479,9 +479,9 @@ public:
iterator insert(const std::string &key, const JsonValue &value);
// STL compatibility
- typedef JsonValue mapped_type;
- typedef std::string key_type;
- typedef int size_type;
+ using mapped_type = JsonValue;
+ using key_type = std::string;
+ using size_type = int;
bool empty() const { return isEmpty(); }
diff --git a/tests/auto/blackbox/testdata-qt/qml-debugging/main.cpp b/tests/auto/blackbox/testdata-qt/qml-debugging/main.cpp
index 535d6d63f..7311f2d60 100644
--- a/tests/auto/blackbox/testdata-qt/qml-debugging/main.cpp
+++ b/tests/auto/blackbox/testdata-qt/qml-debugging/main.cpp
@@ -32,13 +32,13 @@
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QGuiApplication>
#include <QQmlApplicationEngine>
-typedef QGuiApplication Application;
+using Application = QGuiApplication;
#define AH_SO_THIS_IS_QT5
#else
#include <QApplication>
#include <QDeclarativeView>
#define AH_SO_THIS_IS_QT4
-typedef QApplication Application;
+using Application = QApplication;
#endif
int main(int argc, char *argv[])
diff --git a/tests/benchmarker/benchmarker.h b/tests/benchmarker/benchmarker.h
index 7027c9d15..9b6d5a157 100644
--- a/tests/benchmarker/benchmarker.h
+++ b/tests/benchmarker/benchmarker.h
@@ -48,7 +48,7 @@ public:
qint64 oldPeakMemoryUsage;
qint64 newPeakMemoryUsage;
};
-typedef QHash<Activity, BenchmarkResult> BenchmarkResults;
+using BenchmarkResults = QHash<Activity, BenchmarkResult>;
class Benchmarker
{