diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-13 18:10:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-13 18:10:50 -0300 |
commit | 8eb0abc9db4d47db5192bed18565e3d1aa53566d (patch) | |
tree | 2a8509c2fb739bd57274a4b12f532e3f5418dcb2 | |
parent | d862da6d04111ce7e5b225040fbe7e526761f478 (diff) | |
download | lua-8eb0abc9db4d47db5192bed18565e3d1aa53566d.tar.gz lua-8eb0abc9db4d47db5192bed18565e3d1aa53566d.tar.bz2 lua-8eb0abc9db4d47db5192bed18565e3d1aa53566d.zip |
Removed uses of LUA_NUMTAGS
That constant was already deprecated (see commit 6aabf4b15e7).
Diffstat (limited to '')
-rw-r--r-- | lgc.c | 2 | ||||
-rw-r--r-- | lstate.c | 2 | ||||
-rw-r--r-- | ltests.c | 4 | ||||
-rw-r--r-- | lua.h | 2 |
4 files changed, 4 insertions, 6 deletions
@@ -330,7 +330,7 @@ static void reallymarkobject (global_State *g, GCObject *o) { | |||
330 | */ | 330 | */ |
331 | static void markmt (global_State *g) { | 331 | static void markmt (global_State *g) { |
332 | int i; | 332 | int i; |
333 | for (i=0; i < LUA_NUMTAGS; i++) | 333 | for (i=0; i < LUA_NUMTYPES; i++) |
334 | markobjectN(g, g->mt[i]); | 334 | markobjectN(g, g->mt[i]); |
335 | } | 335 | } |
336 | 336 | ||
@@ -371,7 +371,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned int seed) { | |||
371 | setgcparam(g, MINORMUL, LUAI_GENMINORMUL); | 371 | setgcparam(g, MINORMUL, LUAI_GENMINORMUL); |
372 | setgcparam(g, MINORMAJOR, LUAI_MINORMAJOR); | 372 | setgcparam(g, MINORMAJOR, LUAI_MINORMAJOR); |
373 | setgcparam(g, MAJORMINOR, LUAI_MAJORMINOR); | 373 | setgcparam(g, MAJORMINOR, LUAI_MAJORMINOR); |
374 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; | 374 | for (i=0; i < LUA_NUMTYPES; i++) g->mt[i] = NULL; |
375 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { | 375 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { |
376 | /* memory allocation error: free partial state */ | 376 | /* memory allocation error: free partial state */ |
377 | close_state(L); | 377 | close_state(L); |
@@ -216,7 +216,7 @@ void *debug_realloc (void *ud, void *b, size_t oldsize, size_t size) { | |||
216 | mc->memlimit = limit ? strtoul(limit, NULL, 10) : ULONG_MAX; | 216 | mc->memlimit = limit ? strtoul(limit, NULL, 10) : ULONG_MAX; |
217 | } | 217 | } |
218 | if (block == NULL) { | 218 | if (block == NULL) { |
219 | type = (oldsize < LUA_NUMTAGS) ? oldsize : 0; | 219 | type = (oldsize < LUA_NUMTYPES) ? oldsize : 0; |
220 | oldsize = 0; | 220 | oldsize = 0; |
221 | } | 221 | } |
222 | else { | 222 | else { |
@@ -856,7 +856,7 @@ static int mem_query (lua_State *L) { | |||
856 | else { | 856 | else { |
857 | const char *t = luaL_checkstring(L, 1); | 857 | const char *t = luaL_checkstring(L, 1); |
858 | int i; | 858 | int i; |
859 | for (i = LUA_NUMTAGS - 1; i >= 0; i--) { | 859 | for (i = LUA_NUMTYPES - 1; i >= 0; i--) { |
860 | if (strcmp(t, ttypename(i)) == 0) { | 860 | if (strcmp(t, ttypename(i)) == 0) { |
861 | lua_pushinteger(L, l_memcontrol.objcount[i]); | 861 | lua_pushinteger(L, l_memcontrol.objcount[i]); |
862 | return 1; | 862 | return 1; |
@@ -442,8 +442,6 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx); | |||
442 | #define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1) | 442 | #define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1) |
443 | #define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1) | 443 | #define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1) |
444 | 444 | ||
445 | #define LUA_NUMTAGS LUA_NUMTYPES | ||
446 | |||
447 | #define lua_resetthread(L) lua_closethread(L,NULL) | 445 | #define lua_resetthread(L) lua_closethread(L,NULL) |
448 | 446 | ||
449 | /* }============================================================== */ | 447 | /* }============================================================== */ |