aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/parser
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-29 10:45:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-25 10:44:05 +0200
commit7be4e64b4bac6e6b5a90eec74b9f2b661c60db3a (patch)
tree41d2f586576787ffa71e567398391f7ab504ae89 /sources/shiboken2/ApiExtractor/parser
parente5595a4b3010b1bb4b6f80a0339271a7b26934de (diff)
shiboken: Replace 'typedef' by 'using'
Apply Fixits by Qt Creator with some amendments. Remove iterator types by using auto instead. Change-Id: I8a75323da6ae5cdcc6b67af8be9376408953986b Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser')
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.cpp11
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.h2
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel_fwd.h52
3 files changed, 31 insertions, 34 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
index b022f0c60..f8408e859 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
@@ -53,9 +53,8 @@ private:
template <class T>
static QSharedPointer<T> findModelItem(const QVector<QSharedPointer<T> > &list, const QString &name)
{
- typedef typename QVector<QSharedPointer<T> >::const_iterator It;
- const It it = std::find_if(list.begin(), list.end(), ModelItemNamePredicate<T>(name));
- return it != list.end() ? *it : QSharedPointer<T>();
+ const auto it = std::find_if(list.cbegin(), list.cend(), ModelItemNamePredicate<T>(name));
+ return it != list.cend() ? *it : QSharedPointer<T>();
}
// ---------------------------------------------------------------------------
@@ -800,12 +799,10 @@ static void formatScopeHash(QDebug &d, const char *prefix, const Hash &h,
const char *separator = ", ",
bool trailingNewLine = false)
{
- typedef typename Hash::ConstIterator HashIterator;
if (!h.isEmpty()) {
d << prefix << '[' << h.size() << "](";
- const HashIterator begin = h.begin();
- const HashIterator end = h.end();
- for (HashIterator it = begin; it != end; ++it) { // Omit the names as they are repeated
+ const auto begin = h.cbegin();
+ for (auto it = begin, end = h.cend(); it != end; ++it) { // Omit the names as they are repeated
if (it != begin)
d << separator;
d << it.value().data();
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h
index 6f3c17613..03d43d614 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.h
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h
@@ -101,7 +101,7 @@ class TypeInfo
{
friend class TypeParser;
public:
- typedef QVector<Indirection> Indirections;
+ using Indirections = QVector<Indirection>;
TypeInfo() : flags(0), m_referenceType(NoReference) {}
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel_fwd.h b/sources/shiboken2/ApiExtractor/parser/codemodel_fwd.h
index f67c64221..54dbe78dc 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel_fwd.h
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel_fwd.h
@@ -51,32 +51,32 @@ class _VariableModelItem;
class _MemberModelItem;
class TypeInfo;
-typedef QSharedPointer<_ArgumentModelItem> ArgumentModelItem;
-typedef QSharedPointer<_ClassModelItem> ClassModelItem;
-typedef QSharedPointer<_CodeModelItem> CodeModelItem;
-typedef QSharedPointer<_EnumModelItem> EnumModelItem;
-typedef QSharedPointer<_EnumeratorModelItem> EnumeratorModelItem;
-typedef QSharedPointer<_FileModelItem> FileModelItem;
-typedef QSharedPointer<_FunctionModelItem> FunctionModelItem;
-typedef QSharedPointer<_NamespaceModelItem> NamespaceModelItem;
-typedef QSharedPointer<_ScopeModelItem> ScopeModelItem;
-typedef QSharedPointer<_TemplateParameterModelItem> TemplateParameterModelItem;
-typedef QSharedPointer<_TypeDefModelItem> TypeDefModelItem;
-typedef QSharedPointer<_VariableModelItem> VariableModelItem;
-typedef QSharedPointer<_MemberModelItem> MemberModelItem;
+using ArgumentModelItem = QSharedPointer<_ArgumentModelItem>;
+using ClassModelItem = QSharedPointer<_ClassModelItem>;
+using CodeModelItem = QSharedPointer<_CodeModelItem>;
+using EnumModelItem = QSharedPointer<_EnumModelItem>;
+using EnumeratorModelItem = QSharedPointer<_EnumeratorModelItem>;
+using FileModelItem = QSharedPointer<_FileModelItem>;
+using FunctionModelItem = QSharedPointer<_FunctionModelItem>;
+using NamespaceModelItem = QSharedPointer<_NamespaceModelItem>;
+using ScopeModelItem = QSharedPointer<_ScopeModelItem>;
+using TemplateParameterModelItem = QSharedPointer<_TemplateParameterModelItem>;
+using TypeDefModelItem = QSharedPointer<_TypeDefModelItem>;
+using VariableModelItem = QSharedPointer<_VariableModelItem>;
+using MemberModelItem = QSharedPointer<_MemberModelItem>;
-typedef QVector<ArgumentModelItem> ArgumentList;
-typedef QVector<ClassModelItem> ClassList;
-typedef QVector<CodeModelItem> ItemList;
-typedef QVector<EnumModelItem> EnumList;
-typedef QVector<EnumeratorModelItem> EnumeratorList;
-typedef QVector<FileModelItem> FileList;
-typedef QVector<FunctionModelItem> FunctionList;
-typedef QVector<NamespaceModelItem> NamespaceList;
-typedef QVector<ScopeModelItem> ScopeList;
-typedef QVector<TemplateParameterModelItem> TemplateParameterList;
-typedef QVector<TypeDefModelItem> TypeDefList;
-typedef QVector<VariableModelItem> VariableList;
-typedef QVector<MemberModelItem> MemberList;
+using ArgumentList = QVector<ArgumentModelItem>;
+using ClassList = QVector<ClassModelItem>;
+using ItemList = QVector<CodeModelItem>;
+using EnumList = QVector<EnumModelItem>;
+using EnumeratorList = QVector<EnumeratorModelItem>;
+using FileList = QVector<FileModelItem>;
+using FunctionList = QVector<FunctionModelItem>;
+using NamespaceList = QVector<NamespaceModelItem>;
+using ScopeList = QVector<ScopeModelItem>;
+using TemplateParameterList = QVector<TemplateParameterModelItem>;
+using TypeDefList = QVector<TypeDefModelItem>;
+using VariableList = QVector<VariableModelItem>;
+using MemberList = QVector<MemberModelItem>;
#endif // CODEMODEL_FWD_H