aboutsummaryrefslogtreecommitdiff
path: root/lutf8lib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-27 13:32:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-07-27 13:32:59 -0300
commit0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b (patch)
tree0ac634fed90877130b1f102bf4075af999de2158 /lutf8lib.c
parent15231d4fb2f6984b25e0353ff46eda1a180b686d (diff)
downloadlua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.tar.gz
lua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.tar.bz2
lua-0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b.zip
Added gcc option '-Wconversion'
No warnings for standard numerical types. Still pending alternative numerical types.
Diffstat (limited to 'lutf8lib.c')
-rw-r--r--lutf8lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lutf8lib.c b/lutf8lib.c
index 243196c8..6dfdd1f4 100644
--- a/lutf8lib.c
+++ b/lutf8lib.c
@@ -180,7 +180,7 @@ static int byteoffset (lua_State *L) {
180 size_t len; 180 size_t len;
181 const char *s = luaL_checklstring(L, 1, &len); 181 const char *s = luaL_checklstring(L, 1, &len);
182 lua_Integer n = luaL_checkinteger(L, 2); 182 lua_Integer n = luaL_checkinteger(L, 2);
183 lua_Integer posi = (n >= 0) ? 1 : len + 1; 183 lua_Integer posi = (n >= 0) ? 1 : cast_st2S(len) + 1;
184 posi = u_posrelat(luaL_optinteger(L, 3, posi), len); 184 posi = u_posrelat(luaL_optinteger(L, 3, posi), len);
185 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 3, 185 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 3,
186 "position out of bounds"); 186 "position out of bounds");
@@ -239,7 +239,7 @@ static int iter_aux (lua_State *L, int strict) {
239 const char *next = utf8_decode(s + n, &code, strict); 239 const char *next = utf8_decode(s + n, &code, strict);
240 if (next == NULL || iscontp(next)) 240 if (next == NULL || iscontp(next))
241 return luaL_error(L, MSGInvalid); 241 return luaL_error(L, MSGInvalid);
242 lua_pushinteger(L, n + 1); 242 lua_pushinteger(L, l_castU2S(n + 1));
243 lua_pushinteger(L, code); 243 lua_pushinteger(L, code);
244 return 2; 244 return 2;
245 } 245 }