Skip to content

Commit 2208134

Browse files
authored
bpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning (GH-19779)
1 parent 4386b90 commit 2208134

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Parser/pegen/pegen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,13 +597,13 @@ _PyPegen_fill_token(Parser *p)
597597

598598
int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno;
599599
const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start;
600-
size_t end_lineno = p->tok->lineno;
601-
size_t col_offset = -1, end_col_offset = -1;
600+
int end_lineno = p->tok->lineno;
601+
int col_offset = -1, end_col_offset = -1;
602602
if (start != NULL && start >= line_start) {
603-
col_offset = start - line_start;
603+
col_offset = (int)(start - line_start);
604604
}
605605
if (end != NULL && end >= p->tok->line_start) {
606-
end_col_offset = end - p->tok->line_start;
606+
end_col_offset = (int)(end - p->tok->line_start);
607607
}
608608

609609
t->lineno = p->starting_lineno + lineno;

0 commit comments

Comments
 (0)