aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp10
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp8
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h2
-rw-r--r--sources/shiboken2/ApiExtractor/apiextractor.cpp18
-rw-r--r--sources/shiboken2/ApiExtractor/graph.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/reporthandler.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h2
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp6
8 files changed, 12 insertions, 38 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index e48d2b17c..59ea3b079 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -270,7 +270,7 @@ void AbstractMetaBuilderPrivate::registerToStringCapability(const FunctionModelI
const ArgumentModelItem &arg = arguments.at(1);
if (AbstractMetaClass *cls = argumentToClass(arg, currentClass)) {
if (arg->type().indirections() < 2)
- cls->setToStringCapability(true, arg->type().indirections());
+ cls->setToStringCapability(true, int(arg->type().indirections()));
}
}
}
@@ -1287,14 +1287,6 @@ void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaF
metaFunction->replaceType(metaType);
}
-static bool _compareAbstractMetaTypes(const AbstractMetaType *type,
- const AbstractMetaType *other,
- AbstractMetaType::ComparisonFlags flags = {})
-{
- return (type != nullptr) == (other != nullptr)
- && (type == nullptr || type->compare(*other, flags));
-}
-
AbstractMetaFunctionList AbstractMetaBuilderPrivate::classFunctionList(const ScopeModelItem &scopeItem,
AbstractMetaClass::Attributes *constructorAttributes,
AbstractMetaClass *currentClass)
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index b07ea0f0e..27f60904c 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -268,7 +268,7 @@ QString AbstractMetaType::pythonSignature() const
// PYSIDE-921: Handle container returntypes correctly.
// This is now a clean reimplementation.
if (m_cachedPythonSignature.isEmpty())
- m_cachedPythonSignature = formatPythonSignature(false);
+ m_cachedPythonSignature = formatPythonSignature();
return m_cachedPythonSignature;
}
@@ -2530,7 +2530,7 @@ QString AbstractMetaType::formatSignature(bool minimal) const
return result;
}
-QString AbstractMetaType::formatPythonSignature(bool minimal) const
+QString AbstractMetaType::formatPythonSignature() const
{
/*
* This is a version of the above, more suitable for Python.
@@ -2553,7 +2553,7 @@ QString AbstractMetaType::formatPythonSignature(bool minimal) const
result += package() + QLatin1Char('.');
if (isArray()) {
// Build nested array dimensions a[2][3] in correct order
- result += m_arrayElementType->formatPythonSignature(true);
+ result += m_arrayElementType->formatPythonSignature();
const int arrayPos = result.indexOf(QLatin1Char('['));
if (arrayPos != -1)
result.insert(arrayPos, formatArraySize(m_arrayElementCount));
@@ -2567,7 +2567,7 @@ QString AbstractMetaType::formatPythonSignature(bool minimal) const
for (int i = 0, size = m_instantiations.size(); i < size; ++i) {
if (i > 0)
result += QLatin1String(", ");
- result += m_instantiations.at(i)->formatPythonSignature(true);
+ result += m_instantiations.at(i)->formatPythonSignature();
}
result += QLatin1Char(']');
}
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index 3ef135cf9..01e146557 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -538,7 +538,7 @@ public:
private:
TypeUsagePattern determineUsagePattern() const;
QString formatSignature(bool minimal) const;
- QString formatPythonSignature(bool minimal) const;
+ QString formatPythonSignature() const;
const TypeEntry *m_typeEntry = nullptr;
AbstractMetaTypeList m_instantiations;
diff --git a/sources/shiboken2/ApiExtractor/apiextractor.cpp b/sources/shiboken2/ApiExtractor/apiextractor.cpp
index 78fa9e313..6d29ed1e0 100644
--- a/sources/shiboken2/ApiExtractor/apiextractor.cpp
+++ b/sources/shiboken2/ApiExtractor/apiextractor.cpp
@@ -166,24 +166,6 @@ ContainerTypeEntryList ApiExtractor::containerTypes() const
return TypeDatabase::instance()->containerTypes();
}
-static const AbstractMetaEnum* findEnumOnClasses(AbstractMetaClassList metaClasses, const EnumTypeEntry* typeEntry)
-{
- const AbstractMetaEnum *result = nullptr;
- for (const AbstractMetaClass* metaClass : qAsConst(metaClasses)) {
- const AbstractMetaEnumList &enums = metaClass->enums();
- for (const AbstractMetaEnum *metaEnum : enums) {
- if (metaEnum->typeEntry() == typeEntry) {
- result = metaEnum;
- break;
- }
- }
- if (result)
- break;
- result = findEnumOnClasses(metaClass->innerClasses(), typeEntry);
- }
- return result;
-}
-
const AbstractMetaEnum* ApiExtractor::findAbstractMetaEnum(const TypeEntry* typeEntry) const
{
return m_builder->findEnum(typeEntry);
diff --git a/sources/shiboken2/ApiExtractor/graph.cpp b/sources/shiboken2/ApiExtractor/graph.cpp
index 95a80197e..53e20ebba 100644
--- a/sources/shiboken2/ApiExtractor/graph.cpp
+++ b/sources/shiboken2/ApiExtractor/graph.cpp
@@ -101,7 +101,7 @@ bool Graph::containsEdge(int from, int to)
void Graph::addEdge(int from, int to)
{
- Q_ASSERT(to < (int)m_d->edges.size());
+ Q_ASSERT(to < m_d->edges.size());
m_d->edges[from].insert(to);
}
diff --git a/sources/shiboken2/ApiExtractor/reporthandler.cpp b/sources/shiboken2/ApiExtractor/reporthandler.cpp
index c0c323029..d83154ba8 100644
--- a/sources/shiboken2/ApiExtractor/reporthandler.cpp
+++ b/sources/shiboken2/ApiExtractor/reporthandler.cpp
@@ -35,7 +35,7 @@
#include <cstdarg>
#include <cstdio>
-#if _WINDOWS || NOCOLOR
+#if defined(_WINDOWS) || defined(NOCOLOR)
#define COLOR_END ""
#define COLOR_WHITE ""
#define COLOR_YELLOW ""
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index 2ac3fd356..8d162a732 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -228,7 +228,7 @@ struct ArgumentModification
struct Modification
{
- enum Modifiers {
+ enum Modifiers : uint {
InvalidModifier = 0x0000,
Private = 0x0001,
Protected = 0x0002,
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 47a15acd9..e2450e6b4 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -827,7 +827,7 @@ bool TypeSystemParser::endElement(const QStringRef &localName)
break;
default:
break; // nada
- };
+ }
break;
default:
break;
@@ -903,7 +903,7 @@ bool TypeSystemParser::characters(const String &ch)
break;
default:
Q_ASSERT(false);
- };
+ }
return true;
}
}
@@ -2857,7 +2857,7 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader)
break;
default:
Q_ASSERT(false);
- };
+ }
if (element->entry) {
if (!m_database->addType(element->entry, &m_error))