From 42bec93e5c0fd114b2f4c3c498b35001d97a94c4 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 12 Mar 2004 16:38:17 +0000 Subject: Make PySequence_Fast_ITEMS public. (Thanks Skip.) --- Include/abstract.h | 2 +- Objects/listobject.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Include/abstract.h b/Include/abstract.h index bc9df05..17ce105 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -1016,7 +1016,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ need to be corrected for a negative index */ -#define _PySequence_Fast_ITEMS(sf) \ +#define PySequence_Fast_ITEMS(sf) \ (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \ : ((PyTupleObject *)(sf))->ob_item) /* Return a pointer to the underlying item array for diff --git a/Objects/listobject.c b/Objects/listobject.c index 9ee5756..3bda245 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -491,7 +491,7 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v) if(v_as_SF == NULL) return -1; n = PySequence_Fast_GET_SIZE(v_as_SF); - vitem = _PySequence_Fast_ITEMS(v_as_SF); + vitem = PySequence_Fast_ITEMS(v_as_SF); } if (ilow < 0) ilow = 0; @@ -686,7 +686,7 @@ listextend_internal(PyListObject *self, PyObject *b) } /* populate the end of self with b's items */ - src = _PySequence_Fast_ITEMS(b); + src = PySequence_Fast_ITEMS(b); dest = self->ob_item + selflen; for (i = 0; i < blen; i++) { PyObject *o = src[i]; @@ -2561,7 +2561,7 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value) PyMem_MALLOC(slicelength*sizeof(PyObject*)); selfitems = self->ob_item; - seqitems = _PySequence_Fast_ITEMS(seq); + seqitems = PySequence_Fast_ITEMS(seq); for (cur = start, i = 0; i < slicelength; cur += step, i++) { garbage[i] = selfitems[cur]; -- cgit v0.12