aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ltm.c b/ltm.c
index d9ec4476..10c94829 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 1.35 2000/03/20 19:14:54 roberto Exp roberto $ 2** $Id: ltm.c,v 1.36 2000/03/27 20:08:02 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*/
@@ -29,7 +29,7 @@ static int luaI_checkevent (lua_State *L, const char *name, int t) {
29 int e = luaL_findstring(name, luaT_eventname); 29 int e = luaL_findstring(name, luaT_eventname);
30 if (e >= IM_N) 30 if (e >= IM_N)
31 luaL_verror(L, "event `%.50s' is deprecated", name); 31 luaL_verror(L, "event `%.50s' is deprecated", name);
32 if (e == IM_GC && t == TAG_ARRAY) 32 if (e == IM_GC && t == TAG_TABLE)
33 luaL_verror(L, "event `gc' for tables is deprecated"); 33 luaL_verror(L, "event `gc' for tables is deprecated");
34 if (e < 0) 34 if (e < 0)
35 luaL_verror(L, "`%.50s' is not a valid event name", name); 35 luaL_verror(L, "`%.50s' is not a valid event name", name);
@@ -46,7 +46,7 @@ static const char luaT_validevents[NUM_TAGS][IM_N] = {
46 {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_USERDATA */ 46 {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_USERDATA */
47 {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* TAG_NUMBER */ 47 {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* TAG_NUMBER */
48 {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, /* TAG_STRING */ 48 {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, /* TAG_STRING */
49 {0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_ARRAY */ 49 {0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* TAG_TABLE */
50 {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_LPROTO */ 50 {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_LPROTO */
51 {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_CPROTO */ 51 {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, /* TAG_CPROTO */
52 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} /* TAG_NIL */ 52 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} /* TAG_NIL */
@@ -106,7 +106,7 @@ int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) {
106 106
107int luaT_effectivetag (lua_State *L, const TObject *o) { 107int luaT_effectivetag (lua_State *L, const TObject *o) {
108 static const int realtag[] = { /* ORDER LUA_T */ 108 static const int realtag[] = { /* ORDER LUA_T */
109 TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_ARRAY, 109 TAG_USERDATA, TAG_NUMBER, TAG_STRING, TAG_TABLE,
110 TAG_LPROTO, TAG_CPROTO, TAG_NIL, 110 TAG_LPROTO, TAG_CPROTO, TAG_NIL,
111 TAG_LPROTO, TAG_CPROTO, /* TAG_LCLOSURE, TAG_CCLOSURE */ 111 TAG_LPROTO, TAG_CPROTO, /* TAG_LCLOSURE, TAG_CCLOSURE */
112 }; 112 };
@@ -116,7 +116,7 @@ int luaT_effectivetag (lua_State *L, const TObject *o) {
116 int tag = o->value.ts->u.d.tag; 116 int tag = o->value.ts->u.d.tag;
117 return (tag > L->last_tag) ? TAG_USERDATA : tag; /* deprecated test */ 117 return (tag > L->last_tag) ? TAG_USERDATA : tag; /* deprecated test */
118 } 118 }
119 case TAG_ARRAY: return o->value.a->htag; 119 case TAG_TABLE: return o->value.a->htag;
120 default: return realtag[t]; 120 default: return realtag[t];
121 } 121 }
122} 122}
@@ -141,7 +141,7 @@ void luaT_settagmethod (lua_State *L, int t, const char *event, TObject *func) {
141 if (!luaT_validevent(t, e)) 141 if (!luaT_validevent(t, e))
142 luaL_verror(L, "cannot change `%.20s' tag method for type `%.20s'%.20s", 142 luaL_verror(L, "cannot change `%.20s' tag method for type `%.20s'%.20s",
143 luaT_eventname[e], luaO_typenames[t], 143 luaT_eventname[e], luaO_typenames[t],
144 (t == TAG_ARRAY || t == TAG_USERDATA) ? " with default tag" 144 (t == TAG_TABLE || t == TAG_USERDATA) ? " with default tag"
145 : ""); 145 : "");
146 temp = *func; 146 temp = *func;
147 *func = *luaT_getim(L, t,e); 147 *func = *luaT_getim(L, t,e);