bpo-30459: Cast the result of PyList_SET_ITEM() to void (GH-19975)
Do the same for PyTuple_SET_ITEM().
This commit is contained in:
parent
29afab6c5f
commit
556d97f473
|
@ -30,5 +30,5 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
|
||||||
#define _PyList_CAST(op) (assert(PyList_Check(op)), (PyListObject *)(op))
|
#define _PyList_CAST(op) (assert(PyList_Check(op)), (PyListObject *)(op))
|
||||||
|
|
||||||
#define PyList_GET_ITEM(op, i) (_PyList_CAST(op)->ob_item[i])
|
#define PyList_GET_ITEM(op, i) (_PyList_CAST(op)->ob_item[i])
|
||||||
#define PyList_SET_ITEM(op, i, v) (_PyList_CAST(op)->ob_item[i] = (v))
|
#define PyList_SET_ITEM(op, i, v) ((void)(_PyList_CAST(op)->ob_item[i] = (v)))
|
||||||
#define PyList_GET_SIZE(op) Py_SIZE(_PyList_CAST(op))
|
#define PyList_GET_SIZE(op) Py_SIZE(_PyList_CAST(op))
|
||||||
|
|
|
@ -23,6 +23,6 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
|
||||||
#define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i])
|
#define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i])
|
||||||
|
|
||||||
/* Macro, *only* to be used to fill in brand new tuples */
|
/* Macro, *only* to be used to fill in brand new tuples */
|
||||||
#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v)
|
#define PyTuple_SET_ITEM(op, i, v) ((void)(_PyTuple_CAST(op)->ob_item[i] = v))
|
||||||
|
|
||||||
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
|
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Cast the result of :c:func:`PyList_SET_ITEM` and :c:func:`PyTuple_SET_ITEM`
|
||||||
|
to void.
|
Loading…
Reference in New Issue