From afdb19ac82bcb7ceabd010a484505105977352ba Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 14 Apr 2010 12:14:21 -0300 Subject: no more 'ccall' nor 'cpcall' functions. (With light C functions they are obsolete.) --- lstate.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 6be44a9b..78b776a6 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.78 2010/04/08 17:16:46 roberto Exp roberto $ +** $Id: lstate.c,v 2.79 2010/04/12 16:07:06 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -113,23 +113,10 @@ static void freestack (lua_State *L) { } -/* -** Calls the function in variable pointed to by userdata in first argument -** (Userdata cannot point directly to the function because pointer to -** function is not compatible with void*.) -*/ -static int ccall (lua_State *L) { - lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); - lua_remove(L, 1); /* remove f from stack */ - return f(L); -} - - /* ** Create registry table and its predefined values */ static void init_registry (lua_State *L, global_State *g) { - Closure *cp; TValue mt; /* create registry */ Table *registry = luaH_new(L); @@ -138,11 +125,6 @@ static void init_registry (lua_State *L, global_State *g) { /* registry[LUA_RIDX_MAINTHREAD] = L */ setthvalue(L, &mt, L); setobj2t(L, luaH_setint(L, registry, LUA_RIDX_MAINTHREAD), &mt); - /* registry[LUA_RIDX_CCALL] = ccall */ - cp = luaF_newCclosure(L, 0); - cp->c.f = ccall; - setclvalue(L, &mt, cp); - setobj2t(L, luaH_setint(L, registry, LUA_RIDX_CCALL), &mt); /* registry[LUA_RIDX_GLOBALS] = table of globals */ sethvalue(L, &mt, luaH_new(L)); setobj2t(L, luaH_setint(L, registry, LUA_RIDX_GLOBALS), &mt); -- cgit v1.2.3-55-g6feb