Browse Source

lua_Reference is int, so say so.

Roberto Ierusalimschy 29 years ago
parent
commit
bced00ab9e
5 changed files with 18 additions and 20 deletions
  1. 4 4
      fallback.c
  2. 3 3
      fallback.h
  3. 5 7
      lua.h
  4. 2 2
      mathlib.c
  5. 4 4
      opcode.c

+ 4 - 4
fallback.c

@@ -3,7 +3,7 @@
 ** TecCGraf - PUC-Rio
 */
  
-char *rcs_fallback="$Id: fallback.c,v 1.23 1996/03/21 16:31:32 roberto Exp roberto $";
+char *rcs_fallback="$Id: fallback.c,v 1.24 1996/04/22 18:00:37 roberto Exp roberto $";
 
 #include <stdio.h>
 #include <string.h>
@@ -122,7 +122,7 @@ static struct ref {
 } *refArray = NULL;
 static int refSize = 0;
 
-lua_Reference luaI_ref (Object *object, int lock)
+int luaI_ref (Object *object, int lock)
 {
   int i;
   int oldSize;
@@ -144,14 +144,14 @@ lua_Reference luaI_ref (Object *object, int lock)
 }
 
 
-void lua_unref (lua_Reference ref)
+void lua_unref (int ref)
 {
   if (ref >= 0 && ref < refSize)
     refArray[ref].status = FREE;
 }
 
 
-Object *luaI_getref (lua_Reference ref)
+Object *luaI_getref (int ref)
 {
   static Object nul = {LUA_T_NIL, {0}};
   if (ref == -1)

+ 3 - 3
fallback.h

@@ -1,5 +1,5 @@
 /*
-** $Id: fallback.h,v 1.11 1996/01/30 15:25:23 roberto Exp roberto $
+** $Id: fallback.h,v 1.12 1996/04/22 18:00:37 roberto Exp roberto $
 */
  
 #ifndef fallback_h
@@ -27,8 +27,8 @@ extern struct FB {
 #define FB_GETGLOBAL 9
 
 void luaI_setfallback (void);
-lua_Reference luaI_ref (Object *object, int lock);
-Object *luaI_getref (lua_Reference ref);
+int luaI_ref (Object *object, int lock);
+Object *luaI_getref (int ref);
 void luaI_travlock (int (*fn)(Object *));
 void luaI_invalidaterefs (void);
 char *luaI_travfallbacks (int (*fn)(Object *));

+ 5 - 7
lua.h

@@ -2,7 +2,7 @@
 ** LUA - Linguagem para Usuarios de Aplicacao
 ** Grupo de Tecnologia em Computacao Grafica
 ** TeCGraf - PUC-Rio
-** $Id: lua.h,v 3.25 1996/03/21 21:30:29 roberto Exp roberto $
+** $Id: lua.h,v 3.26 1996/04/22 18:00:37 roberto Exp roberto $
 */
 
 
@@ -81,12 +81,10 @@ lua_Object     lua_getsubscript         (void);
 int            lua_type 		(lua_Object object);
 
 
-typedef int lua_Reference;
-
-lua_Reference  lua_ref			(int lock);
-lua_Object     lua_getref		(lua_Reference ref);
-void	       lua_pushref		(lua_Reference ref);
-void	       lua_unref		(lua_Reference ref);
+int            lua_ref			(int lock);
+lua_Object     lua_getref		(int ref);
+void	       lua_pushref		(int ref);
+void	       lua_unref		(int ref);
 
 lua_Object     lua_createtable		(void);
 

+ 2 - 2
mathlib.c

@@ -3,7 +3,7 @@
 ** Mathematics library to LUA
 */
 
-char *rcs_mathlib="$Id: mathlib.c,v 1.14 1996/02/09 17:21:27 roberto Exp roberto $";
+char *rcs_mathlib="$Id: mathlib.c,v 1.15 1996/04/22 18:00:37 roberto Exp roberto $";
 
 #include <stdlib.h>
 #include <math.h>
@@ -104,7 +104,7 @@ static void math_sqrt (void)
  lua_pushnumber (sqrt(d));
 }
 
-static lua_Reference old_pow;
+static int old_pow;
 
 static void math_pow (void)
 {

+ 4 - 4
opcode.c

@@ -3,7 +3,7 @@
 ** TecCGraf - PUC-Rio
 */
 
-char *rcs_opcode="$Id: opcode.c,v 3.66 1996/03/22 19:12:15 roberto Exp roberto $";
+char *rcs_opcode="$Id: opcode.c,v 3.67 1996/04/22 18:00:37 roberto Exp roberto $";
 
 #include <setjmp.h>
 #include <stdio.h>
@@ -717,7 +717,7 @@ void *lua_getuserdata (lua_Object object)
 }
 
 
-lua_Object lua_getref (lua_Reference ref)
+lua_Object lua_getref (int ref)
 {
   Object *o = luaI_getref(ref);
   if (o == NULL)
@@ -729,7 +729,7 @@ lua_Object lua_getref (lua_Reference ref)
 }
 
 
-void lua_pushref (lua_Reference ref)
+void lua_pushref (int ref)
 {
   Object *o = luaI_getref(ref);
   if (o == NULL)
@@ -738,7 +738,7 @@ void lua_pushref (lua_Reference ref)
 }
 
 
-lua_Reference lua_ref (int lock)
+int lua_ref (int lock)
 {
   adjustC(1);
   return luaI_ref(--top, lock);