]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix Windows compiler warning in tokenize.c (GH-8359)
authorVictor Stinner <vstinner@redhat.com>
Sat, 21 Jul 2018 01:36:06 +0000 (03:36 +0200)
committerGitHub <noreply@github.com>
Sat, 21 Jul 2018 01:36:06 +0000 (03:36 +0200)
Fix the following warning on Windows:

parser\tokenizer.c(1297): warning C4244: 'function': conversion from
'__int64' to 'int', possible loss of data.

Parser/tokenizer.c

index f8b83c9f3d7fe4611d9e6aee3a4abc5a22323257..6566fdead3807f2482bdf633816339177d6e1607 100644 (file)
@@ -1294,7 +1294,7 @@ syntaxerror(struct tok_state *tok, const char *format, ...)
     va_end(vargs);
     PyErr_SyntaxLocationObject(tok->filename,
                                tok->lineno,
-                               tok->cur - tok->line_start);
+                               (int)(tok->cur - tok->line_start));
     tok->done = E_ERROR;
 #else
     tok->done = E_TOKEN;