mirror of https://github.com/rusefi/lua.git
removed unused macros 'isstackindex'/'api_checkstackindex' +
macro 'api_checkvalidindex' (used only once) expanded and removed
This commit is contained in:
parent
b6780ee41b
commit
d406d3d05f
12
lapi.c
12
lapi.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.291 2018/04/04 14:23:41 roberto Exp roberto $
|
** $Id: lapi.c,v 2.292 2018/06/01 17:40:38 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -51,14 +51,6 @@ static const TValue nonvalidvaluep = {NILCONSTANT};
|
||||||
/* test for upvalue */
|
/* test for upvalue */
|
||||||
#define isupvalue(i) ((i) < LUA_REGISTRYINDEX)
|
#define isupvalue(i) ((i) < LUA_REGISTRYINDEX)
|
||||||
|
|
||||||
/* test for valid but not pseudo index */
|
|
||||||
#define isstackindex(i, o) (isvalid(o) && !ispseudo(i))
|
|
||||||
|
|
||||||
#define api_checkvalidindex(l,o) api_check(l, isvalid(o), "invalid index")
|
|
||||||
|
|
||||||
#define api_checkstackindex(l, i, o) \
|
|
||||||
api_check(l, isstackindex(i, o), "index not in the stack")
|
|
||||||
|
|
||||||
|
|
||||||
static TValue *index2value (lua_State *L, int idx) {
|
static TValue *index2value (lua_State *L, int idx) {
|
||||||
CallInfo *ci = L->ci;
|
CallInfo *ci = L->ci;
|
||||||
|
@ -233,7 +225,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
|
||||||
lua_lock(L);
|
lua_lock(L);
|
||||||
fr = index2value(L, fromidx);
|
fr = index2value(L, fromidx);
|
||||||
to = index2value(L, toidx);
|
to = index2value(L, toidx);
|
||||||
api_checkvalidindex(L, to);
|
api_check(l, isvalid(to), "invalid index");
|
||||||
setobj(L, to, fr);
|
setobj(L, to, fr);
|
||||||
if (isupvalue(toidx)) /* function upvalue? */
|
if (isupvalue(toidx)) /* function upvalue? */
|
||||||
luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr);
|
luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr);
|
||||||
|
|
Loading…
Reference in New Issue