diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -262,7 +262,7 @@ LUA_API int lua_type (lua_State *L, int idx) { | |||
262 | 262 | ||
263 | LUA_API const char *lua_typename (lua_State *L, int t) { | 263 | LUA_API const char *lua_typename (lua_State *L, int t) { |
264 | UNUSED(L); | 264 | UNUSED(L); |
265 | api_check(L, LUA_TNONE <= t && t < LUA_NUMTAGS, "invalid tag"); | 265 | api_check(L, LUA_TNONE <= t && t < LUA_NUMTYPES, "invalid type"); |
266 | return ttypename(t); | 266 | return ttypename(t); |
267 | } | 267 | } |
268 | 268 | ||
@@ -397,10 +397,10 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { | |||
397 | LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) { | 397 | LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) { |
398 | const TValue *o = index2value(L, idx); | 398 | const TValue *o = index2value(L, idx); |
399 | switch (ttypetag(o)) { | 399 | switch (ttypetag(o)) { |
400 | case LUA_TSHRSTR: return tsvalue(o)->shrlen; | 400 | case LUA_VSHRSTR: return tsvalue(o)->shrlen; |
401 | case LUA_TLNGSTR: return tsvalue(o)->u.lnglen; | 401 | case LUA_VLNGSTR: return tsvalue(o)->u.lnglen; |
402 | case LUA_TUSERDATA: return uvalue(o)->len; | 402 | case LUA_VUSERDATA: return uvalue(o)->len; |
403 | case LUA_TTABLE: return luaH_getn(hvalue(o)); | 403 | case LUA_VTABLE: return luaH_getn(hvalue(o)); |
404 | default: return 0; | 404 | default: return 0; |
405 | } | 405 | } |
406 | } | 406 | } |
@@ -446,8 +446,8 @@ LUA_API lua_State *lua_tothread (lua_State *L, int idx) { | |||
446 | LUA_API const void *lua_topointer (lua_State *L, int idx) { | 446 | LUA_API const void *lua_topointer (lua_State *L, int idx) { |
447 | const TValue *o = index2value(L, idx); | 447 | const TValue *o = index2value(L, idx); |
448 | switch (ttypetag(o)) { | 448 | switch (ttypetag(o)) { |
449 | case LUA_TLCF: return cast_voidp(cast_sizet(fvalue(o))); | 449 | case LUA_VLCF: return cast_voidp(cast_sizet(fvalue(o))); |
450 | case LUA_TUSERDATA: case LUA_TLIGHTUSERDATA: | 450 | case LUA_VUSERDATA: case LUA_VLIGHTUSERDATA: |
451 | return touserdata(o); | 451 | return touserdata(o); |
452 | default: { | 452 | default: { |
453 | if (iscollectable(o)) | 453 | if (iscollectable(o)) |
@@ -1312,7 +1312,7 @@ LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { | |||
1312 | static const char *aux_upvalue (TValue *fi, int n, TValue **val, | 1312 | static const char *aux_upvalue (TValue *fi, int n, TValue **val, |
1313 | GCObject **owner) { | 1313 | GCObject **owner) { |
1314 | switch (ttypetag(fi)) { | 1314 | switch (ttypetag(fi)) { |
1315 | case LUA_TCCL: { /* C closure */ | 1315 | case LUA_VCCL: { /* C closure */ |
1316 | CClosure *f = clCvalue(fi); | 1316 | CClosure *f = clCvalue(fi); |
1317 | if (!(cast_uint(n) - 1u < cast_uint(f->nupvalues))) | 1317 | if (!(cast_uint(n) - 1u < cast_uint(f->nupvalues))) |
1318 | return NULL; /* 'n' not in [1, f->nupvalues] */ | 1318 | return NULL; /* 'n' not in [1, f->nupvalues] */ |
@@ -1320,7 +1320,7 @@ static const char *aux_upvalue (TValue *fi, int n, TValue **val, | |||
1320 | if (owner) *owner = obj2gco(f); | 1320 | if (owner) *owner = obj2gco(f); |
1321 | return ""; | 1321 | return ""; |
1322 | } | 1322 | } |
1323 | case LUA_TLCL: { /* Lua closure */ | 1323 | case LUA_VLCL: { /* Lua closure */ |
1324 | LClosure *f = clLvalue(fi); | 1324 | LClosure *f = clLvalue(fi); |
1325 | TString *name; | 1325 | TString *name; |
1326 | Proto *p = f->p; | 1326 | Proto *p = f->p; |
@@ -1383,10 +1383,10 @@ static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { | |||
1383 | LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { | 1383 | LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { |
1384 | TValue *fi = index2value(L, fidx); | 1384 | TValue *fi = index2value(L, fidx); |
1385 | switch (ttypetag(fi)) { | 1385 | switch (ttypetag(fi)) { |
1386 | case LUA_TLCL: { /* lua closure */ | 1386 | case LUA_VLCL: { /* lua closure */ |
1387 | return *getupvalref(L, fidx, n, NULL); | 1387 | return *getupvalref(L, fidx, n, NULL); |
1388 | } | 1388 | } |
1389 | case LUA_TCCL: { /* C closure */ | 1389 | case LUA_VCCL: { /* C closure */ |
1390 | CClosure *f = clCvalue(fi); | 1390 | CClosure *f = clCvalue(fi); |
1391 | api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index"); | 1391 | api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index"); |
1392 | return &f->upvalue[n - 1]; | 1392 | return &f->upvalue[n - 1]; |