From 99d8ca718bf35fd93f786f36886fd5ff0fb244a0 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Tue, 10 Aug 2021 10:40:53 -0400 Subject: [PATCH] eris: fix lua_modflagbits --- luprex/eris-master/src/lapi.c | 4 ++-- luprex/eris-master/src/lua.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/luprex/eris-master/src/lapi.c b/luprex/eris-master/src/lapi.c index 6b3d1181..a7664702 100644 --- a/luprex/eris-master/src/lapi.c +++ b/luprex/eris-master/src/lapi.c @@ -909,15 +909,15 @@ LUA_API void lua_setflagbits (lua_State *L, int idx, unsigned short bits) { lua_unlock(L); } -LUA_API void lua_modflagbits (lua_State *L, int idx, unsigned short set, unsigned short clear) { +LUA_API void lua_modflagbits (lua_State *L, int idx, unsigned short clear, unsigned short set) { TValue *obj; Table *tab; lua_lock(L); obj = index2addr(L, idx); api_check(L, ttistable(obj), "table expected"); tab = hvalue(obj); - tab->flagbits |= set; tab->flagbits &= (~clear); + tab->flagbits |= set; lua_unlock(L); } diff --git a/luprex/eris-master/src/lua.h b/luprex/eris-master/src/lua.h index 1022c754..a78a5e1b 100644 --- a/luprex/eris-master/src/lua.h +++ b/luprex/eris-master/src/lua.h @@ -246,7 +246,7 @@ LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); LUA_API int (lua_setmetatable) (lua_State *L, int objindex); LUA_API void (lua_setuservalue) (lua_State *L, int idx); LUA_API void (lua_setflagbits) (lua_State *L, int idx, unsigned short bits); -LUA_API void (lua_modflagbits) (lua_State *L, int idx, unsigned short set, unsigned short clear); +LUA_API void (lua_modflagbits) (lua_State *L, int idx, unsigned short clear, unsigned short set); LUA_API unsigned short (lua_getflagbits) (lua_State *L, int idx); /*