diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-13 16:20:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-13 16:20:40 -0300 |
commit | 0b63d79b36790febd4c081bf8d6737df27529f8d (patch) | |
tree | a59ac63d213b00fb0dcaaa65f6d24526c4f260f7 /ltests.c | |
parent | 279c3a6961c60252f0368fdea889caf977f85fe0 (diff) | |
download | lua-0b63d79b36790febd4c081bf8d6737df27529f8d.tar.gz lua-0b63d79b36790febd4c081bf8d6737df27529f8d.tar.bz2 lua-0b63d79b36790febd4c081bf8d6737df27529f8d.zip |
Details
- 'luaL_setfuncs' avoids creating closures for placeholders.
- Fixed some warnings about unused values in comma expressions.
- Comments.
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -51,9 +51,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc); | |||
51 | 51 | ||
52 | 52 | ||
53 | static void setnameval (lua_State *L, const char *name, int val) { | 53 | static void setnameval (lua_State *L, const char *name, int val) { |
54 | lua_pushstring(L, name); | ||
55 | lua_pushinteger(L, val); | 54 | lua_pushinteger(L, val); |
56 | lua_settable(L, -3); | 55 | lua_setfield(L, -2, name); |
57 | } | 56 | } |
58 | 57 | ||
59 | 58 | ||
@@ -710,12 +709,11 @@ static void printstack (lua_State *L) { | |||
710 | 709 | ||
711 | 710 | ||
712 | static int get_limits (lua_State *L) { | 711 | static int get_limits (lua_State *L) { |
713 | lua_createtable(L, 0, 5); | 712 | lua_createtable(L, 0, 6); |
714 | setnameval(L, "BITS_INT", LUAI_BITSINT); | 713 | setnameval(L, "IS32INT", LUAI_IS32INT); |
715 | setnameval(L, "MAXARG_Ax", MAXARG_Ax); | 714 | setnameval(L, "MAXARG_Ax", MAXARG_Ax); |
716 | setnameval(L, "MAXARG_Bx", MAXARG_Bx); | 715 | setnameval(L, "MAXARG_Bx", MAXARG_Bx); |
717 | setnameval(L, "OFFSET_sBx", OFFSET_sBx); | 716 | setnameval(L, "OFFSET_sBx", OFFSET_sBx); |
718 | setnameval(L, "BITS_INT", LUAI_BITSINT); | ||
719 | setnameval(L, "LFPF", LFIELDS_PER_FLUSH); | 717 | setnameval(L, "LFPF", LFIELDS_PER_FLUSH); |
720 | setnameval(L, "NUM_OPCODES", NUM_OPCODES); | 718 | setnameval(L, "NUM_OPCODES", NUM_OPCODES); |
721 | return 1; | 719 | return 1; |