From: Barry Warsaw Date: Mon, 6 Jan 1997 22:42:00 +0000 (+0000) Subject: added PyList_GET_SIZE macro X-Git-Tag: v1.5a1~580 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f2bd07aedaf656da01fea898753881f71c3c45d;p=python added PyList_GET_SIZE macro for both PyList_GET_SIZE and PyList_GET_ITEM, cast first argument to a PyListObject* --- diff --git a/Include/listobject.h b/Include/listobject.h index d72475ed40..c1bbcc17f5 100644 --- a/Include/listobject.h +++ b/Include/listobject.h @@ -73,7 +73,8 @@ extern int PyList_Reverse Py_PROTO((PyObject *)); extern PyObject *PyList_AsTuple Py_PROTO((PyObject *)); /* Macro, trading safety for speed */ -#define PyList_GET_ITEM(op, i) ((op)->ob_item[i]) +#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) +#define PyList_GET_SIZE(op) (((PyListObject *)(op))->ob_size) #ifdef __cplusplus }