diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-11-09 15:56:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 15:56:48 (GMT) |
commit | d17a693fa08ce9f2d35acbb1f76e20bdae3e01da (patch) | |
tree | d3cd55ed960c8444a7411f1c21fc631ee19447c9 /Modules/_functoolsmodule.c | |
parent | 130893debfd97c70e3a89d9ba49892f53e6b9d79 (diff) | |
download | cpython-d17a693fa08ce9f2d35acbb1f76e20bdae3e01da.zip cpython-d17a693fa08ce9f2d35acbb1f76e20bdae3e01da.tar.gz cpython-d17a693fa08ce9f2d35acbb1f76e20bdae3e01da.tar.bz2 |
bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)
* _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the
first argument to PyTupleObject*. This internal macro is only usable if
Py_BUILD_CORE is defined.
* Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob).
* Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r-- | Modules/_functoolsmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 6c28b27..692c3b3 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -142,7 +142,7 @@ partial_fastcall(partialobject *pto, PyObject **args, Py_ssize_t nargs, stack = args; } else if (nargs == 0) { - stack = &PyTuple_GET_ITEM(pto->args, 0); + stack = _PyTuple_ITEMS(pto->args); } else { if (nargs2 <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) { @@ -159,7 +159,7 @@ partial_fastcall(partialobject *pto, PyObject **args, Py_ssize_t nargs, /* use borrowed references */ memcpy(stack, - &PyTuple_GET_ITEM(pto->args, 0), + _PyTuple_ITEMS(pto->args), pto_nargs * sizeof(PyObject*)); memcpy(&stack[pto_nargs], args, @@ -222,7 +222,7 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kwargs) if (pto->use_fastcall) { res = partial_fastcall(pto, - &PyTuple_GET_ITEM(args, 0), + _PyTuple_ITEMS(args), PyTuple_GET_SIZE(args), kwargs2); } |