bpo-20291: Fix MSVC warnings in getargs.c (GH-27211)

* Fix MSVC warnings in getargs.c

* apply suggestions

Co-Authored-By: Batuhan Taskaya <batuhan@python.org>

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
This commit is contained in:
Ken Jin 2021-07-17 19:09:18 +08:00 committed by GitHub
parent 689b05c628
commit f88e138a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2552,7 +2552,8 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
}
/* copy keyword args using kwtuple to drive process */
for (i = Py_MAX((int)nargs, posonly) - varargssize; i < maxargs; i++) {
for (i = Py_MAX((int)nargs, posonly) -
Py_SAFE_DOWNCAST(varargssize, Py_ssize_t, int); i < maxargs; i++) {
if (nkwargs) {
keyword = PyTuple_GET_ITEM(kwtuple, i - posonly);
if (kwargs != NULL) {