diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 15:13:21 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-27 15:13:21 -0300 |
commit | f2206b2abe848f65956fa48da338c2bfac599e4a (patch) | |
tree | 94c1a856ec06846ad7485648ccafb429b5ca1b9b /ltests.c | |
parent | 0acd55898d0aaae8dbc14c8a1bc1e3bdffc8701b (diff) | |
download | lua-f2206b2abe848f65956fa48da338c2bfac599e4a.tar.gz lua-f2206b2abe848f65956fa48da338c2bfac599e4a.tar.bz2 lua-f2206b2abe848f65956fa48da338c2bfac599e4a.zip |
'-Wconversion' extended to all options of Lua numbers
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -1040,14 +1040,14 @@ static int table_query (lua_State *L) { | |||
1040 | 1040 | ||
1041 | static int query_GCparams (lua_State *L) { | 1041 | static int query_GCparams (lua_State *L) { |
1042 | global_State *g = G(L); | 1042 | global_State *g = G(L); |
1043 | lua_pushinteger(L, gettotalobjs(g)); | 1043 | lua_pushinteger(L, cast(lua_Integer, gettotalobjs(g))); |
1044 | lua_pushinteger(L, g->GCdebt); | 1044 | lua_pushinteger(L, cast(lua_Integer, g->GCdebt)); |
1045 | lua_pushinteger(L, applygcparam(g, MINORMUL, 100)); | 1045 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, MINORMUL, 100))); |
1046 | lua_pushinteger(L, applygcparam(g, MAJORMINOR, 100)); | 1046 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, MAJORMINOR, 100))); |
1047 | lua_pushinteger(L, applygcparam(g, MINORMAJOR, 100)); | 1047 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, MINORMAJOR, 100))); |
1048 | lua_pushinteger(L, applygcparam(g, PAUSE, 100)); | 1048 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, PAUSE, 100))); |
1049 | lua_pushinteger(L, applygcparam(g, STEPMUL, 100)); | 1049 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, STEPMUL, 100))); |
1050 | lua_pushinteger(L, applygcparam(g, STEPSIZE, 100)); | 1050 | lua_pushinteger(L, cast(lua_Integer, applygcparam(g, STEPSIZE, 100))); |
1051 | return 8; | 1051 | return 8; |
1052 | } | 1052 | } |
1053 | 1053 | ||
@@ -1062,7 +1062,7 @@ static int test_codeparam (lua_State *L) { | |||
1062 | static int test_applyparam (lua_State *L) { | 1062 | static int test_applyparam (lua_State *L) { |
1063 | lua_Integer p = luaL_checkinteger(L, 1); | 1063 | lua_Integer p = luaL_checkinteger(L, 1); |
1064 | lua_Integer x = luaL_checkinteger(L, 2); | 1064 | lua_Integer x = luaL_checkinteger(L, 2); |
1065 | lua_pushinteger(L, luaO_applyparam(cast_byte(p), x)); | 1065 | lua_pushinteger(L, cast(lua_Integer, luaO_applyparam(cast_byte(p), x))); |
1066 | return 1; | 1066 | return 1; |
1067 | } | 1067 | } |
1068 | 1068 | ||
@@ -1162,7 +1162,7 @@ static int pushuserdata (lua_State *L) { | |||
1162 | 1162 | ||
1163 | 1163 | ||
1164 | static int udataval (lua_State *L) { | 1164 | static int udataval (lua_State *L) { |
1165 | lua_pushinteger(L, cast(long, lua_touserdata(L, 1))); | 1165 | lua_pushinteger(L, cast(lua_Integer, cast(size_t, lua_touserdata(L, 1)))); |
1166 | return 1; | 1166 | return 1; |
1167 | } | 1167 | } |
1168 | 1168 | ||
@@ -1199,7 +1199,7 @@ static int num2int (lua_State *L) { | |||
1199 | 1199 | ||
1200 | 1200 | ||
1201 | static int makeseed (lua_State *L) { | 1201 | static int makeseed (lua_State *L) { |
1202 | lua_pushinteger(L, luaL_makeseed(L)); | 1202 | lua_pushinteger(L, cast(lua_Integer, luaL_makeseed(L))); |
1203 | return 1; | 1203 | return 1; |
1204 | } | 1204 | } |
1205 | 1205 | ||
@@ -1486,7 +1486,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1486 | const char *inst = getstring; | 1486 | const char *inst = getstring; |
1487 | if EQ("") return 0; | 1487 | if EQ("") return 0; |
1488 | else if EQ("absindex") { | 1488 | else if EQ("absindex") { |
1489 | lua_pushnumber(L1, lua_absindex(L1, getindex)); | 1489 | lua_pushinteger(L1, lua_absindex(L1, getindex)); |
1490 | } | 1490 | } |
1491 | else if EQ("append") { | 1491 | else if EQ("append") { |
1492 | int t = getindex; | 1492 | int t = getindex; |
@@ -1538,7 +1538,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1538 | } | 1538 | } |
1539 | else if EQ("func2num") { | 1539 | else if EQ("func2num") { |
1540 | lua_CFunction func = lua_tocfunction(L1, getindex); | 1540 | lua_CFunction func = lua_tocfunction(L1, getindex); |
1541 | lua_pushinteger(L1, cast(lua_Integer, func)); | 1541 | lua_pushinteger(L1, cast(lua_Integer, cast(size_t, func))); |
1542 | } | 1542 | } |
1543 | else if EQ("getfield") { | 1543 | else if EQ("getfield") { |
1544 | int t = getindex; | 1544 | int t = getindex; |
@@ -1901,7 +1901,7 @@ static int Cfunc (lua_State *L) { | |||
1901 | static int Cfunck (lua_State *L, int status, lua_KContext ctx) { | 1901 | static int Cfunck (lua_State *L, int status, lua_KContext ctx) { |
1902 | lua_pushstring(L, statcodes[status]); | 1902 | lua_pushstring(L, statcodes[status]); |
1903 | lua_setglobal(L, "status"); | 1903 | lua_setglobal(L, "status"); |
1904 | lua_pushinteger(L, ctx); | 1904 | lua_pushinteger(L, cast(lua_Integer, ctx)); |
1905 | lua_setglobal(L, "ctx"); | 1905 | lua_setglobal(L, "ctx"); |
1906 | return runC(L, L, lua_tostring(L, cast_int(ctx))); | 1906 | return runC(L, L, lua_tostring(L, cast_int(ctx))); |
1907 | } | 1907 | } |