diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-26 09:45:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-26 09:45:51 -0200 |
| commit | bce6572579a7e6c7a96895d9280396b3b33b8f3f (patch) | |
| tree | a937d0366ae9d9e37e6320b347ec463f337ceb1b /ltm.c | |
| parent | a53d9b66ca6247818acaf41e28cdf123082a272b (diff) | |
| download | lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.tar.gz lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.tar.bz2 lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.zip | |
new macros + new names to facilitate compilation of threaded version
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.62 2001/01/24 15:45:33 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.63 2001/01/25 16:45:36 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 | ||
| 112 | LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) { | 112 | LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) { |
| 113 | int e; | 113 | int e; |
| 114 | LUA_ENTRY; | 114 | LUA_LOCK; |
| 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_EXIT; | 121 | LUA_UNLOCK; |
| 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 | ||
| 157 | LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) { | 157 | LUA_API void lua_gettagmethod (lua_State *L, int t, const char *event) { |
| 158 | int e; | 158 | int e; |
| 159 | LUA_ENTRY; | 159 | LUA_LOCK; |
| 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_EXIT; | 168 | LUA_UNLOCK; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | 171 | ||
| 172 | LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) { | 172 | LUA_API void lua_settagmethod (lua_State *L, int t, const char *event) { |
| 173 | int e; | 173 | int e; |
| 174 | LUA_ENTRY; | 174 | LUA_LOCK; |
| 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_EXIT; | 193 | LUA_UNLOCK; |
| 194 | } | 194 | } |
| 195 | 195 | ||
