Browse Source

better name for `lua_movethread'

Roberto Ierusalimschy 23 năm trước cách đây
mục cha
commit
63633c5b5f
3 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 2 2
      lapi.c
  2. 5 5
      lbaselib.c
  3. 2 2
      lua.h

+ 2 - 2
lapi.c

@@ -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
 ** 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;
   lua_lock(to);
   api_checknelems(from, n);

+ 5 - 5
lbaselib.c

@@ -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
 ** See Copyright Notice in lua.h
 */
@@ -561,17 +561,17 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
   int status;
   if (!lua_checkstack(co, narg))
     luaL_error(L, "too many arguments to resume");
-  lua_movethread(L, co, narg);
+  lua_xmove(L, co, narg);
   status = lua_resume(co, narg);
   if (status == 0) {
     int nres = lua_gettop(co);
     if (!lua_checkstack(L, narg))
       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;
   }
   else {
-    lua_movethread(co, L, 1);  /* move error message */
+    lua_xmove(co, L, 1);  /* move error message */
     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,
     "Lua function expected");
   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;
 }
 

+ 2 - 2
lua.h

@@ -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
 ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
 ** http://www.lua.org	mailto:[email protected]
@@ -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 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);
 
 
 /*