summaryrefslogtreecommitdiffstats
path: root/Include/listobject.h
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-01-06 22:42:00 (GMT)
committerBarry Warsaw <barry@python.org>1997-01-06 22:42:00 (GMT)
commit1f2bd07aedaf656da01fea898753881f71c3c45d (patch)
treed702eff7b6cfea0c42f0d7fcacf1d7856a5c6b35 /Include/listobject.h
parente0548b8da7a8f45d0f86d14864914357535e2cb6 (diff)
downloadcpython-1f2bd07aedaf656da01fea898753881f71c3c45d.zip
cpython-1f2bd07aedaf656da01fea898753881f71c3c45d.tar.gz
cpython-1f2bd07aedaf656da01fea898753881f71c3c45d.tar.bz2
added PyList_GET_SIZE macro
for both PyList_GET_SIZE and PyList_GET_ITEM, cast first argument to a PyListObject*
Diffstat (limited to 'Include/listobject.h')
-rw-r--r--Include/listobject.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/listobject.h b/Include/listobject.h
index d72475e..c1bbcc1 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
}