diff options
| author | Victor Stinner <vstinner@python.org> | 2022-06-20 16:04:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 16:04:52 +0200 |
| commit | 7ad6f74fcf9db1ccfeaf0986064870d8d3887300 (patch) | |
| tree | 2b140e0e4fdb3b58379887bab6ff68ade5c67c60 /Include/cpython/listobject.h | |
| parent | 61f24e7885bed096b5d7f75aff13c1001994b35a (diff) | |
| download | cpython-git-7ad6f74fcf9db1ccfeaf0986064870d8d3887300.tar.gz | |
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
Diffstat (limited to 'Include/cpython/listobject.h')
| -rw-r--r-- | Include/cpython/listobject.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/cpython/listobject.h b/Include/cpython/listobject.h index b094560cdc..8fa82122d8 100644 --- a/Include/cpython/listobject.h +++ b/Include/cpython/listobject.h @@ -36,7 +36,7 @@ static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) { } #define PyList_GET_SIZE(op) PyList_GET_SIZE(_PyObject_CAST(op)) -#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index]) +#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[(index)]) static inline void PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { @@ -44,4 +44,4 @@ PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { list->ob_item[index] = value; } #define PyList_SET_ITEM(op, index, value) \ - PyList_SET_ITEM(_PyObject_CAST(op), index, _PyObject_CAST(value)) + PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) |
