diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-01 08:54:56 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-01 08:54:56 -0300 |
commit | 798660c9cddef8a73f68058576e3d47eed2b1a27 (patch) | |
tree | a0aef60fd2f6910ea7ecf6be127f9035e9ce3e07 /ltests.c | |
parent | 34b6664dcb28b18ca3f08ed5e36da094b007eb7b (diff) | |
download | lua-798660c9cddef8a73f68058576e3d47eed2b1a27.tar.gz lua-798660c9cddef8a73f68058576e3d47eed2b1a27.tar.bz2 lua-798660c9cddef8a73f68058576e3d47eed2b1a27.zip |
deprecated "cast macros" ('luaL_checkint', 'luaL_optint', etc.)
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.184 2014/09/01 17:58:55 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.185 2014/09/04 18:15:29 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -530,7 +530,7 @@ static int listk (lua_State *L) { | |||
530 | 530 | ||
531 | static int listlocals (lua_State *L) { | 531 | static int listlocals (lua_State *L) { |
532 | Proto *p; | 532 | Proto *p; |
533 | int pc = luaL_checkint(L, 2) - 1; | 533 | int pc = (int)luaL_checkinteger(L, 2) - 1; |
534 | int i = 0; | 534 | int i = 0; |
535 | const char *name; | 535 | const char *name; |
536 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), | 536 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), |
@@ -659,7 +659,7 @@ static int stacklevel (lua_State *L) { | |||
659 | 659 | ||
660 | static int table_query (lua_State *L) { | 660 | static int table_query (lua_State *L) { |
661 | const Table *t; | 661 | const Table *t; |
662 | int i = luaL_optint(L, 2, -1); | 662 | int i = (int)luaL_optinteger(L, 2, -1); |
663 | luaL_checktype(L, 1, LUA_TTABLE); | 663 | luaL_checktype(L, 1, LUA_TTABLE); |
664 | t = hvalue(obj_at(L, 1)); | 664 | t = hvalue(obj_at(L, 1)); |
665 | if (i == -1) { | 665 | if (i == -1) { |
@@ -692,7 +692,7 @@ static int table_query (lua_State *L) { | |||
692 | 692 | ||
693 | static int string_query (lua_State *L) { | 693 | static int string_query (lua_State *L) { |
694 | stringtable *tb = &G(L)->strt; | 694 | stringtable *tb = &G(L)->strt; |
695 | int s = luaL_optint(L, 1, 0) - 1; | 695 | int s = (int)luaL_optinteger(L, 1, 0) - 1; |
696 | if (s == -1) { | 696 | if (s == -1) { |
697 | lua_pushinteger(L ,tb->size); | 697 | lua_pushinteger(L ,tb->size); |
698 | lua_pushinteger(L ,tb->nuse); | 698 | lua_pushinteger(L ,tb->nuse); |
@@ -723,21 +723,21 @@ static int tref (lua_State *L) { | |||
723 | 723 | ||
724 | static int getref (lua_State *L) { | 724 | static int getref (lua_State *L) { |
725 | int level = lua_gettop(L); | 725 | int level = lua_gettop(L); |
726 | lua_rawgeti(L, LUA_REGISTRYINDEX, luaL_checkint(L, 1)); | 726 | lua_rawgeti(L, LUA_REGISTRYINDEX, luaL_checkinteger(L, 1)); |
727 | lua_assert(lua_gettop(L) == level+1); | 727 | lua_assert(lua_gettop(L) == level+1); |
728 | return 1; | 728 | return 1; |
729 | } | 729 | } |
730 | 730 | ||
731 | static int unref (lua_State *L) { | 731 | static int unref (lua_State *L) { |
732 | int level = lua_gettop(L); | 732 | int level = lua_gettop(L); |
733 | luaL_unref(L, LUA_REGISTRYINDEX, luaL_checkint(L, 1)); | 733 | luaL_unref(L, LUA_REGISTRYINDEX, (int)luaL_checkinteger(L, 1)); |
734 | lua_assert(lua_gettop(L) == level); | 734 | lua_assert(lua_gettop(L) == level); |
735 | return 0; | 735 | return 0; |
736 | } | 736 | } |
737 | 737 | ||
738 | 738 | ||
739 | static int upvalue (lua_State *L) { | 739 | static int upvalue (lua_State *L) { |
740 | int n = luaL_checkint(L, 2); | 740 | int n = (int)luaL_checkinteger(L, 2); |
741 | luaL_checktype(L, 1, LUA_TFUNCTION); | 741 | luaL_checktype(L, 1, LUA_TFUNCTION); |
742 | if (lua_isnone(L, 3)) { | 742 | if (lua_isnone(L, 3)) { |
743 | const char *name = lua_getupvalue(L, 1, n); | 743 | const char *name = lua_getupvalue(L, 1, n); |
@@ -886,7 +886,7 @@ static int doremote (lua_State *L) { | |||
886 | 886 | ||
887 | 887 | ||
888 | static int int2fb_aux (lua_State *L) { | 888 | static int int2fb_aux (lua_State *L) { |
889 | int b = luaO_int2fb(luaL_checkint(L, 1)); | 889 | int b = luaO_int2fb((unsigned int)luaL_checkinteger(L, 1)); |
890 | lua_pushinteger(L, b); | 890 | lua_pushinteger(L, b); |
891 | lua_pushinteger(L, luaO_fb2int(b)); | 891 | lua_pushinteger(L, luaO_fb2int(b)); |
892 | return 2; | 892 | return 2; |
@@ -1389,7 +1389,7 @@ static int sethook (lua_State *L) { | |||
1389 | else { | 1389 | else { |
1390 | const char *scpt = luaL_checkstring(L, 1); | 1390 | const char *scpt = luaL_checkstring(L, 1); |
1391 | const char *smask = luaL_checkstring(L, 2); | 1391 | const char *smask = luaL_checkstring(L, 2); |
1392 | int count = luaL_optint(L, 3, 0); | 1392 | int count = (int)luaL_optinteger(L, 3, 0); |
1393 | int mask = 0; | 1393 | int mask = 0; |
1394 | if (strchr(smask, 'c')) mask |= LUA_MASKCALL; | 1394 | if (strchr(smask, 'c')) mask |= LUA_MASKCALL; |
1395 | if (strchr(smask, 'r')) mask |= LUA_MASKRET; | 1395 | if (strchr(smask, 'r')) mask |= LUA_MASKRET; |