diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-21 06:53:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 06:53:25 (GMT) |
commit | fff9a31a91283c39c363af219e595eab7d4da6f7 (patch) | |
tree | 0dfdec9e4e3e7caec6804bcc1fef1f2c19b9e532 /Objects/call.c | |
parent | c61ac1642d19f54c7b755098230967ad2e603180 (diff) | |
download | cpython-fff9a31a91283c39c363af219e595eab7d4da6f7.zip cpython-fff9a31a91283c39c363af219e595eab7d4da6f7.tar.gz cpython-fff9a31a91283c39c363af219e595eab7d4da6f7.tar.bz2 |
bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. (#748)
Diffstat (limited to 'Objects/call.c')
-rw-r--r-- | Objects/call.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Objects/call.c b/Objects/call.c index dd022ec..7890c13 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -321,11 +321,12 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, return function_code_fastcall(co, args, nargs, globals); } else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { + && co->co_argcount == PyTuple_GET_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); - return function_code_fastcall(co, args, Py_SIZE(argdefs), globals); + return function_code_fastcall(co, args, PyTuple_GET_SIZE(argdefs), + globals); } } @@ -364,7 +365,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + nd = PyTuple_GET_SIZE(argdefs); } else { d = NULL; @@ -406,11 +407,12 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject **stack, return function_code_fastcall(co, stack, nargs, globals); } else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { + && co->co_argcount == PyTuple_GET_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ stack = &PyTuple_GET_ITEM(argdefs, 0); - return function_code_fastcall(co, stack, Py_SIZE(argdefs), globals); + return function_code_fastcall(co, stack, PyTuple_GET_SIZE(argdefs), + globals); } } @@ -421,7 +423,7 @@ _PyFunction_FastCallKeywords(PyObject *func, PyObject **stack, if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + nd = PyTuple_GET_SIZE(argdefs); } else { d = NULL; |