aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-25 11:10:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-25 11:10:00 -0300
commitbced00ab9efcdc68982b5e3787f277b86ea3cde8 (patch)
tree85901ada4296ac533b2169b922885f7fc9d9e415
parent25116a306598b8f30606552a4570f752ac141397 (diff)
downloadlua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.tar.gz
lua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.tar.bz2
lua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.zip
lua_Reference is int, so say so.
-rw-r--r--fallback.c8
-rw-r--r--fallback.h6
-rw-r--r--lua.h12
-rw-r--r--mathlib.c4
-rw-r--r--opcode.c8
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 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_fallback="$Id: fallback.c,v 1.23 1996/03/21 16:31:32 roberto Exp roberto $"; 6char *rcs_fallback="$Id: fallback.c,v 1.24 1996/04/22 18:00:37 roberto Exp roberto $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <string.h> 9#include <string.h>
@@ -122,7 +122,7 @@ static struct ref {
122} *refArray = NULL; 122} *refArray = NULL;
123static int refSize = 0; 123static int refSize = 0;
124 124
125lua_Reference luaI_ref (Object *object, int lock) 125int luaI_ref (Object *object, int lock)
126{ 126{
127 int i; 127 int i;
128 int oldSize; 128 int oldSize;
@@ -144,14 +144,14 @@ lua_Reference luaI_ref (Object *object, int lock)
144} 144}
145 145
146 146
147void lua_unref (lua_Reference ref) 147void lua_unref (int ref)
148{ 148{
149 if (ref >= 0 && ref < refSize) 149 if (ref >= 0 && ref < refSize)
150 refArray[ref].status = FREE; 150 refArray[ref].status = FREE;
151} 151}
152 152
153 153
154Object *luaI_getref (lua_Reference ref) 154Object *luaI_getref (int ref)
155{ 155{
156 static Object nul = {LUA_T_NIL, {0}}; 156 static Object nul = {LUA_T_NIL, {0}};
157 if (ref == -1) 157 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 @@
1/* 1/*
2** $Id: fallback.h,v 1.11 1996/01/30 15:25:23 roberto Exp roberto $ 2** $Id: fallback.h,v 1.12 1996/04/22 18:00:37 roberto Exp roberto $
3*/ 3*/
4 4
5#ifndef fallback_h 5#ifndef fallback_h
@@ -27,8 +27,8 @@ extern struct FB {
27#define FB_GETGLOBAL 9 27#define FB_GETGLOBAL 9
28 28
29void luaI_setfallback (void); 29void luaI_setfallback (void);
30lua_Reference luaI_ref (Object *object, int lock); 30int luaI_ref (Object *object, int lock);
31Object *luaI_getref (lua_Reference ref); 31Object *luaI_getref (int ref);
32void luaI_travlock (int (*fn)(Object *)); 32void luaI_travlock (int (*fn)(Object *));
33void luaI_invalidaterefs (void); 33void luaI_invalidaterefs (void);
34char *luaI_travfallbacks (int (*fn)(Object *)); 34char *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 @@
2** LUA - Linguagem para Usuarios de Aplicacao 2** LUA - Linguagem para Usuarios de Aplicacao
3** Grupo de Tecnologia em Computacao Grafica 3** Grupo de Tecnologia em Computacao Grafica
4** TeCGraf - PUC-Rio 4** TeCGraf - PUC-Rio
5** $Id: lua.h,v 3.25 1996/03/21 21:30:29 roberto Exp roberto $ 5** $Id: lua.h,v 3.26 1996/04/22 18:00:37 roberto Exp roberto $
6*/ 6*/
7 7
8 8
@@ -81,12 +81,10 @@ lua_Object lua_getsubscript (void);
81int lua_type (lua_Object object); 81int lua_type (lua_Object object);
82 82
83 83
84typedef int lua_Reference; 84int lua_ref (int lock);
85 85lua_Object lua_getref (int ref);
86lua_Reference lua_ref (int lock); 86void lua_pushref (int ref);
87lua_Object lua_getref (lua_Reference ref); 87void lua_unref (int ref);
88void lua_pushref (lua_Reference ref);
89void lua_unref (lua_Reference ref);
90 88
91lua_Object lua_createtable (void); 89lua_Object lua_createtable (void);
92 90
diff --git a/mathlib.c b/mathlib.c
index efc887b8..5e02908e 100644
--- a/mathlib.c
+++ b/mathlib.c
@@ -3,7 +3,7 @@
3** Mathematics library to LUA 3** Mathematics library to LUA
4*/ 4*/
5 5
6char *rcs_mathlib="$Id: mathlib.c,v 1.14 1996/02/09 17:21:27 roberto Exp roberto $"; 6char *rcs_mathlib="$Id: mathlib.c,v 1.15 1996/04/22 18:00:37 roberto Exp roberto $";
7 7
8#include <stdlib.h> 8#include <stdlib.h>
9#include <math.h> 9#include <math.h>
@@ -104,7 +104,7 @@ static void math_sqrt (void)
104 lua_pushnumber (sqrt(d)); 104 lua_pushnumber (sqrt(d));
105} 105}
106 106
107static lua_Reference old_pow; 107static int old_pow;
108 108
109static void math_pow (void) 109static void math_pow (void)
110{ 110{
diff --git a/opcode.c b/opcode.c
index c2437a56..13d476f4 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.66 1996/03/22 19:12:15 roberto Exp roberto $"; 6char *rcs_opcode="$Id: opcode.c,v 3.67 1996/04/22 18:00:37 roberto Exp roberto $";
7 7
8#include <setjmp.h> 8#include <setjmp.h>
9#include <stdio.h> 9#include <stdio.h>
@@ -717,7 +717,7 @@ void *lua_getuserdata (lua_Object object)
717} 717}
718 718
719 719
720lua_Object lua_getref (lua_Reference ref) 720lua_Object lua_getref (int ref)
721{ 721{
722 Object *o = luaI_getref(ref); 722 Object *o = luaI_getref(ref);
723 if (o == NULL) 723 if (o == NULL)
@@ -729,7 +729,7 @@ lua_Object lua_getref (lua_Reference ref)
729} 729}
730 730
731 731
732void lua_pushref (lua_Reference ref) 732void lua_pushref (int ref)
733{ 733{
734 Object *o = luaI_getref(ref); 734 Object *o = luaI_getref(ref);
735 if (o == NULL) 735 if (o == NULL)
@@ -738,7 +738,7 @@ void lua_pushref (lua_Reference ref)
738} 738}
739 739
740 740
741lua_Reference lua_ref (int lock) 741int lua_ref (int lock)
742{ 742{
743 adjustC(1); 743 adjustC(1);
744 return luaI_ref(--top, lock); 744 return luaI_ref(--top, lock);