From bced00ab9efcdc68982b5e3787f277b86ea3cde8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Apr 1996 11:10:00 -0300 Subject: [PATCH] lua_Reference is int, so say so. --- fallback.c | 8 ++++---- fallback.h | 6 +++--- lua.h | 12 +++++------- mathlib.c | 4 ++-- opcode.c | 8 ++++---- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/fallback.c b/fallback.c index 9d2db515..9523318c 100644 --- a/fallback.c +++ b/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 #include @@ -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) diff --git a/fallback.h b/fallback.h index 67620406..2bcc4f5d 100644 --- a/fallback.h +++ b/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 *)); diff --git a/lua.h b/lua.h index 5738a619..bb65cf5c 100644 --- a/lua.h +++ b/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); diff --git a/mathlib.c b/mathlib.c index efc887b8..5e02908e 100644 --- a/mathlib.c +++ b/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 #include @@ -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) { diff --git a/opcode.c b/opcode.c index c2437a56..13d476f4 100644 --- a/opcode.c +++ b/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 #include @@ -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);