[Python-checkins] cpython: Fix compiler warnings on Windows 64-bit in grammar.c

victor.stinner python-checkins at python.org
Mon Nov 18 01:08:12 CET 2013


http://hg.python.org/cpython/rev/ac4272df1af6
changeset:   87229:ac4272df1af6
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Nov 18 01:07:38 2013 +0100
summary:
  Fix compiler warnings on Windows 64-bit in grammar.c

INT_MAX states and labels should be enough for everyone

files:
  Parser/grammar.c |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Parser/grammar.c b/Parser/grammar.c
--- a/Parser/grammar.c
+++ b/Parser/grammar.c
@@ -63,7 +63,7 @@
     s->s_upper = 0;
     s->s_accel = NULL;
     s->s_accept = 0;
-    return s - d->d_state;
+    return Py_SAFE_DOWNCAST(s - d->d_state, Py_intptr_t, int);
 }
 
 void
@@ -105,7 +105,7 @@
     if (Py_DebugFlag)
         printf("Label @ %8p, %d: %s\n", ll, ll->ll_nlabels,
                PyGrammar_LabelRepr(lb));
-    return lb - ll->ll_label;
+    return Py_SAFE_DOWNCAST(lb - ll->ll_label, Py_intptr_t, int);
 }
 
 /* Same, but rather dies than adds */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list