From 3a8a333942512657195679a49a91a1846f740928 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 18 Nov 2013 01:07:38 +0100 Subject: [PATCH] Fix compiler warnings on Windows 64-bit in grammar.c INT_MAX states and labels should be enough for everyone --- Parser/grammar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parser/grammar.c b/Parser/grammar.c index d4270de6b76..b598294a4aa 100644 --- a/Parser/grammar.c +++ b/Parser/grammar.c @@ -63,7 +63,7 @@ addstate(dfa *d) 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 @@ addlabel(labellist *ll, int type, const char *str) 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 */