aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-19 18:04:17 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-19 18:04:17 -0300
commitcaf74dd7314761f8e1bd512dde19db7705eccd0a (patch)
treede1b351b3d91e3f7a1e6c5386e51a2ce62084831
parent62840c5fadafe0abe8b524601f0367db297c0653 (diff)
downloadlua-caf74dd7314761f8e1bd512dde19db7705eccd0a.tar.gz
lua-caf74dd7314761f8e1bd512dde19db7705eccd0a.tar.bz2
lua-caf74dd7314761f8e1bd512dde19db7705eccd0a.zip
'cpcall' renamed to 'ccall' as it does not do a protected call
-rw-r--r--lauxlib.c4
-rw-r--r--lstate.c12
-rw-r--r--lua.h4
3 files changed, 10 insertions, 10 deletions
diff --git a/lauxlib.c b/lauxlib.c
index c0d7fb5c..81fdc18d 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.202 2010/03/12 18:59:32 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.203 2010/03/17 21:37:37 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -789,7 +789,7 @@ LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) {
789LUALIB_API int luaL_cpcall (lua_State *L, lua_CFunction f, int nargs, 789LUALIB_API int luaL_cpcall (lua_State *L, lua_CFunction f, int nargs,
790 int nresults) { 790 int nresults) {
791 nargs++; /* to include function itself */ 791 nargs++; /* to include function itself */
792 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_CPCALL); 792 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_CCALL);
793 lua_insert(L, -nargs); 793 lua_insert(L, -nargs);
794 lua_pushlightuserdata(L, &f); 794 lua_pushlightuserdata(L, &f);
795 lua_insert(L, -nargs); 795 lua_insert(L, -nargs);
diff --git a/lstate.c b/lstate.c
index 9685f2a5..0362e22d 100644
--- a/lstate.c
+++ b/lstate.c
@@ -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*/
118static int cpcall (lua_State *L) { 118static 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);
diff --git a/lua.h b/lua.h
index 43bb8aec..17852e08 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.261 2010/01/11 17:15:11 roberto Exp roberto $ 2** $Id: lua.h,v 1.262 2010/03/13 03:57:46 roberto Exp roberto $
3** Lua - A Scripting Language 3** Lua - A Scripting Language
4** Lua.org, PUC-Rio, Brazil (http://www.lua.org) 4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** See Copyright Notice at the end of this file 5** See Copyright Notice at the end of this file
@@ -90,7 +90,7 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
90 90
91/* predefined values in the registry */ 91/* predefined values in the registry */
92#define LUA_RIDX_MAINTHREAD 1 92#define LUA_RIDX_MAINTHREAD 1
93#define LUA_RIDX_CPCALL 2 93#define LUA_RIDX_CCALL 2
94#define LUA_RIDX_GLOBALS 3 94#define LUA_RIDX_GLOBALS 3
95#define LUA_RIDX_LAST LUA_RIDX_GLOBALS 95#define LUA_RIDX_LAST LUA_RIDX_GLOBALS
96 96