소스 검색

new name for lua_equal(obj); LUA_NOOBJECT is equal to LUA_NOOBJECT

Roberto Ierusalimschy 26 년 전
부모
커밋
49af08e3e7
3개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 3
      lapi.c
  2. 2 2
      lbuiltin.c
  3. 3 3
      lua.h

+ 3 - 3
lapi.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lapi.c,v 1.57 1999/11/22 13:12:07 roberto Exp roberto $
+** $Id: lapi.c,v 1.58 1999/11/23 13:58:02 roberto Exp roberto $
 ** Lua API
 ** See Copyright Notice in lua.h
 */
@@ -240,8 +240,8 @@ int lua_isfunction (lua_State *L, lua_Object o) {
   return (t == LUA_T_PROTO) || (t == LUA_T_CPROTO);
 }
 
-int lua_equalobj (lua_State *L, lua_Object o1, lua_Object o2) {
-  if (o1 == LUA_NOOBJECT || o2 == LUA_NOOBJECT) return 0;
+int lua_equal(lua_State *L, lua_Object o1, lua_Object o2) {
+  if (o1 == LUA_NOOBJECT || o2 == LUA_NOOBJECT) return (o1 == o2);
   else return luaO_equalObj(Address(L, o1), Address(L, o2));
 }
 

+ 2 - 2
lbuiltin.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lbuiltin.c,v 1.75 1999/11/22 17:39:51 roberto Exp roberto $
+** $Id: lbuiltin.c,v 1.76 1999/11/26 18:53:03 roberto Exp roberto $
 ** Built-in functions
 ** See Copyright Notice in lua.h
 */
@@ -743,7 +743,7 @@ static void testC (lua_State *L) {
                    lua_pushnumber(L, n); break;
                  }
       case 'q' : { int n1=getnum(L, s); int n2=getnum(L, s);
-                   lua_pushnumber(L, lua_equalobj(L, reg[n1], reg[n2]));
+                   lua_pushnumber(L, lua_equal(L, reg[n1], reg[n2]));
                    break;
                  }
       default: luaL_verror(L, "unknown command in `testC': %c", *(s-1));

+ 3 - 3
lua.h

@@ -1,5 +1,5 @@
 /*
-** $Id: lua.h,v 1.38 1999/11/22 13:12:07 roberto Exp roberto $
+** $Id: lua.h,v 1.39 1999/11/25 18:44:02 roberto Exp roberto $
 ** Lua - An Extensible Extension Language
 ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
 ** e-mail: [email protected]
@@ -66,7 +66,7 @@ int            lua_isnumber (lua_State *L, lua_Object object);
 int            lua_isstring (lua_State *L, lua_Object object);
 int            lua_isfunction (lua_State *L, lua_Object object);
 
-int            lua_equalobj (lua_State *L, lua_Object o1, lua_Object o2);
+int            lua_equal (lua_State *L, lua_Object o1, lua_Object o2);
 
 double         lua_getnumber (lua_State *L, lua_Object object);
 const char    *lua_getstring (lua_State *L, lua_Object object);
@@ -179,7 +179,7 @@ extern lua_State *lua_state;
 #define lua_isnumber(object)	(lua_isnumber)(lua_state, object)
 #define lua_isstring(object)	(lua_isstring)(lua_state, object)
 #define lua_isfunction(object)	(lua_isfunction)(lua_state, object)
-#define lua_equalobj(o1,o2)	(lua_equalobj)(lua_state, o1,o2)
+#define lua_equal(o1,o2)	(lua_equal)(lua_state, o1,o2)
 #define lua_getnumber(object)	(lua_getnumber)(lua_state, object)
 #define lua_getstring(object)	(lua_getstring)(lua_state, object)
 #define lua_strlen(object)	(lua_strlen)(lua_state, object)