better name for `lua_movethread'

This commit is contained in:
Roberto Ierusalimschy 2002-11-07 13:39:23 -02:00
parent dff9be4224
commit 63633c5b5f
3 changed files with 9 additions and 9 deletions

4
lapi.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lapi.c,v 1.216 2002/11/06 19:08:00 roberto Exp roberto $ ** $Id: lapi.c,v 1.217 2002/11/07 15:37:10 roberto Exp roberto $
** Lua API ** Lua API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -105,7 +105,7 @@ LUA_API int lua_checkstack (lua_State *L, int size) {
} }
LUA_API void lua_movethread (lua_State *from, lua_State *to, int n) { LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
int i; int i;
lua_lock(to); lua_lock(to);
api_checknelems(from, n); api_checknelems(from, n);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lbaselib.c,v 1.103 2002/10/25 21:36:54 roberto Exp roberto $ ** $Id: lbaselib.c,v 1.104 2002/11/06 19:08:00 roberto Exp roberto $
** Basic library ** Basic library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -561,17 +561,17 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
int status; int status;
if (!lua_checkstack(co, narg)) if (!lua_checkstack(co, narg))
luaL_error(L, "too many arguments to resume"); luaL_error(L, "too many arguments to resume");
lua_movethread(L, co, narg); lua_xmove(L, co, narg);
status = lua_resume(co, narg); status = lua_resume(co, narg);
if (status == 0) { if (status == 0) {
int nres = lua_gettop(co); int nres = lua_gettop(co);
if (!lua_checkstack(L, narg)) if (!lua_checkstack(L, narg))
luaL_error(L, "too many results to resume"); luaL_error(L, "too many results to resume");
lua_movethread(co, L, nres); /* move yielded values */ lua_xmove(co, L, nres); /* move yielded values */
return nres; return nres;
} }
else { else {
lua_movethread(co, L, 1); /* move error message */ lua_xmove(co, L, 1); /* move error message */
return -1; /* error flag */ return -1; /* error flag */
} }
} }
@ -608,7 +608,7 @@ static int luaB_cocreate (lua_State *L) {
luaL_arg_check(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, luaL_arg_check(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1,
"Lua function expected"); "Lua function expected");
lua_pushvalue(L, 1); /* move function to top */ lua_pushvalue(L, 1); /* move function to top */
lua_movethread(L, NL, 1); /* move function from L to NL */ lua_xmove(L, NL, 1); /* move function from L to NL */
return 1; return 1;
} }

4
lua.h
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.h,v 1.161 2002/10/25 21:31:28 roberto Exp roberto $ ** $Id: lua.h,v 1.162 2002/11/06 19:08:00 roberto Exp roberto $
** Lua - An Extensible Extension Language ** Lua - An Extensible Extension Language
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
** http://www.lua.org mailto:info@lua.org ** http://www.lua.org mailto:info@lua.org
@ -123,7 +123,7 @@ LUA_API void lua_insert (lua_State *L, int idx);
LUA_API void lua_replace (lua_State *L, int idx); LUA_API void lua_replace (lua_State *L, int idx);
LUA_API int lua_checkstack (lua_State *L, int sz); LUA_API int lua_checkstack (lua_State *L, int sz);
LUA_API void lua_movethread (lua_State *from, lua_State *to, int n); LUA_API void lua_xmove (lua_State *from, lua_State *to, int n);
/* /*