diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-10 11:29:19 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-11 08:36:40 +0000 |
commit | a4311711eb89e3f9833a05edf3debdf7563a104f (patch) | |
tree | 257a50545359f81f7c17437003dc70f4ba74b835 /sources/shiboken6/libshiboken/sbkfeature_base.cpp | |
parent | 327cd3aa4da7d4a9c4ce593751fd3e385abba3f0 (diff) |
Define SbkObjectType to be a PyTypeObject
SbkObjectType was a struct embedding a PyTypeObject
after fec1611e9f42c1f0a13eb33474df2ed8ee480842.
Remove that and make the types equvivalent, which allows for
removing many reinterpret_casts.
SbkObjectType is left as a typedef for client code snippets.
[ChangeLog][shiboken6] SbkObjectType is now a typedef for PyTypeObject.
Task-number: PYSIDE-535
Change-Id: I44812311ccbbe0988c38e34c47d16f6874f8d1cf
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/libshiboken/sbkfeature_base.cpp')
-rw-r--r-- | sources/shiboken6/libshiboken/sbkfeature_base.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp index e015ac0c8..6b2037ecd 100644 --- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp +++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp @@ -162,26 +162,22 @@ int SbkObject_GenericSetAttr(PyObject *obj, PyObject *name, PyObject *value) // Caching the select Id. int SbkObjectType_GetReserved(PyTypeObject *type) { - auto *sbkType = reinterpret_cast<SbkObjectType *>(type); - return PepType_SOTP(sbkType)->pyside_reserved_bits; + return PepType_SOTP(type)->pyside_reserved_bits; } void SbkObjectType_SetReserved(PyTypeObject *type, int value) { - auto *sbkType = reinterpret_cast<SbkObjectType *>(type); - PepType_SOTP(sbkType)->pyside_reserved_bits = value; + PepType_SOTP(type)->pyside_reserved_bits = value; } const char **SbkObjectType_GetPropertyStrings(PyTypeObject *type) { - auto *sbkType = reinterpret_cast<SbkObjectType *>(type); - return PepType_SOTP(sbkType)->propertyStrings; + return PepType_SOTP(type)->propertyStrings; } void SbkObjectType_SetPropertyStrings(PyTypeObject *type, const char **strings) { - auto *sbkType = reinterpret_cast<SbkObjectType *>(type); - PepType_SOTP(sbkType)->propertyStrings = strings; + PepType_SOTP(type)->propertyStrings = strings; } // PYSIDE-1626: Enforcing a context switch without further action. |