aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-16 13:58:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-16 13:58:41 -0300
commit9ffae705ee8894d68bbc07a1a5f77a112c40efad (patch)
treee162bb7ecfd1a3e6776cf09e62736ec8eb0fca41 /ltests.c
parent6bfef60e77f5eec1057470010b4179ee6f830fe6 (diff)
downloadlua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.tar.gz
lua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.tar.bz2
lua-9ffae705ee8894d68bbc07a1a5f77a112c40efad.zip
new "primitive" getn
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ltests.c b/ltests.c
index 620b6a41..717e0c5e 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.19 2005/01/19 15:54:26 roberto Exp roberto $ 2** $Id: ltests.c,v 2.20 2005/02/18 12:40:02 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*/
@@ -456,11 +456,11 @@ static int listlocals (lua_State *L) {
456 456
457static int get_limits (lua_State *L) { 457static int get_limits (lua_State *L) {
458 lua_createtable(L, 0, 5); 458 lua_createtable(L, 0, 5);
459 setnameval(L, "BITS_INT", LUA_BITSINT); 459 setnameval(L, "BITS_INT", LUAI_BITSINT);
460 setnameval(L, "LFPF", LFIELDS_PER_FLUSH); 460 setnameval(L, "LFPF", LFIELDS_PER_FLUSH);
461 setnameval(L, "MAXVARS", MAXVARS); 461 setnameval(L, "MAXVARS", LUAI_MAXVARS);
462 setnameval(L, "MAXSTACK", MAXSTACK); 462 setnameval(L, "MAXSTACK", MAXSTACK);
463 setnameval(L, "MAXUPVALUES", MAXUPVALUES); 463 setnameval(L, "MAXUPVALUES", LUAI_MAXUPVALUES);
464 setnameval(L, "NUM_OPCODES", NUM_OPCODES); 464 setnameval(L, "NUM_OPCODES", NUM_OPCODES);
465 return 1; 465 return 1;
466} 466}
@@ -970,12 +970,14 @@ static int testC (lua_State *L) {
970 int i = getindex; 970 int i = getindex;
971 lua_pushinteger(L1, luaL_getn(L1, i)); 971 lua_pushinteger(L1, luaL_getn(L1, i));
972 } 972 }
973#ifndef luaL_setn
973 else if EQ("setn") { 974 else if EQ("setn") {
974 int i = getindex; 975 int i = getindex;
975 int n = cast(int, lua_tonumber(L1, -1)); 976 int n = cast(int, lua_tonumber(L1, -1));
976 luaL_setn(L1, i, n); 977 luaL_setn(L1, i, n);
977 lua_pop(L1, 1); 978 lua_pop(L1, 1);
978 } 979 }
980#endif
979 else if EQ("throw") { 981 else if EQ("throw") {
980#ifdef __cplusplus 982#ifdef __cplusplus
981static struct X { int x; } x; 983static struct X { int x; } x;