diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 13:32:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 13:32:59 -0300 |
commit | 0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b (patch) | |
tree | 0ac634fed90877130b1f102bf4075af999de2158 /loadlib.c | |
parent | 15231d4fb2f6984b25e0353ff46eda1a180b686d (diff) | |
download | lua-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 'loadlib.c')
-rw-r--r-- | loadlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -288,13 +288,13 @@ static void setpath (lua_State *L, const char *fieldname, | |||
288 | luaL_Buffer b; | 288 | luaL_Buffer b; |
289 | luaL_buffinit(L, &b); | 289 | luaL_buffinit(L, &b); |
290 | if (path < dftmark) { /* is there a prefix before ';;'? */ | 290 | if (path < dftmark) { /* is there a prefix before ';;'? */ |
291 | luaL_addlstring(&b, path, dftmark - path); /* add it */ | 291 | luaL_addlstring(&b, path, ct_diff2sz(dftmark - path)); /* add it */ |
292 | luaL_addchar(&b, *LUA_PATH_SEP); | 292 | luaL_addchar(&b, *LUA_PATH_SEP); |
293 | } | 293 | } |
294 | luaL_addstring(&b, dft); /* add default */ | 294 | luaL_addstring(&b, dft); /* add default */ |
295 | if (dftmark < path + len - 2) { /* is there a suffix after ';;'? */ | 295 | if (dftmark < path + len - 2) { /* is there a suffix after ';;'? */ |
296 | luaL_addchar(&b, *LUA_PATH_SEP); | 296 | luaL_addchar(&b, *LUA_PATH_SEP); |
297 | luaL_addlstring(&b, dftmark + 2, (path + len - 2) - dftmark); | 297 | luaL_addlstring(&b, dftmark + 2, ct_diff2sz((path + len - 2) - dftmark)); |
298 | } | 298 | } |
299 | luaL_pushresult(&b); | 299 | luaL_pushresult(&b); |
300 | } | 300 | } |
@@ -543,7 +543,7 @@ static int loadfunc (lua_State *L, const char *filename, const char *modname) { | |||
543 | mark = strchr(modname, *LUA_IGMARK); | 543 | mark = strchr(modname, *LUA_IGMARK); |
544 | if (mark) { | 544 | if (mark) { |
545 | int stat; | 545 | int stat; |
546 | openfunc = lua_pushlstring(L, modname, mark - modname); | 546 | openfunc = lua_pushlstring(L, modname, ct_diff2sz(mark - modname)); |
547 | openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc); | 547 | openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc); |
548 | stat = lookforfunc(L, filename, openfunc); | 548 | stat = lookforfunc(L, filename, openfunc); |
549 | if (stat != ERRFUNC) return stat; | 549 | if (stat != ERRFUNC) return stat; |
@@ -568,7 +568,7 @@ static int searcher_Croot (lua_State *L) { | |||
568 | const char *p = strchr(name, '.'); | 568 | const char *p = strchr(name, '.'); |
569 | int stat; | 569 | int stat; |
570 | if (p == NULL) return 0; /* is root */ | 570 | if (p == NULL) return 0; /* is root */ |
571 | lua_pushlstring(L, name, p - name); | 571 | lua_pushlstring(L, name, ct_diff2sz(p - name)); |
572 | filename = findfile(L, lua_tostring(L, -1), "cpath", LUA_CSUBSEP); | 572 | filename = findfile(L, lua_tostring(L, -1), "cpath", LUA_CSUBSEP); |
573 | if (filename == NULL) return 1; /* root not found */ | 573 | if (filename == NULL) return 1; /* root not found */ |
574 | if ((stat = loadfunc(L, filename, name)) != 0) { | 574 | if ((stat = loadfunc(L, filename, name)) != 0) { |