diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.68 2009/12/22 15:32:50 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.69 2010/03/13 15:55:42 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -115,10 +115,10 @@ static void freestack (lua_State *L) { | |||
115 | ** (Userdata cannot point directly to the function because pointer to | 115 | ** (Userdata cannot point directly to the function because pointer to |
116 | ** function is not compatible with void*.) | 116 | ** function is not compatible with void*.) |
117 | */ | 117 | */ |
118 | static int cpcall (lua_State *L) { | 118 | static int ccall (lua_State *L) { |
119 | lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); | 119 | lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); |
120 | lua_remove(L, 1); /* remove f from stack */ | 120 | lua_remove(L, 1); /* remove f from stack */ |
121 | /* restore original environment for 'cpcall' */ | 121 | /* restore original environment for 'ccall' */ |
122 | lua_pushglobaltable(L); | 122 | lua_pushglobaltable(L); |
123 | lua_replace(L, LUA_ENVIRONINDEX); | 123 | lua_replace(L, LUA_ENVIRONINDEX); |
124 | return f(L); | 124 | return f(L); |
@@ -138,11 +138,11 @@ static void init_registry (lua_State *L, global_State *g) { | |||
138 | /* registry[LUA_RIDX_MAINTHREAD] = L */ | 138 | /* registry[LUA_RIDX_MAINTHREAD] = L */ |
139 | setthvalue(L, &mt, L); | 139 | setthvalue(L, &mt, L); |
140 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_MAINTHREAD), &mt); | 140 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_MAINTHREAD), &mt); |
141 | /* registry[LUA_RIDX_CPCALL] = cpcall */ | 141 | /* registry[LUA_RIDX_CCALL] = ccall */ |
142 | cp = luaF_newCclosure(L, 0, g->l_gt); | 142 | cp = luaF_newCclosure(L, 0, g->l_gt); |
143 | cp->c.f = cpcall; | 143 | cp->c.f = ccall; |
144 | setclvalue(L, &mt, cp); | 144 | setclvalue(L, &mt, cp); |
145 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_CPCALL), &mt); | 145 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_CCALL), &mt); |
146 | /* registry[LUA_RIDX_GLOBALS] = l_gt */ | 146 | /* registry[LUA_RIDX_GLOBALS] = l_gt */ |
147 | sethvalue(L, &mt, g->l_gt); | 147 | sethvalue(L, &mt, g->l_gt); |
148 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_GLOBALS), &mt); | 148 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_GLOBALS), &mt); |