aboutsummaryrefslogtreecommitdiff
path: root/lstring.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 /lstring.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 'lstring.c')
-rw-r--r--lstring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lstring.c b/lstring.c
index 86ee2411..0c89a51b 100644
--- a/lstring.c
+++ b/lstring.c
@@ -164,7 +164,7 @@ size_t luaS_sizelngstr (size_t len, int kind) {
164/* 164/*
165** creates a new string object 165** creates a new string object
166*/ 166*/
167static TString *createstrobj (lua_State *L, size_t totalsize, int tag, 167static TString *createstrobj (lua_State *L, size_t totalsize, lu_byte tag,
168 unsigned h) { 168 unsigned h) {
169 TString *ts; 169 TString *ts;
170 GCObject *o; 170 GCObject *o;
@@ -233,7 +233,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
233 list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */ 233 list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
234 } 234 }
235 ts = createstrobj(L, sizestrshr(l), LUA_VSHRSTR, h); 235 ts = createstrobj(L, sizestrshr(l), LUA_VSHRSTR, h);
236 ts->shrlen = cast_byte(l); 236 ts->shrlen = cast(ls_byte, l);
237 getshrstr(ts)[l] = '\0'; /* ending 0 */ 237 getshrstr(ts)[l] = '\0'; /* ending 0 */
238 memcpy(getshrstr(ts), str, l * sizeof(char)); 238 memcpy(getshrstr(ts), str, l * sizeof(char));
239 ts->u.hnext = *list; 239 ts->u.hnext = *list;
@@ -283,7 +283,7 @@ TString *luaS_new (lua_State *L, const char *str) {
283} 283}
284 284
285 285
286Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue) { 286Udata *luaS_newudata (lua_State *L, size_t s, unsigned short nuvalue) {
287 Udata *u; 287 Udata *u;
288 int i; 288 int i;
289 GCObject *o; 289 GCObject *o;
@@ -301,7 +301,7 @@ Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue) {
301 301
302 302
303struct NewExt { 303struct NewExt {
304 int kind; 304 ls_byte kind;
305 const char *s; 305 const char *s;
306 size_t len; 306 size_t len;
307 TString *ts; /* output */ 307 TString *ts; /* output */