diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-02-20 13:38:24 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-02-23 07:38:42 +0000 |
commit | e160b26d8c7476c63f6220ac69d1d6405e8ce3aa (patch) | |
tree | a63896f1b3d74ab9b50d45070213d6897a8d7248 /src/lib/corelib/language | |
parent | 6615e52e4308962a7d10d606eead188fbfe198f3 (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>
Diffstat (limited to 'src/lib/corelib/language')
-rw-r--r-- | src/lib/corelib/language/forward_decls.h | 84 | ||||
-rw-r--r-- | src/lib/corelib/language/item.h | 6 | ||||
-rw-r--r-- | src/lib/corelib/language/itemdeclaration.h | 4 | ||||
-rw-r--r-- | src/lib/corelib/language/itempool.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/jsimports.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/moduleloader.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/moduleloader.h | 6 | ||||
-rw-r--r-- | src/lib/corelib/language/projectresolver.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/projectresolver.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/property.h | 4 |
10 files changed, 57 insertions, 57 deletions
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 |