diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-25 11:10:00 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-25 11:10:00 -0300 |
commit | bced00ab9efcdc68982b5e3787f277b86ea3cde8 (patch) | |
tree | 85901ada4296ac533b2169b922885f7fc9d9e415 | |
parent | 25116a306598b8f30606552a4570f752ac141397 (diff) | |
download | lua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.tar.gz lua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.tar.bz2 lua-bced00ab9efcdc68982b5e3787f277b86ea3cde8.zip |
lua_Reference is int, so say so.
-rw-r--r-- | fallback.c | 8 | ||||
-rw-r--r-- | fallback.h | 6 | ||||
-rw-r--r-- | lua.h | 12 | ||||
-rw-r--r-- | mathlib.c | 4 | ||||
-rw-r--r-- | opcode.c | 8 |
5 files changed, 18 insertions, 20 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_fallback="$Id: fallback.c,v 1.23 1996/03/21 16:31:32 roberto Exp roberto $"; | 6 | char *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; |
123 | static int refSize = 0; | 123 | static int refSize = 0; |
124 | 124 | ||
125 | lua_Reference luaI_ref (Object *object, int lock) | 125 | int 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 | ||
147 | void lua_unref (lua_Reference ref) | 147 | void 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 | ||
154 | Object *luaI_getref (lua_Reference ref) | 154 | Object *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) |
@@ -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 | ||
29 | void luaI_setfallback (void); | 29 | void luaI_setfallback (void); |
30 | lua_Reference luaI_ref (Object *object, int lock); | 30 | int luaI_ref (Object *object, int lock); |
31 | Object *luaI_getref (lua_Reference ref); | 31 | Object *luaI_getref (int ref); |
32 | void luaI_travlock (int (*fn)(Object *)); | 32 | void luaI_travlock (int (*fn)(Object *)); |
33 | void luaI_invalidaterefs (void); | 33 | void luaI_invalidaterefs (void); |
34 | char *luaI_travfallbacks (int (*fn)(Object *)); | 34 | char *luaI_travfallbacks (int (*fn)(Object *)); |
@@ -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); | |||
81 | int lua_type (lua_Object object); | 81 | int lua_type (lua_Object object); |
82 | 82 | ||
83 | 83 | ||
84 | typedef int lua_Reference; | 84 | int lua_ref (int lock); |
85 | 85 | lua_Object lua_getref (int ref); | |
86 | lua_Reference lua_ref (int lock); | 86 | void lua_pushref (int ref); |
87 | lua_Object lua_getref (lua_Reference ref); | 87 | void lua_unref (int ref); |
88 | void lua_pushref (lua_Reference ref); | ||
89 | void lua_unref (lua_Reference ref); | ||
90 | 88 | ||
91 | lua_Object lua_createtable (void); | 89 | lua_Object lua_createtable (void); |
92 | 90 | ||
@@ -3,7 +3,7 @@ | |||
3 | ** Mathematics library to LUA | 3 | ** Mathematics library to LUA |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_mathlib="$Id: mathlib.c,v 1.14 1996/02/09 17:21:27 roberto Exp roberto $"; | 6 | char *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 | ||
107 | static lua_Reference old_pow; | 107 | static int old_pow; |
108 | 108 | ||
109 | static void math_pow (void) | 109 | static void math_pow (void) |
110 | { | 110 | { |
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.66 1996/03/22 19:12:15 roberto Exp roberto $"; | 6 | char *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 | ||
720 | lua_Object lua_getref (lua_Reference ref) | 720 | lua_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 | ||
732 | void lua_pushref (lua_Reference ref) | 732 | void 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 | ||
741 | lua_Reference lua_ref (int lock) | 741 | int lua_ref (int lock) |
742 | { | 742 | { |
743 | adjustC(1); | 743 | adjustC(1); |
744 | return luaI_ref(--top, lock); | 744 | return luaI_ref(--top, lock); |