aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/pysideqflags.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-06-16 12:05:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-24 11:25:31 +0200
commit380c65e62de0e60da667dc0d87935171b91b9c6c (patch)
tree480c872f247316a66e446ba196a5bd1a339a0bcd /sources/pyside2/libpyside/pysideqflags.cpp
parent992ff1f7925009b7ead6d6f005cafcf2e57ed44e (diff)
Cleanup pointer whitespace everywhere
Among other files to fix, basewrapper.(cpp|h) was full of uncommon pointer whitespace. After fixing that, I could not resist and fixed also libshiboken, generators, and after acceptance also PySide. Most of the time, this regex worked fine (\w\w+)([*&]+)[ ]*(?![&*]*[/=]) replaced with \1 \2 but everything was checked by hand. I did not touch the shiboken tests which are quite hairy. It turned out that inserting a space between a variable and asterisk causes a crash of shiboken, if the same line contains "CONVERTTOCPP". This was temporarily fixed by adding another space after it. Example.. sources/pyside2/PySide2/glue/qtcore.cpp line 977 QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj); //XXX /|\ omitting this space crashes shiboken! cppgenerator.cpp was special, since it was modified to _generate_ correct pointer whitespace. This caused a few testcases to fail, which had to be adjusted, again. This was difficult since some internal names must end on "*" and generated code normally not. Removing the last errors involved binary search on path sets... Apply C++ 11 fixits to the changed code, where applicable. Done-with: Friedemann.Kleint@qt.io Task-number: PYSIDE-1037 Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/libpyside/pysideqflags.cpp')
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index cb57031b0..fd0ed005f 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -47,8 +47,8 @@ extern "C" {
struct PySideQFlagsTypePrivate
{
- SbkConverter** converterPtr;
- SbkConverter* converter;
+ SbkConverter **converterPtr;
+ SbkConverter *converter;
};
/**
* Type of all QFlags
@@ -58,13 +58,13 @@ extern "C" {
PyTypeObject type;
};
- #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject*>(X)
+ #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject *>(X)
PyObject *PySideQFlagsNew(PyTypeObject *type, PyObject *args, PyObject * /* kwds */)
{
long val = 0;
if (PyTuple_GET_SIZE(args)) {
- PyObject* arg = PyTuple_GET_ITEM(args, 0);
+ PyObject *arg = PyTuple_GET_ITEM(args, 0);
if (Shiboken::isShibokenEnum(arg)) {// faster call
val = Shiboken::Enum::getValue(arg);
} else if (PyNumber_Check(arg)) {
@@ -75,18 +75,18 @@ extern "C" {
return 0;
}
}
- PySideQFlagsObject* self = PyObject_New(PySideQFlagsObject, type);
+ PySideQFlagsObject *self = PyObject_New(PySideQFlagsObject, type);
self->ob_value = val;
- return reinterpret_cast<PyObject*>(self);
+ return reinterpret_cast<PyObject *>(self);
}
- static long getNumberValue(PyObject* v)
+ static long getNumberValue(PyObject *v)
{
Shiboken::AutoDecRef number(PyNumber_Long(v));
return PyLong_AsLong(number);
}
- PyObject* PySideQFlagsRichCompare(PyObject* self, PyObject* other, int op)
+ PyObject *PySideQFlagsRichCompare(PyObject *self, PyObject *other, int op)
{
int result = 0;
if (!PyNumber_Check(other)) {
@@ -163,7 +163,7 @@ namespace QFlags
SbkNewQFlagsType_slots,
};
- PyTypeObject *create(const char* name, PyType_Slot numberMethods[])
+ PyTypeObject *create(const char *name, PyType_Slot numberMethods[])
{
char qualname[200];
// PYSIDE-747: Here we insert now the full class name.
@@ -183,7 +183,7 @@ namespace QFlags
PyTypeObject *type = (PyTypeObject *)PyType_FromSpec(newspec);
Py_TYPE(type) = &PyType_Type;
- PySideQFlagsType* flagsType = reinterpret_cast<PySideQFlagsType*>(type);
+ PySideQFlagsType *flagsType = reinterpret_cast<PySideQFlagsType *>(type);
PepType_PFTP(flagsType)->converterPtr = &PepType_PFTP(flagsType)->converter;
if (PyType_Ready(type) < 0)
@@ -192,14 +192,14 @@ namespace QFlags
return type;
}
- PySideQFlagsObject* newObject(long value, PyTypeObject* type)
+ PySideQFlagsObject *newObject(long value, PyTypeObject *type)
{
- PySideQFlagsObject* qflags = PyObject_New(PySideQFlagsObject, type);
+ PySideQFlagsObject *qflags = PyObject_New(PySideQFlagsObject, type);
qflags->ob_value = value;
return qflags;
}
- long getValue(PySideQFlagsObject* self)
+ long getValue(PySideQFlagsObject *self)
{
return self->ob_value;
}