Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a8a333

Browse files
committed
Fix compiler warnings on Windows 64-bit in grammar.c
INT_MAX states and labels should be enough for everyone
1 parent 6dd0d46 commit 3a8a333

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Parser/grammar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ addstate(dfa *d)
6363
s->s_upper = 0;
6464
s->s_accel = NULL;
6565
s->s_accept = 0;
66-
return s - d->d_state;
66+
return Py_SAFE_DOWNCAST(s - d->d_state, Py_intptr_t, int);
6767
}
6868

6969
void
@@ -105,7 +105,7 @@ addlabel(labellist *ll, int type, const char *str)
105105
if (Py_DebugFlag)
106106
printf("Label @ %8p, %d: %s\n", ll, ll->ll_nlabels,
107107
PyGrammar_LabelRepr(lb));
108-
return lb - ll->ll_label;
108+
return Py_SAFE_DOWNCAST(lb - ll->ll_label, Py_intptr_t, int);
109109
}
110110

111111
/* Same, but rather dies than adds */

0 commit comments

Comments
 (0)