diff options
-rw-r--r-- | lapi.c | 16 | ||||
-rw-r--r-- | ldump.c | 6 | ||||
-rw-r--r-- | lobject.h | 6 | ||||
-rw-r--r-- | ltm.c | 6 | ||||
-rw-r--r-- | ltm.h | 4 | ||||
-rw-r--r-- | lvm.c | 4 |
6 files changed, 21 insertions, 21 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.170 2012/12/05 19:49:55 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.171 2013/03/16 21:10:18 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -248,7 +248,7 @@ LUA_API void lua_pushvalue (lua_State *L, int idx) { | |||
248 | 248 | ||
249 | LUA_API int lua_type (lua_State *L, int idx) { | 249 | LUA_API int lua_type (lua_State *L, int idx) { |
250 | StkId o = index2addr(L, idx); | 250 | StkId o = index2addr(L, idx); |
251 | return (isvalid(o) ? ttypenv(o) : LUA_TNONE); | 251 | return (isvalid(o) ? ttnov(o) : LUA_TNONE); |
252 | } | 252 | } |
253 | 253 | ||
254 | 254 | ||
@@ -406,7 +406,7 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { | |||
406 | 406 | ||
407 | LUA_API size_t lua_rawlen (lua_State *L, int idx) { | 407 | LUA_API size_t lua_rawlen (lua_State *L, int idx) { |
408 | StkId o = index2addr(L, idx); | 408 | StkId o = index2addr(L, idx); |
409 | switch (ttypenv(o)) { | 409 | switch (ttnov(o)) { |
410 | case LUA_TSTRING: return tsvalue(o)->len; | 410 | case LUA_TSTRING: return tsvalue(o)->len; |
411 | case LUA_TUSERDATA: return uvalue(o)->len; | 411 | case LUA_TUSERDATA: return uvalue(o)->len; |
412 | case LUA_TTABLE: return luaH_getn(hvalue(o)); | 412 | case LUA_TTABLE: return luaH_getn(hvalue(o)); |
@@ -426,7 +426,7 @@ LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { | |||
426 | 426 | ||
427 | LUA_API void *lua_touserdata (lua_State *L, int idx) { | 427 | LUA_API void *lua_touserdata (lua_State *L, int idx) { |
428 | StkId o = index2addr(L, idx); | 428 | StkId o = index2addr(L, idx); |
429 | switch (ttypenv(o)) { | 429 | switch (ttnov(o)) { |
430 | case LUA_TUSERDATA: return (rawuvalue(o) + 1); | 430 | case LUA_TUSERDATA: return (rawuvalue(o) + 1); |
431 | case LUA_TLIGHTUSERDATA: return pvalue(o); | 431 | case LUA_TLIGHTUSERDATA: return pvalue(o); |
432 | default: return NULL; | 432 | default: return NULL; |
@@ -689,7 +689,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { | |||
689 | int res; | 689 | int res; |
690 | lua_lock(L); | 690 | lua_lock(L); |
691 | obj = index2addr(L, objindex); | 691 | obj = index2addr(L, objindex); |
692 | switch (ttypenv(obj)) { | 692 | switch (ttnov(obj)) { |
693 | case LUA_TTABLE: | 693 | case LUA_TTABLE: |
694 | mt = hvalue(obj)->metatable; | 694 | mt = hvalue(obj)->metatable; |
695 | break; | 695 | break; |
@@ -697,7 +697,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { | |||
697 | mt = uvalue(obj)->metatable; | 697 | mt = uvalue(obj)->metatable; |
698 | break; | 698 | break; |
699 | default: | 699 | default: |
700 | mt = G(L)->mt[ttypenv(obj)]; | 700 | mt = G(L)->mt[ttnov(obj)]; |
701 | break; | 701 | break; |
702 | } | 702 | } |
703 | if (mt == NULL) | 703 | if (mt == NULL) |
@@ -821,7 +821,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { | |||
821 | api_check(L, ttistable(L->top - 1), "table expected"); | 821 | api_check(L, ttistable(L->top - 1), "table expected"); |
822 | mt = hvalue(L->top - 1); | 822 | mt = hvalue(L->top - 1); |
823 | } | 823 | } |
824 | switch (ttypenv(obj)) { | 824 | switch (ttnov(obj)) { |
825 | case LUA_TTABLE: { | 825 | case LUA_TTABLE: { |
826 | hvalue(obj)->metatable = mt; | 826 | hvalue(obj)->metatable = mt; |
827 | if (mt) { | 827 | if (mt) { |
@@ -839,7 +839,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { | |||
839 | break; | 839 | break; |
840 | } | 840 | } |
841 | default: { | 841 | default: { |
842 | G(L)->mt[ttypenv(obj)] = mt; | 842 | G(L)->mt[ttnov(obj)] = mt; |
843 | break; | 843 | break; |
844 | } | 844 | } |
845 | } | 845 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldump.c,v 2.16 2011/11/24 13:25:41 roberto Exp roberto $ | 2 | ** $Id: ldump.c,v 2.17 2012/01/23 23:02:10 roberto Exp roberto $ |
3 | ** save precompiled Lua chunks | 3 | ** save precompiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -84,8 +84,8 @@ static void DumpConstants(const Proto* f, DumpState* D) | |||
84 | for (i=0; i<n; i++) | 84 | for (i=0; i<n; i++) |
85 | { | 85 | { |
86 | const TValue* o=&f->k[i]; | 86 | const TValue* o=&f->k[i]; |
87 | DumpChar(ttypenv(o),D); | 87 | DumpChar(ttnov(o),D); |
88 | switch (ttypenv(o)) | 88 | switch (ttnov(o)) |
89 | { | 89 | { |
90 | case LUA_TNIL: | 90 | case LUA_TNIL: |
91 | break; | 91 | break; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.70 2012/05/11 14:10:50 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.71 2012/09/11 18:21:44 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -124,12 +124,12 @@ typedef struct lua_TValue TValue; | |||
124 | #define ttype(o) (rttype(o) & 0x3F) | 124 | #define ttype(o) (rttype(o) & 0x3F) |
125 | 125 | ||
126 | /* type tag of a TValue with no variants (bits 0-3) */ | 126 | /* type tag of a TValue with no variants (bits 0-3) */ |
127 | #define ttypenv(o) (novariant(rttype(o))) | 127 | #define ttnov(o) (novariant(rttype(o))) |
128 | 128 | ||
129 | 129 | ||
130 | /* Macros to test type */ | 130 | /* Macros to test type */ |
131 | #define checktag(o,t) (rttype(o) == (t)) | 131 | #define checktag(o,t) (rttype(o) == (t)) |
132 | #define checktype(o,t) (ttypenv(o) == (t)) | 132 | #define checktype(o,t) (ttnov(o) == (t)) |
133 | #define ttisnumber(o) checktag((o), LUA_TNUMBER) | 133 | #define ttisnumber(o) checktag((o), LUA_TNUMBER) |
134 | #define ttisnil(o) checktag((o), LUA_TNIL) | 134 | #define ttisnil(o) checktag((o), LUA_TNIL) |
135 | #define ttisboolean(o) checktag((o), LUA_TBOOLEAN) | 135 | #define ttisboolean(o) checktag((o), LUA_TBOOLEAN) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 2.13 2011/02/28 17:32:10 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.14 2011/06/02 19:31:40 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 | */ |
@@ -62,7 +62,7 @@ const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { | |||
62 | 62 | ||
63 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | 63 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
64 | Table *mt; | 64 | Table *mt; |
65 | switch (ttypenv(o)) { | 65 | switch (ttnov(o)) { |
66 | case LUA_TTABLE: | 66 | case LUA_TTABLE: |
67 | mt = hvalue(o)->metatable; | 67 | mt = hvalue(o)->metatable; |
68 | break; | 68 | break; |
@@ -70,7 +70,7 @@ const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | |||
70 | mt = uvalue(o)->metatable; | 70 | mt = uvalue(o)->metatable; |
71 | break; | 71 | break; |
72 | default: | 72 | default: |
73 | mt = G(L)->mt[ttypenv(o)]; | 73 | mt = G(L)->mt[ttnov(o)]; |
74 | } | 74 | } |
75 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); | 75 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
76 | } | 76 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.h,v 2.10 2010/04/13 20:48:12 roberto Exp roberto $ | 2 | ** $Id: ltm.h,v 2.11 2011/02/28 17:32:10 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 | */ |
@@ -44,7 +44,7 @@ typedef enum { | |||
44 | #define fasttm(l,et,e) gfasttm(G(l), et, e) | 44 | #define fasttm(l,et,e) gfasttm(G(l), et, e) |
45 | 45 | ||
46 | #define ttypename(x) luaT_typenames_[(x) + 1] | 46 | #define ttypename(x) luaT_typenames_[(x) + 1] |
47 | #define objtypename(x) ttypename(ttypenv(x)) | 47 | #define objtypename(x) ttypename(ttnov(x)) |
48 | 48 | ||
49 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; | 49 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; |
50 | 50 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.154 2012/08/16 17:34:28 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.155 2013/03/16 21:10:18 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -334,7 +334,7 @@ void luaV_concat (lua_State *L, int total) { | |||
334 | 334 | ||
335 | void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { | 335 | void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { |
336 | const TValue *tm; | 336 | const TValue *tm; |
337 | switch (ttypenv(rb)) { | 337 | switch (ttnov(rb)) { |
338 | case LUA_TTABLE: { | 338 | case LUA_TTABLE: { |
339 | Table *h = hvalue(rb); | 339 | Table *h = hvalue(rb); |
340 | tm = fasttm(L, h->metatable, TM_LEN); | 340 | tm = fasttm(L, h->metatable, TM_LEN); |