From d827e96f33056bcc0daca0c04b3273604f9d5986 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 8 May 2025 12:49:39 -0300 Subject: Using 'l_uint32' for unicode codepoints in scanner 'l_uint32' is enough for unicode codepoints (versus unsigned long), and the utf-8 library already uses that type. --- llex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 9d93224f..edeb48fe 100644 --- a/llex.c +++ b/llex.c @@ -359,12 +359,12 @@ static int readhexaesc (LexState *ls) { ** for error reporting in case of errors; 'i' counts the number of ** saved characters, so that they can be removed if case of success. */ -static unsigned long readutf8esc (LexState *ls) { - unsigned long r; +static l_uint32 readutf8esc (LexState *ls) { + l_uint32 r; int i = 4; /* number of chars to be removed: start with #"\u{X" */ save_and_next(ls); /* skip 'u' */ esccheck(ls, ls->current == '{', "missing '{'"); - r = cast_ulong(gethexa(ls)); /* must have at least one digit */ + r = cast_uint(gethexa(ls)); /* must have at least one digit */ while (cast_void(save_and_next(ls)), lisxdigit(ls->current)) { i++; esccheck(ls, r <= (0x7FFFFFFFu >> 4), "UTF-8 value too large"); -- cgit v1.2.3-55-g6feb