aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-16 10:02:41 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-16 10:49:06 +0200
commitedafc6353a2b03eab3ee67735727a9e95c5b29af (patch)
treee224b3b74a7b9f18615666edbe4edbd1ecf64330 /sources
parent5b025c330c78abdaa13d38690c391021495a300e (diff)
shiboken2: Generate the num(Named)Args with the correct type
Fixes an integer conversion warning with MSVC2019. Change-Id: I932fc0237712e774f2791d412ed1e52e268d1b69 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 1932a7997..8e9883eaf 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -1704,10 +1704,10 @@ void CppGenerator::writeMethodWrapperPreamble(QTextStream &s, OverloadData &over
}
if (usesNamedArguments && !rfunc->isCallOperator())
- s << INDENT << "int numNamedArgs = (kwds ? PyDict_Size(kwds) : 0);\n";
+ s << INDENT << "const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0);\n";
if (initPythonArguments) {
- s << INDENT << "int numArgs = ";
+ s << INDENT << "const Py_ssize_t numArgs = ";
if (minArgs == 0 && maxArgs == 1 && !rfunc->isConstructor() && !pythonFunctionWrapperUsesListOfArguments(overloadData))
s << "(" << PYTHON_ARG << " == 0 ? 0 : 1);\n";
else