aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-04 18:29:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-04 18:29:41 -0300
commit88c7b574cb5ac0402178b9c61fabe8fc50152e3c (patch)
tree742d781041b1981ec31015daf543b977d8f2366f /lapi.c
parent51bf91a9705ab38224f42464fb07da968758b0f7 (diff)
downloadlua-88c7b574cb5ac0402178b9c61fabe8fc50152e3c.tar.gz
lua-88c7b574cb5ac0402178b9c61fabe8fc50152e3c.tar.bz2
lua-88c7b574cb5ac0402178b9c61fabe8fc50152e3c.zip
`luaA_index' is a local macro now
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/lapi.c b/lapi.c
index 6f8037c5..44001697 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: lapi.c,v 1.174 2002/02/14 21:46:13 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -30,7 +30,7 @@ const char lua_ident[] =
30 30
31 31
32#ifndef api_check 32#ifndef api_check
33#define api_check(L, o) /* nothing */ 33#define api_check(L, o) ((void)1)
34#endif 34#endif
35 35
36#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->ci->base)) 36#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->ci->base))
@@ -57,14 +57,10 @@ static TObject *negindex (lua_State *L, int index) {
57} 57}
58 58
59 59
60TObject *luaA_index (lua_State *L, int index) { 60#define luaA_index(L, index) \
61 if (index > 0) { 61 ( (index > 0) ? \
62 api_check(L, index <= L->top - L->ci->base); 62 (api_check(L, index <= L->top - L->ci->base), L->ci->base+index-1) : \
63 return L->ci->base+index-1; 63 negindex(L, index))
64 }
65 else
66 return negindex(L, index);
67}
68 64
69 65
70static TObject *luaA_indexAcceptable (lua_State *L, int index) { 66static TObject *luaA_indexAcceptable (lua_State *L, int index) {