X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/c6e89d48f2ba05dc1e2c1f85e1ebc36abc50de2e..8d2f989633404555a54fe35799412f2cd4cc82ee:/algorithms.c diff --git a/algorithms.c b/algorithms.c index 31bd95b..886c159 100644 --- a/algorithms.c +++ b/algorithms.c @@ -193,9 +193,9 @@ static PyObject *ksget_min(PyObject *me, void *hunoz) { PyObject *set = ((keyszset_pyobj *)me)->set; int i, n, y, x = -1; - n = PyTuple_Size(set); + n = PyTuple_GET_SIZE(set); for (i = 0; i < n; i++) { - y = PyInt_AsLong(PyTuple_GetItem(set, i)); + y = PyInt_AS_LONG(PyTuple_GET_ITEM(set, i)); if (x == -1 || y < x) x = y; } return (PyInt_FromLong(x)); @@ -205,9 +205,9 @@ static PyObject *ksget_max(PyObject *me, void *hunoz) { PyObject *set = ((keyszset_pyobj *)me)->set; int i, n, y, x = -1; - n = PyTuple_Size(set); + n = PyTuple_GET_SIZE(set); for (i = 0; i < n; i++) { - y = PyInt_AsLong(PyTuple_GetItem(set, i)); + y = PyInt_AS_LONG(PyTuple_GET_ITEM(set, i)); if (y > x) x = y; } return (PyInt_FromLong(x));