diff options
| author | Cristián Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2024-11-06 11:10:03 +0100 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-11-08 14:22:56 +0000 |
| commit | c028e13050b30344b060fe39e578153bd827c9ca (patch) | |
| tree | fdb97ec7223fd84d49545b282f855a555b5e7fb8 /sources/pyside6/libpyside/pysideproperty.cpp | |
| parent | ea6075cf00675f5e6ca111dbd11d3d6c739d0971 (diff) | |
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
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 65a9ae9a853fa68ff997edbe3d6fd4eed022f1a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/libpyside/pysideproperty.cpp')
| -rw-r--r-- | sources/pyside6/libpyside/pysideproperty.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp index bbc289231..7c0400051 100644 --- a/sources/pyside6/libpyside/pysideproperty.cpp +++ b/sources/pyside6/libpyside/pysideproperty.cpp @@ -99,7 +99,7 @@ PyObject *PySidePropertyPrivate::getValue(PyObject *source) const if (fget) { Shiboken::AutoDecRef args(PyTuple_New(1)); Py_INCREF(source); - PyTuple_SET_ITEM(args, 0, source); + PyTuple_SetItem(args, 0, source); return PyObject_CallObject(fget, args); } return nullptr; @@ -109,8 +109,8 @@ int PySidePropertyPrivate::setValue(PyObject *source, PyObject *value) { if (fset && value) { Shiboken::AutoDecRef args(PyTuple_New(2)); - PyTuple_SET_ITEM(args, 0, source); - PyTuple_SET_ITEM(args, 1, value); + PyTuple_SetItem(args, 0, source); + PyTuple_SetItem(args, 1, value); Py_INCREF(source); Py_INCREF(value); Shiboken::AutoDecRef result(PyObject_CallObject(fset, args)); @@ -118,7 +118,7 @@ int PySidePropertyPrivate::setValue(PyObject *source, PyObject *value) } if (fdel) { Shiboken::AutoDecRef args(PyTuple_New(1)); - PyTuple_SET_ITEM(args, 0, source); + PyTuple_SetItem(args, 0, source); Py_INCREF(source); Shiboken::AutoDecRef result(PyObject_CallObject(fdel, args)); return (result.isNull() ? -1 : 0); @@ -132,7 +132,7 @@ int PySidePropertyPrivate::reset(PyObject *source) if (freset) { Shiboken::AutoDecRef args(PyTuple_New(1)); Py_INCREF(source); - PyTuple_SET_ITEM(args, 0, source); + PyTuple_SetItem(args, 0, source); Shiboken::AutoDecRef result(PyObject_CallObject(freset, args)); return (result.isNull() ? -1 : 0); } @@ -456,9 +456,9 @@ static PyObject *getFromType(PyTypeObject *type, PyObject *name) auto *attr = PyDict_GetItem(tpDict.object(), name); if (!attr) { PyObject *bases = type->tp_bases; - const Py_ssize_t size = PyTuple_GET_SIZE(bases); + const Py_ssize_t size = PyTuple_Size(bases); for (Py_ssize_t i = 0; i < size; ++i) { - PyObject *base = PyTuple_GET_ITEM(bases, i); + PyObject *base = PyTuple_GetItem(bases, i); attr = getFromType(reinterpret_cast<PyTypeObject *>(base), name); if (attr) return attr; |
