]> granicus.if.org Git - python/commitdiff
bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)
authorVictor Stinner <vstinner@redhat.com>
Mon, 30 Apr 2018 21:51:02 +0000 (23:51 +0200)
committerŁukasz Langa <lukasz@langa.pl>
Mon, 30 Apr 2018 21:51:02 +0000 (14:51 -0700)
ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.

Python/ast.c

index e2092f0f85433e95cc690b03cc5399b448f61d81..0d692ffd95bd1d4711922ab7ac2b5910f7e651a4 100644 (file)
@@ -4313,7 +4313,7 @@ fstring_fix_node_location(const node *parent, node *n, char *expr_str)
                     break;
                 start--;
             }
-            cols += substr - start;
+            cols += (int)(substr - start);
             /* Fix lineno in mulitline strings. */
             while ((substr = strchr(substr + 1, '\n')))
                 lines--;