mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
added PyList_GET_SIZE macro
for both PyList_GET_SIZE and PyList_GET_ITEM, cast first argument to a PyListObject*
This commit is contained in:
parent
e0548b8da7
commit
1f2bd07aed
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue