diff options
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.106 2003/04/03 13:35:34 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.107 2003/12/01 18:22:56 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 | */ |
| @@ -45,8 +45,8 @@ void luaT_init (lua_State *L) { | |||
| 45 | ** function to be used with macro "fasttm": optimized for absence of | 45 | ** function to be used with macro "fasttm": optimized for absence of |
| 46 | ** tag methods | 46 | ** tag methods |
| 47 | */ | 47 | */ |
| 48 | const TObject *luaT_gettm (Table *events, TMS event, TString *ename) { | 48 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { |
| 49 | const TObject *tm = luaH_getstr(events, ename); | 49 | const TValue *tm = luaH_getstr(events, ename); |
| 50 | lua_assert(event <= TM_EQ); | 50 | lua_assert(event <= TM_EQ); |
| 51 | if (ttisnil(tm)) { /* no tag method? */ | 51 | if (ttisnil(tm)) { /* no tag method? */ |
| 52 | events->flags |= cast(lu_byte, 1u<<event); /* cache this fact */ | 52 | events->flags |= cast(lu_byte, 1u<<event); /* cache this fact */ |
| @@ -56,14 +56,14 @@ const TObject *luaT_gettm (Table *events, TMS event, TString *ename) { | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event) { | 59 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 60 | Table *mt; | 60 | Table *mt; |
| 61 | switch (ttype(o)) { | 61 | switch (ttype(o)) { |
| 62 | case LUA_TTABLE: | 62 | case LUA_TTABLE: |
| 63 | mt = hvalue(o)->metatable; | 63 | mt = hvalue(o)->metatable; |
| 64 | break; | 64 | break; |
| 65 | case LUA_TUSERDATA: | 65 | case LUA_TUSERDATA: |
| 66 | mt = uvalue(o)->uv.metatable; | 66 | mt = uvalue(o)->metatable; |
| 67 | break; | 67 | break; |
| 68 | default: | 68 | default: |
| 69 | mt = NULL; | 69 | mt = NULL; |
