mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Use Py_ssize_t type for number of arguments
Issue #27848: use Py_ssize_t rather than C int for the number of function positional and keyword arguments.
This commit is contained in:
parent
c532b3c1ce
commit
74319ae219
7 changed files with 131 additions and 93 deletions
|
|
@ -146,15 +146,20 @@ PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwds)
|
|||
}
|
||||
|
||||
PyObject *
|
||||
_PyCFunction_FastCallDict(PyObject *func_obj, PyObject **args, int nargs,
|
||||
_PyCFunction_FastCallDict(PyObject *func_obj, PyObject **args, Py_ssize_t nargs,
|
||||
PyObject *kwargs)
|
||||
{
|
||||
PyCFunctionObject* func = (PyCFunctionObject*)func_obj;
|
||||
PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
|
||||
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
|
||||
PyObject *self = PyCFunction_GET_SELF(func);
|
||||
PyObject *result;
|
||||
int flags;
|
||||
|
||||
assert(func != NULL);
|
||||
assert(nargs >= 0);
|
||||
assert(nargs == 0 || args != NULL);
|
||||
assert(kwargs == NULL || PyDict_Check(kwargs));
|
||||
|
||||
/* _PyCFunction_FastCallDict() must not be called with an exception set,
|
||||
because it may clear it (directly or indirectly) and so the
|
||||
caller loses its exception */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue