From 26e4ba3639bac57b0481bd6bb3964b1afa340ab9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Sep 2020 13:55:22 +0200 Subject: Fix up the generated flag operator methods Remove space and use reinterpret_cast. Task-number: PYSIDE-1326 Change-Id: I1adfc545c97278eb7da01aec550cb6e2e15945ba Reviewed-by: Cristian Maureira-Fredes --- .../shiboken2/generator/shiboken2/cppgenerator.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sources/shiboken2/generator/shiboken2/cppgenerator.cpp') diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 8de293654..1ae1c72b4 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -5064,19 +5064,19 @@ void CppGenerator::writeFlagsNumberMethodsDefinition(QTextStream &s, const Abstr s << "static PyType_Slot " << cpythonName << "_number_slots[] = {\n"; s << "#ifdef IS_PY3K\n"; - s << INDENT << "{Py_nb_bool, (void *)" << cpythonName << "__nonzero},\n"; + s << INDENT << "{Py_nb_bool, reinterpret_cast(" << cpythonName << "__nonzero)},\n"; s << "#else\n"; - s << INDENT << "{Py_nb_nonzero, (void *)" << cpythonName << "__nonzero},\n"; - s << INDENT << "{Py_nb_long, (void *)" << cpythonName << "_long},\n"; + s << INDENT << "{Py_nb_nonzero, reinterpret_cast(" << cpythonName << "__nonzero)},\n"; + s << INDENT << "{Py_nb_long, reinterpret_cast(" << cpythonName << "_long)},\n"; s << "#endif\n"; - s << INDENT << "{Py_nb_invert, (void *)" << cpythonName << "___invert__},\n"; - s << INDENT << "{Py_nb_and, (void *)" << cpythonName << "___and__},\n"; - s << INDENT << "{Py_nb_xor, (void *)" << cpythonName << "___xor__},\n"; - s << INDENT << "{Py_nb_or, (void *)" << cpythonName << "___or__},\n"; - s << INDENT << "{Py_nb_int, (void *)" << cpythonName << "_long},\n"; - s << INDENT << "{Py_nb_index, (void *)" << cpythonName << "_long},\n"; + s << INDENT << "{Py_nb_invert, reinterpret_cast(" << cpythonName << "___invert__)},\n"; + s << INDENT << "{Py_nb_and, reinterpret_cast(" << cpythonName << "___and__)},\n"; + s << INDENT << "{Py_nb_xor, reinterpret_cast(" << cpythonName << "___xor__)},\n"; + s << INDENT << "{Py_nb_or, reinterpret_cast(" << cpythonName << "___or__)},\n"; + s << INDENT << "{Py_nb_int, reinterpret_cast(" << cpythonName << "_long)},\n"; + s << INDENT << "{Py_nb_index, reinterpret_cast(" << cpythonName << "_long)},\n"; s << "#ifndef IS_PY3K\n"; - s << INDENT << "{Py_nb_long, (void *)" << cpythonName << "_long},\n"; + s << INDENT << "{Py_nb_long, reinterpret_cast(" << cpythonName << "_long)},\n"; s << "#endif\n"; s << INDENT << "{0, " << NULL_PTR << "} // sentinel\n"; s << "};\n\n"; @@ -5088,7 +5088,7 @@ void CppGenerator::writeFlagsBinaryOperator(QTextStream &s, const AbstractMetaEn FlagsTypeEntry *flagsEntry = cppEnum->typeEntry()->flags(); Q_ASSERT(flagsEntry); - s << "PyObject * " << cpythonEnumName(cppEnum) << "___" << pyOpName + s << "PyObject *" << cpythonEnumName(cppEnum) << "___" << pyOpName << "__(PyObject *self, PyObject *" << PYTHON_ARG << ")\n{\n"; AbstractMetaType *flagsType = buildAbstractMetaTypeFromTypeEntry(flagsEntry); -- cgit v1.2.3