]> granicus.if.org Git - python/commitdiff
added PyList_GET_SIZE macro
authorBarry Warsaw <barry@python.org>
Mon, 6 Jan 1997 22:42:00 +0000 (22:42 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 6 Jan 1997 22:42:00 +0000 (22:42 +0000)
for both PyList_GET_SIZE and PyList_GET_ITEM, cast first argument to a
PyListObject*

Include/listobject.h

index d72475ed40d900fd3fdb44935a87ec140d7f5a54..c1bbcc17f5edae826cbb72fe9012c7dd28f973be 100644 (file)
@@ -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
 }