aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/shiboken
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-24 09:48:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-29 13:32:56 +0100
commitd37c69526fdf6cf79e8c2695c19460fbb12e833f (patch)
tree6a621924846b2e112f81628ff3d9142153055c3a /sources/shiboken6/generator/shiboken
parent51636b43d90bc29996f3bbd8372f333eb1a321d0 (diff)
shiboken6: Remove inline functions using QStringLiteral
Replace the formely used static inline QString foo() { return QStringLiteral("foo"); } by latin1 literals. Task-number: PYSIDE-2537 Change-Id: Ia4e9827e2b2a2f65f06751d549e8d79002386878 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/generator/shiboken')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp24
-rw-r--r--sources/shiboken6/generator/shiboken/ctypenames.h40
-rw-r--r--sources/shiboken6/generator/shiboken/overloaddata.cpp64
-rw-r--r--sources/shiboken6/generator/shiboken/pytypenames.h26
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp88
5 files changed, 120 insertions, 122 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 4d30c7ad2..aa1d587fd 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -130,7 +130,7 @@ const ProtocolEntries &mappingProtocols()
u"PyObject*"_s},
{u"__msetitem__"_s,
u"PyObject *self, PyObject *_key, PyObject *_value"_s,
- intT()}};
+ intT}};
return result;
}
@@ -147,16 +147,16 @@ const ProtocolEntries &sequenceProtocols()
u"PyObject*"_s},
{u"__setitem__"_s,
u"PyObject *self, Py_ssize_t _i, PyObject *_value"_s,
- intT()},
+ intT},
{u"__getslice__"_s,
u"PyObject *self, Py_ssize_t _i1, Py_ssize_t _i2"_s,
u"PyObject*"_s},
{u"__setslice__"_s,
u"PyObject *self, Py_ssize_t _i1, Py_ssize_t _i2, PyObject *_value"_s,
- intT()},
+ intT},
{u"__contains__"_s,
u"PyObject *self, PyObject *_value"_s,
- intT()},
+ intT},
{u"__concat__"_s,
u"PyObject *self, PyObject *_other"_s,
u"PyObject*"_s}
@@ -1258,7 +1258,7 @@ void CppGenerator::writeVirtualMethodNative(TextStream &s,
if (!func->isVoid()) {
- if (func->modifiedTypeName() != cPyObjectT()) {
+ if (func->modifiedTypeName() != cPyObjectT) {
s << "// Check return type\n";
@@ -2874,7 +2874,7 @@ void CppGenerator::writeOverloadedFunctionDecisorEngine(TextStream &s,
int sequenceArgCount = 0;
while (od && !od->argType().isVarargs()) {
const bool typeReplacedByPyObject = od->isTypeModified()
- && od->modifiedArgType().name() == cPyObjectT();
+ && od->modifiedArgType().name() == cPyObjectT;
if (!typeReplacedByPyObject) {
if (usePyArgs)
pyArgName = pythonArgsAt(od->argPos());
@@ -3141,10 +3141,10 @@ void CppGenerator::writeCppToPythonFunction(TextStream &s,
QString CppGenerator::containerNativeToTargetTypeName(const ContainerTypeEntryCPtr &type)
{
QString result = type->targetLangApiName();
- if (result != cPyObjectT()) {
+ if (result != cPyObjectT) {
result = containerCpythonBaseName(type);
- if (result == cPySequenceT())
- result = cPyListT();
+ if (result == cPySequenceT)
+ result = cPyListT;
}
return result;
}
@@ -4041,7 +4041,7 @@ void CppGenerator::writePrimitiveConverterInitialization(TextStream &s,
<< converter << " = Shiboken::Conversions::createConverter(";
if (!type->hasTargetLangApiType())
s << "nullptr";
- else if (type->targetLangApiName() == cPyObjectT())
+ else if (type->targetLangApiName() == cPyObjectT)
s << "&PyBaseObject_Type";
else
s << '&' << type->targetLangApiName() << "_Type";
@@ -4108,7 +4108,7 @@ QString CppGenerator::writeContainerConverterInitialization(TextStream &s,
const auto typeEntry = std::static_pointer_cast<const ContainerTypeEntry>(type.typeEntry());
const QString targetTypeName = containerNativeToTargetTypeName(typeEntry);
- if (targetTypeName == cPyObjectT()) {
+ if (targetTypeName == cPyObjectT) {
s << "&PyBaseObject_Type";
} else {
s << '&' << targetTypeName << "_Type";
@@ -5721,7 +5721,7 @@ QString CppGenerator::qObjectGetAttroFunction() const
{
static QString result;
if (result.isEmpty()) {
- auto qobjectClass = AbstractMetaClass::findClass(api().classes(), qObjectT());
+ auto qobjectClass = AbstractMetaClass::findClass(api().classes(), qObjectT);
Q_ASSERT(qobjectClass);
result = u"PySide::getHiddenDataFromQObject("_s
+ cpythonWrapperCPtr(qobjectClass, u"self"_s)
diff --git a/sources/shiboken6/generator/shiboken/ctypenames.h b/sources/shiboken6/generator/shiboken/ctypenames.h
index 0444c99f2..f665b30ff 100644
--- a/sources/shiboken6/generator/shiboken/ctypenames.h
+++ b/sources/shiboken6/generator/shiboken/ctypenames.h
@@ -6,26 +6,26 @@
#include <QtCore/QString>
-static inline QString boolT() { return QStringLiteral("bool"); }
-static inline QString intT() { return QStringLiteral("int"); }
-static inline QString unsignedT() { return QStringLiteral("unsigned"); }
-static inline QString unsignedIntT() { return QStringLiteral("unsigned int"); }
-static inline QString longT() { return QStringLiteral("long"); }
-static inline QString unsignedLongT() { return QStringLiteral("unsigned long"); }
-static inline QString shortT() { return QStringLiteral("short"); }
-static inline QString unsignedShortT() { return QStringLiteral("unsigned short"); }
-static inline QString unsignedCharT() { return QStringLiteral("unsigned char"); }
-static inline QString longLongT() { return QStringLiteral("long long"); }
-static inline QString unsignedLongLongT() { return QStringLiteral("unsigned long long"); }
-static inline QString charT() { return QStringLiteral("char"); }
-static inline QString floatT() { return QStringLiteral("float"); }
-static inline QString doubleT() { return QStringLiteral("double"); }
-static inline QString constCharPtrT() { return QStringLiteral("const char*"); }
+constexpr auto boolT = QLatin1StringView("bool");
+constexpr auto intT = QLatin1StringView("int");
+constexpr auto unsignedT = QLatin1StringView("unsigned");
+constexpr auto unsignedIntT = QLatin1StringView("unsigned int");
+constexpr auto longT = QLatin1StringView("long");
+constexpr auto unsignedLongT = QLatin1StringView("unsigned long");
+constexpr auto shortT = QLatin1StringView("short");
+constexpr auto unsignedShortT = QLatin1StringView("unsigned short");
+constexpr auto unsignedCharT = QLatin1StringView("unsigned char");
+constexpr auto longLongT = QLatin1StringView("long long");
+constexpr auto unsignedLongLongT = QLatin1StringView("unsigned long long");
+constexpr auto charT = QLatin1StringView("char");
+constexpr auto floatT = QLatin1StringView("float");
+constexpr auto doubleT = QLatin1StringView("double");
+constexpr auto constCharPtrT = QLatin1StringView("const char*");
-static inline QString qByteArrayT() { return QStringLiteral("QByteArray"); }
-static inline QString qMetaObjectT() { return QStringLiteral("QMetaObject"); }
-static inline QString qObjectT() { return QStringLiteral("QObject"); }
-static inline QString qStringT() { return QStringLiteral("QString"); }
-static inline QString qVariantT() { return QStringLiteral("QVariant"); }
+constexpr auto qByteArrayT = QLatin1StringView("QByteArray");
+constexpr auto qMetaObjectT = QLatin1StringView("QMetaObject");
+constexpr auto qObjectT = QLatin1StringView("QObject");
+constexpr auto qStringT = QLatin1StringView("QString");
+constexpr auto qVariantT = QLatin1StringView("QVariant");
#endif // CTYPENAMES_H
diff --git a/sources/shiboken6/generator/shiboken/overloaddata.cpp b/sources/shiboken6/generator/shiboken/overloaddata.cpp
index c1e965fec..c28fcdc1a 100644
--- a/sources/shiboken6/generator/shiboken/overloaddata.cpp
+++ b/sources/shiboken6/generator/shiboken/overloaddata.cpp
@@ -135,10 +135,10 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
// Primitive types that are not int, long, short,
// char and their respective unsigned counterparts.
- static const QStringList nonIntegerPrimitives{floatT(), doubleT(), boolT()};
+ static const QStringList nonIntegerPrimitives{floatT, doubleT, boolT};
// Signed integer primitive types.
- static const QStringList signedIntegerPrimitives{intT(), shortT(), longT(), longLongT()};
+ static const QStringList signedIntegerPrimitives{intT, shortT, longT, longLongT};
// sort the children overloads
for (const auto &ov : std::as_const(m_children))
@@ -162,15 +162,15 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
it.value().append(ov);
}
- if (!checkPyObject && typeName == cPyObjectT())
+ if (!checkPyObject && typeName == cPyObjectT)
checkPyObject = true;
- else if (!checkPySequence && typeName == cPySequenceT())
+ else if (!checkPySequence && typeName == cPySequenceT)
checkPySequence = true;
- else if (!checkPyBuffer && typeName == cPyBufferT())
+ else if (!checkPyBuffer && typeName == cPyBufferT)
checkPyBuffer = true;
- else if (!checkQVariant && typeName == qVariantT())
+ else if (!checkQVariant && typeName == qVariantT)
checkQVariant = true;
- else if (!checkQString && typeName == qStringT())
+ else if (!checkQString && typeName == qStringT)
checkQString = true;
for (const auto &instantiation : ov->argType().instantiations()) {
@@ -196,9 +196,9 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
// Create the graph of type dependencies based on implicit conversions.
// All C++ primitive types, add any forgotten type AT THE END OF THIS LIST!
- static const QStringList primitiveTypes{intT(), unsignedIntT(), longT(), unsignedLongT(),
- shortT(), unsignedShortT(), boolT(), unsignedCharT(), charT(), floatT(),
- doubleT(), constCharPtrT()};
+ static const QStringList primitiveTypes{intT, unsignedIntT, longT, unsignedLongT,
+ shortT, unsignedShortT, boolT, unsignedCharT, charT, floatT,
+ doubleT, constCharPtrT};
QStringList foundPrimitiveTypeIds;
for (const auto &p : primitiveTypes) {
@@ -207,7 +207,7 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
}
if (checkPySequence && checkPyObject)
- graph.addEdge(cPySequenceT(), cPyObjectT());
+ graph.addEdge(cPySequenceT, cPyObjectT);
QStringList classesWithIntegerImplicitConversion;
@@ -226,7 +226,7 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
else
convertibleType = getTypeName(function->arguments().constFirst().type());
- if (convertibleType == intT() || convertibleType == unsignedIntT())
+ if (convertibleType == intT || convertibleType == unsignedIntT)
classesWithIntegerImplicitConversion << targetTypeEntryName;
if (!graph.hasNode(convertibleType))
@@ -288,28 +288,28 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
if ((checkPySequence || checkPyObject || checkPyBuffer)
- && !targetTypeEntryName.contains(cPyObjectT())
- && !targetTypeEntryName.contains(cPyBufferT())
- && !targetTypeEntryName.contains(cPySequenceT())) {
+ && !targetTypeEntryName.contains(cPyObjectT)
+ && !targetTypeEntryName.contains(cPyBufferT)
+ && !targetTypeEntryName.contains(cPySequenceT)) {
if (checkPySequence) {
// PySequence will be checked after all more specific types, but before PyObject.
- graph.addEdge(targetTypeEntryName, cPySequenceT());
+ graph.addEdge(targetTypeEntryName, cPySequenceT);
} else if (checkPyBuffer) {
// PySequence will be checked after all more specific types, but before PyObject.
- graph.addEdge(targetTypeEntryName, cPyBufferT());
+ graph.addEdge(targetTypeEntryName, cPyBufferT);
} else {
// Add dependency on PyObject, so its check is the last one (too generic).
- graph.addEdge(targetTypeEntryName, cPyObjectT());
+ graph.addEdge(targetTypeEntryName, cPyObjectT);
}
- } else if (checkQVariant && targetTypeEntryName != qVariantT()) {
- if (!graph.containsEdge(qVariantT(), targetTypeEntryName)) // Avoid cyclic dependency.
- graph.addEdge(targetTypeEntryName, qVariantT());
+ } else if (checkQVariant && targetTypeEntryName != qVariantT) {
+ if (!graph.containsEdge(qVariantT, targetTypeEntryName)) // Avoid cyclic dependency.
+ graph.addEdge(targetTypeEntryName, qVariantT);
} else if (checkQString && ov->argType().isPointer()
- && targetTypeEntryName != qStringT()
- && targetTypeEntryName != qByteArrayT()
- && (!checkPyObject || targetTypeEntryName != cPyObjectT())) {
- if (!graph.containsEdge(qStringT(), targetTypeEntryName)) // Avoid cyclic dependency.
- graph.addEdge(targetTypeEntryName, qStringT());
+ && targetTypeEntryName != qStringT
+ && targetTypeEntryName != qByteArrayT
+ && (!checkPyObject || targetTypeEntryName != cPyObjectT)) {
+ if (!graph.containsEdge(qStringT, targetTypeEntryName)) // Avoid cyclic dependency.
+ graph.addEdge(targetTypeEntryName, qStringT);
}
if (targetType.isEnum()) {
@@ -320,14 +320,14 @@ void OverloadDataRootNode::sortNextOverloads(const ApiExtractorResult &api)
}
// QByteArray args need to be checked after QString args
- if (graph.hasNode(qStringT()) && graph.hasNode(qByteArrayT()))
- graph.addEdge(qStringT(), qByteArrayT());
+ if (graph.hasNode(qStringT) && graph.hasNode(qByteArrayT))
+ graph.addEdge(qStringT, qByteArrayT);
static const Edge rangeOrder[] =
- {{doubleT(), floatT()},
- {longLongT(), longT()}, {longLongT(), intT()}, {intT(), shortT()},
- {unsignedLongLongT(), unsignedLongT()}, {unsignedLongLongT(), unsignedT()},
- {unsignedLongLongT(), unsignedIntT()}, {unsignedT(), unsignedShortT()}
+ {{doubleT, floatT},
+ {longLongT, longT}, {longLongT, intT}, {intT, shortT},
+ {unsignedLongLongT, unsignedLongT}, {unsignedLongLongT, unsignedT},
+ {unsignedLongLongT, unsignedIntT}, {unsignedT, unsignedShortT}
};
for (const auto &r : rangeOrder) {
if (graph.hasNode(r.first) && graph.hasNode(r.second))
diff --git a/sources/shiboken6/generator/shiboken/pytypenames.h b/sources/shiboken6/generator/shiboken/pytypenames.h
index 696e0d88d..6c7658ff6 100644
--- a/sources/shiboken6/generator/shiboken/pytypenames.h
+++ b/sources/shiboken6/generator/shiboken/pytypenames.h
@@ -6,24 +6,24 @@
#include <QtCore/QString>
-static inline QString pyBoolT() { return QStringLiteral("PyBool"); }
-static inline QString pyFloatT() { return QStringLiteral("PyFloat"); }
-static inline QString pyLongT() { return QStringLiteral("PyLong"); }
-static inline QString pyObjectT() { return QStringLiteral("object"); }
-static inline QString pyStrT() { return QStringLiteral("str"); }
+constexpr auto pyBoolT = QLatin1StringView ("PyBool");
+constexpr auto pyFloatT = QLatin1StringView ("PyFloat");
+constexpr auto pyLongT = QLatin1StringView ("PyLong");
+constexpr auto pyObjectT = QLatin1StringView ("object");
+constexpr auto pyStrT = QLatin1StringView ("str");
// PYSIDE-1499: A custom type determined by existence of an `__fspath__` attribute.
-static inline QString pyPathLikeT() { return QStringLiteral("PyPathLike"); }
+constexpr auto pyPathLikeT = QLatin1StringView ("PyPathLike");
-static inline QString cPyBufferT() { return QStringLiteral("PyBuffer"); }
-static inline QString cPyListT() { return QStringLiteral("PyList"); }
-static inline QString cPyObjectT() { return QStringLiteral("PyObject"); }
-static inline QString cPySequenceT() { return QStringLiteral("PySequence"); }
-static inline QString cPyTypeObjectT() { return QStringLiteral("PyTypeObject"); }
+constexpr auto cPyBufferT = QLatin1StringView ("PyBuffer");
+constexpr auto cPyListT = QLatin1StringView ("PyList");
+constexpr auto cPyObjectT = QLatin1StringView ("PyObject");
+constexpr auto cPySequenceT = QLatin1StringView ("PySequence");
+constexpr auto cPyTypeObjectT = QLatin1StringView ("PyTypeObject");
// numpy
-static inline QString cPyArrayObjectT() { return QStringLiteral("PyArrayObject"); }
+constexpr auto cPyArrayObjectT = QLatin1StringView ("PyArrayObject");
-static inline QString sbkCharT() { return QStringLiteral("SbkChar"); }
+constexpr auto sbkCharT = QLatin1StringView ("SbkChar");
#endif // PYTYPENAMES_H
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index d4a9e0031..766fa863f 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -163,32 +163,32 @@ ShibokenGenerator::~ShibokenGenerator() = default;
static const QHash<QString, QString> &primitiveTypesCorrespondences()
{
static const QHash<QString, QString> result = {
- {u"bool"_s, pyBoolT()},
- {u"char"_s, sbkCharT()},
- {u"signed char"_s, sbkCharT()},
- {u"unsigned char"_s, sbkCharT()},
- {intT(), pyLongT()},
- {u"signed int"_s, pyLongT()},
- {u"uint"_s, pyLongT()},
- {u"unsigned int"_s, pyLongT()},
- {shortT(), pyLongT()},
- {u"ushort"_s, pyLongT()},
- {u"signed short"_s, pyLongT()},
- {u"signed short int"_s, pyLongT()},
- {unsignedShortT(), pyLongT()},
- {u"unsigned short int"_s, pyLongT()},
- {longT(), pyLongT()},
- {doubleT(), pyFloatT()},
- {floatT(), pyFloatT()},
- {u"unsigned long"_s, pyLongT()},
- {u"signed long"_s, pyLongT()},
- {u"ulong"_s, pyLongT()},
- {u"unsigned long int"_s, pyLongT()},
- {u"long long"_s, pyLongT()},
- {u"__int64"_s, pyLongT()},
- {u"unsigned long long"_s, pyLongT()},
- {u"unsigned __int64"_s, pyLongT()},
- {u"size_t"_s, pyLongT()}
+ {u"bool"_s, pyBoolT},
+ {u"char"_s, sbkCharT},
+ {u"signed char"_s, sbkCharT},
+ {u"unsigned char"_s, sbkCharT},
+ {intT, pyLongT},
+ {u"signed int"_s, pyLongT},
+ {u"uint"_s, pyLongT},
+ {u"unsigned int"_s, pyLongT},
+ {shortT, pyLongT},
+ {u"ushort"_s, pyLongT},
+ {u"signed short"_s, pyLongT},
+ {u"signed short int"_s, pyLongT},
+ {unsignedShortT, pyLongT},
+ {u"unsigned short int"_s, pyLongT},
+ {longT, pyLongT},
+ {doubleT, pyFloatT},
+ {floatT, pyFloatT},
+ {u"unsigned long"_s, pyLongT},
+ {u"signed long"_s, pyLongT},
+ {u"ulong"_s, pyLongT},
+ {u"unsigned long int"_s, pyLongT},
+ {u"long long"_s, pyLongT},
+ {u"__int64"_s, pyLongT},
+ {u"unsigned long long"_s, pyLongT},
+ {u"unsigned __int64"_s, pyLongT},
+ {u"size_t"_s, pyLongT}
};
return result;
}
@@ -198,18 +198,18 @@ const QHash<QString, QChar> &ShibokenGenerator::formatUnits()
static const QHash<QString, QChar> result = {
{u"char"_s, u'b'},
{u"unsigned char"_s, u'B'},
- {intT(), u'i'},
+ {intT, u'i'},
{u"unsigned int"_s, u'I'},
- {shortT(), u'h'},
- {unsignedShortT(), u'H'},
- {longT(), u'l'},
- {unsignedLongLongT(), u'k'},
- {longLongT(), u'L'},
+ {shortT, u'h'},
+ {unsignedShortT, u'H'},
+ {longT, u'l'},
+ {unsignedLongLongT, u'k'},
+ {longLongT, u'L'},
{u"__int64"_s, u'L'},
- {unsignedLongLongT(), u'K'},
+ {unsignedLongLongT, u'K'},
{u"unsigned __int64"_s, u'K'},
- {doubleT(), u'd'},
- {floatT(), u'f'},
+ {doubleT, u'd'},
+ {floatT, u'f'},
};
return result;
}
@@ -639,7 +639,7 @@ QString ShibokenGenerator::containerCpythonBaseName(const ContainerTypeEntryCPtr
default:
Q_ASSERT(false);
}
- return cPySequenceT();
+ return cPySequenceT;
}
QString ShibokenGenerator::cpythonBaseName(const TypeEntryCPtr &type)
@@ -659,7 +659,7 @@ QString ShibokenGenerator::cpythonBaseName(const TypeEntryCPtr &type)
const auto ctype = std::static_pointer_cast<const ContainerTypeEntry>(type);
baseName = containerCpythonBaseName(ctype);
} else {
- baseName = cPyObjectT();
+ baseName = cPyObjectT;
}
return baseName.replace(u"::"_s, u"_"_s);
}
@@ -741,8 +741,6 @@ QString ShibokenGenerator::cpythonTypeNameExt(const AbstractMetaType &type)
+ getTypeIndexVariableName(type) + u']';
}
-static inline QString unknownOperator() { return QStringLiteral("__UNKNOWN_OPERATOR__"); }
-
QString ShibokenGenerator::fixedCppTypeName(const TargetToNativeConversion &toNative)
{
if (toNative.sourceType())
@@ -791,7 +789,7 @@ QString ShibokenGenerator::pythonOperatorFunctionName(const AbstractMetaFunction
QString op = Generator::pythonOperatorFunctionName(func->originalName());
if (op.isEmpty()) {
qCWarning(lcShiboken).noquote().nospace() << msgUnknownOperator(func.get());
- return unknownOperator();
+ return "__UNKNOWN_OPERATOR__"_L1;
}
if (func->arguments().isEmpty()) {
if (op == u"__sub__")
@@ -808,8 +806,8 @@ QString ShibokenGenerator::pythonOperatorFunctionName(const AbstractMetaFunction
bool ShibokenGenerator::isNumber(const QString &cpythonApiName)
{
- return cpythonApiName == pyFloatT() || cpythonApiName == pyLongT()
- || cpythonApiName == pyBoolT();
+ return cpythonApiName == pyFloatT || cpythonApiName == pyLongT
+ || cpythonApiName == pyBoolT;
}
static std::optional<TypeSystem::CPythonType>
@@ -856,7 +854,7 @@ bool ShibokenGenerator::isPyInt(const TypeEntryCPtr &type)
if (!cPythonTypeOpt.has_value()) {
const auto &mapping = primitiveTypesCorrespondences();
const auto it = mapping.constFind(pte->name());
- return it != mapping.cend() && it.value() == pyLongT();
+ return it != mapping.cend() && it.value() == pyLongT;
}
return cPythonTypeOpt.value() == TypeSystem::CPythonType::Integer;
}
@@ -1768,7 +1766,7 @@ void ShibokenGenerator::replaceConverterTypeSystemVariable(TypeSystemConverterVa
case TypeSystemCheckFunction:
conversion = cpythonCheckFunction(conversionType);
if (conversionType.typeEntry()->isPrimitive()
- && (conversionType.typeEntry()->name() == cPyObjectT()
+ && (conversionType.typeEntry()->name() == cPyObjectT
|| !conversion.endsWith(u' '))) {
conversion += u'(';
break;
@@ -1844,7 +1842,7 @@ ShibokenGenerator::AttroCheck ShibokenGenerator::checkAttroFunctionNeeds(
FunctionQueryOption::GetAttroFunction)) {
result |= AttroCheckFlag::GetattroUser;
}
- if (usePySideExtensions() && metaClass->qualifiedCppName() == qObjectT())
+ if (usePySideExtensions() && metaClass->qualifiedCppName() == qObjectT)
result |= AttroCheckFlag::SetattroQObject;
if (useOverrideCaching(metaClass))
result |= AttroCheckFlag::SetattroMethodOverride;