From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 20 Jun 2020 17:35:03 +0000 (-0700) Subject: bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970) X-Git-Tag: v3.9.0b4~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9f83c173b0cc62d6fcdc363e9ab05f6664ff8f3;p=thirdparty%2FPython%2Fcpython.git bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970) (cherry picked from commit 861efc6e8fe7f030b1e193989b13287b31385939) Co-authored-by: Lysandros Nikolaou --- diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index e63e5a8aed71..a1a59ae86caf 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -397,7 +397,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, } if (p->start_rule == Py_file_input) { - error_line = PyErr_ProgramTextObject(p->tok->filename, lineno); + error_line = PyErr_ProgramTextObject(p->tok->filename, (int) lineno); } if (!error_line) { diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index e459fc5edb3a..1c038aba4451 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -34,7 +34,7 @@ typedef struct _memo { typedef struct { int type; PyObject *bytes; - Py_ssize_t lineno, col_offset, end_lineno, end_col_offset; + int lineno, col_offset, end_lineno, end_col_offset; Memo *memo; } Token;