aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ltm.c b/ltm.c
index 1ccf9a5c..40e67887 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 1.63 2001/01/25 16:45:36 roberto Exp roberto $ 2** $Id: ltm.c,v 1.64 2001/01/26 11:45:51 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -111,14 +111,14 @@ static void checktag (lua_State *L, int tag) {
111 111
112LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) { 112LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) {
113 int e; 113 int e;
114 LUA_LOCK; 114 LUA_LOCK(L);
115 checktag(L, tagto); 115 checktag(L, tagto);
116 checktag(L, tagfrom); 116 checktag(L, tagfrom);
117 for (e=0; e<TM_N; e++) { 117 for (e=0; e<TM_N; e++) {
118 if (luaT_validevent(tagto, e)) 118 if (luaT_validevent(tagto, e))
119 luaT_gettm(G(L), tagto, e) = luaT_gettm(G(L), tagfrom, e); 119 luaT_gettm(G(L), tagto, e) = luaT_gettm(G(L), tagfrom, e);
120 } 120 }
121 LUA_UNLOCK; 121 LUA_UNLOCK(L);
122 return tagto; 122 return tagto;
123} 123}
124 124
@@ -156,7 +156,7 @@ const char *luaT_typename (global_State *G, const TObject *o) {
156 156
157LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) { 157LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) {
158 int e; 158 int e;
159 LUA_LOCK; 159 LUA_LOCK(L);
160 e = luaI_checkevent(L, event, t); 160 e = luaI_checkevent(L, event, t);
161 checktag(L, t); 161 checktag(L, t);
162 if (luaT_validevent(t, e) && luaT_gettm(G(L), t, e)) { 162 if (luaT_validevent(t, e) && luaT_gettm(G(L), t, e)) {
@@ -165,13 +165,13 @@ LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) {
165 else 165 else
166 setnilvalue(L->top); 166 setnilvalue(L->top);
167 incr_top; 167 incr_top;
168 LUA_UNLOCK; 168 LUA_UNLOCK(L);
169} 169}
170 170
171 171
172LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) { 172LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) {
173 int e; 173 int e;
174 LUA_LOCK; 174 LUA_LOCK(L);
175 e = luaI_checkevent(L, event, t); 175 e = luaI_checkevent(L, event, t);
176 checktag(L, t); 176 checktag(L, t);
177 if (!luaT_validevent(t, e)) 177 if (!luaT_validevent(t, e))
@@ -190,6 +190,6 @@ LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) {
190 luaD_error(L, "tag method must be a function (or nil)"); 190 luaD_error(L, "tag method must be a function (or nil)");
191 } 191 }
192 L->top--; 192 L->top--;
193 LUA_UNLOCK; 193 LUA_UNLOCK(L);
194} 194}
195 195