Fix compiler warnings on Windows 64-bit in grammar.c

INT_MAX states and labels should be enough for everyone
This commit is contained in:
Victor Stinner 2013-11-18 01:07:38 +01:00
parent 6dd0d461a4
commit 3a8a333942
1 changed files with 2 additions and 2 deletions

View File

@ -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 */