From 65a9ae9a853fa68ff997edbe3d6fd4eed022f1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Wed, 6 Nov 2024 11:10:03 +0100 Subject: limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE macros Removing old macros for compatibility with the limited api, and refactoring some of their usages Change-Id: I33954199d2ef9884c64b963863b97aed851c440f Pick-to: 6.8 Reviewed-by: Friedemann Kleint --- sources/pyside6/libpyside/dynamicqmetaobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sources/pyside6/libpyside/dynamicqmetaobject.cpp') diff --git a/sources/pyside6/libpyside/dynamicqmetaobject.cpp b/sources/pyside6/libpyside/dynamicqmetaobject.cpp index 94ce20226..95acab869 100644 --- a/sources/pyside6/libpyside/dynamicqmetaobject.cpp +++ b/sources/pyside6/libpyside/dynamicqmetaobject.cpp @@ -582,8 +582,8 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type) // This enforces registering of all signals and slots at type parsing time, and not later at // signal connection time, thus making sure no method indices change which would break // existing connections. - const PyObject *mro = type->tp_mro; - const Py_ssize_t basesCount = PyTuple_GET_SIZE(mro); + PyObject *mro = type->tp_mro; + const Py_ssize_t basesCount = PyTuple_Size(mro); std::vector basesToCheck; // Prepend the actual type that we are parsing. @@ -593,7 +593,7 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type) auto *sbkObjTypeF = SbkObject_TypeF(); auto *baseObjType = reinterpret_cast(&PyBaseObject_Type); for (Py_ssize_t i = 0; i < basesCount; ++i) { - auto *baseType = reinterpret_cast(PyTuple_GET_ITEM(mro, i)); + auto *baseType = reinterpret_cast(PyTuple_GetItem(mro, i)); if (baseType != sbkObjTypeF && baseType != baseObjType && !PySide::isQObjectDerived(baseType, false)) { basesToCheck.push_back(baseType); -- cgit v1.2.3