use new lua userdata api

This commit is contained in:
Cloud Wu
2020-10-10 19:19:33 +08:00
parent 623d8182eb
commit a87b039c6d
10 changed files with 26 additions and 26 deletions

View File

@@ -151,7 +151,7 @@ get_size(lua_State *L) {
static int
box_state(lua_State *L, lua_State *mL) {
struct state_ud *ud = (struct state_ud *)lua_newuserdata(L, sizeof(*ud));
struct state_ud *ud = (struct state_ud *)lua_newuserdatauv(L, sizeof(*ud), 0);
ud->L = mL;
if (luaL_newmetatable(L, "BOXMATRIXSTATE")) {
lua_pushvalue(L, -1);