diff options
author | Christian Tismer <tismer@stackless.com> | 2020-11-28 18:20:30 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-11-30 09:17:55 +0000 |
commit | d55a0ffb6b7ed154f5971c71b29621b532a394f5 (patch) | |
tree | dc0bf9773823c9fa42d5f2c7d506d9c3d98f530d | |
parent | 28aa3c4f6605a6331b12f47e03a9aba4aaefe201 (diff) |
cppgenerator: rework keyword handling regarding unknown.. augmented
The new keyword algorithm did fail on Windows.
There was a wrong calculation of the number of arguments left
over from the old algorithm. This was only visible on windows,
because it generates slightly different signatures for QtGui.QColor.
Change-Id: I5aee3e7c722c8365f86bf6196ab1fd3cf5bb46ad
Fixes: PYSIDE-1305
Pick-to: 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index e679efbbd..10c49d807 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -1843,9 +1843,6 @@ static const char *fullName = ")" << fullPythonFunctionName(rfunc, true) writeUnusedVariableCast(s, QLatin1String(PYTHON_TO_CPP_VAR)); } - if (usesNamedArguments && !rfunc->isCallOperator()) - s << "const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0);\n"; - if (initPythonArguments) { s << "const Py_ssize_t numArgs = "; if (minArgs == 0 && maxArgs == 1 && !rfunc->isConstructor() && !pythonFunctionWrapperUsesListOfArguments(overloadData)) @@ -2132,7 +2129,7 @@ void CppGenerator::writeArgumentsInitializer(TextStream &s, OverloadData &overlo bool ownerClassIsQObject = rfunc->ownerClass() && rfunc->ownerClass()->isQObject() && rfunc->isConstructor(); if (usesNamedArguments) { if (!ownerClassIsQObject) { - s << "if (numArgs" << (overloadData.hasArgumentWithDefaultValue() ? " + numNamedArgs" : "") << " > " << maxArgs << ") {\n"; + s << "if (numArgs > " << maxArgs << ") {\n"; { Indentation indent(s); s << "static PyObject *const too_many = " |