diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-10-02 13:45:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-10-02 13:45:03 -0300 |
commit | 15462edb0ff86bf1904011b29635420451cab2c5 (patch) | |
tree | 9a626d34736b830f83fda3f1b2f3342990a05b1f /lapi.c | |
parent | 6f936bc7931662d0460d47ad73eca308ba5fab2f (diff) | |
download | lua-15462edb0ff86bf1904011b29635420451cab2c5.tar.gz lua-15462edb0ff86bf1904011b29635420451cab2c5.tar.bz2 lua-15462edb0ff86bf1904011b29635420451cab2c5.zip |
new definitions for closure structures
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.149 2001/07/22 00:59:36 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.152 2001/09/07 17:39:10 roberto Exp $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -248,7 +248,7 @@ LUA_API size_t lua_strlen (lua_State *L, int index) { | |||
248 | 248 | ||
249 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index) { | 249 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index) { |
250 | StkId o = luaA_indexAcceptable(L, index); | 250 | StkId o = luaA_indexAcceptable(L, index); |
251 | return (o == NULL || !iscfunction(o)) ? NULL : clvalue(o)->u.c.f; | 251 | return (o == NULL || !iscfunction(o)) ? NULL : clvalue(o)->c.f; |
252 | } | 252 | } |
253 | 253 | ||
254 | 254 | ||
@@ -314,10 +314,10 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { | |||
314 | lua_lock(L); | 314 | lua_lock(L); |
315 | api_checknelems(L, n); | 315 | api_checknelems(L, n); |
316 | cl = luaF_newCclosure(L, n); | 316 | cl = luaF_newCclosure(L, n); |
317 | cl->u.c.f = fn; | 317 | cl->c.f = fn; |
318 | L->top -= n; | 318 | L->top -= n; |
319 | while (n--) | 319 | while (n--) |
320 | setobj(&cl->u.c.upvalue[n], L->top+n); | 320 | setobj(&cl->c.upvalue[n], L->top+n); |
321 | setclvalue(L->top, cl); | 321 | setclvalue(L->top, cl); |
322 | incr_top; | 322 | incr_top; |
323 | lua_unlock(L); | 323 | lua_unlock(L); |