Skip to content

Commit 1f2bd07

Browse files
committed
added PyList_GET_SIZE macro
for both PyList_GET_SIZE and PyList_GET_ITEM, cast first argument to a PyListObject*
1 parent e0548b8 commit 1f2bd07

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Include/listobject.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ extern int PyList_Reverse Py_PROTO((PyObject *));
7373
extern PyObject *PyList_AsTuple Py_PROTO((PyObject *));
7474

7575
/* Macro, trading safety for speed */
76-
#define PyList_GET_ITEM(op, i) ((op)->ob_item[i])
76+
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
77+
#define PyList_GET_SIZE(op) (((PyListObject *)(op))->ob_size)
7778

7879
#ifdef __cplusplus
7980
}

0 commit comments

Comments
 (0)