aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-30 13:55:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-30 15:40:39 +0200
commit26e4ba3639bac57b0481bd6bb3964b1afa340ab9 (patch)
tree31ca8aff719267786a72104eace15b55d5fc4a38 /sources/shiboken2/generator/shiboken2/cppgenerator.cpp
parent46b43389c3f941415598db01cb8b19cc2450b424 (diff)
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 <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/cppgenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp22
1 files changed, 11 insertions, 11 deletions
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<void *>(" << 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<void *>(" << cpythonName << "__nonzero)},\n";
+ s << INDENT << "{Py_nb_long, reinterpret_cast<void *>(" << 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<void *>(" << cpythonName << "___invert__)},\n";
+ s << INDENT << "{Py_nb_and, reinterpret_cast<void *>(" << cpythonName << "___and__)},\n";
+ s << INDENT << "{Py_nb_xor, reinterpret_cast<void *>(" << cpythonName << "___xor__)},\n";
+ s << INDENT << "{Py_nb_or, reinterpret_cast<void *>(" << cpythonName << "___or__)},\n";
+ s << INDENT << "{Py_nb_int, reinterpret_cast<void *>(" << cpythonName << "_long)},\n";
+ s << INDENT << "{Py_nb_index, reinterpret_cast<void *>(" << cpythonName << "_long)},\n";
s << "#ifndef IS_PY3K\n";
- s << INDENT << "{Py_nb_long, (void *)" << cpythonName << "_long},\n";
+ s << INDENT << "{Py_nb_long, reinterpret_cast<void *>(" << 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);