diff options
| author | ruki <[email protected]> | 2026-03-29 22:31:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-29 22:31:50 +0800 |
| commit | f4513cc28aa778e1ad0d050511cc7e295fe81e32 (patch) | |
| tree | 4e16867adcee70e3073815f5e85caeb732b0a9bf /core/src | |
| parent | 21760e232a003e32f6ac10099a603a6366eb6aca (diff) | |
update to lua5.5
Diffstat (limited to 'core/src')
| m--------- | core/src/lua/lua | 0 | ||||
| -rw-r--r-- | core/src/xmake/curses/curses.c | 42 | ||||
| -rw-r--r-- | core/src/xmake/os/sleep.c | 2 |
3 files changed, 22 insertions, 22 deletions
diff --git a/core/src/lua/lua b/core/src/lua/lua -Subproject 1ab3208a1fceb12fca8f24ba57d6e13c5bff15e +Subproject a5522f06d2679b8f18534fd6a9968f7eb539dc3 diff --git a/core/src/xmake/curses/curses.c b/core/src/xmake/curses/curses.c index 95a0fcdac..8cf453660 100644 --- a/core/src/xmake/curses/curses.c +++ b/core/src/xmake/curses/curses.c @@ -228,8 +228,8 @@ static int xm_curses_window_tostring(lua_State *lua) { // window:move(y, x) static int xm_curses_window_move(lua_State *lua) { WINDOW *w = xm_curses_window_check(lua, 1); - int y = luaL_checkint(lua, 2); - int x = luaL_checkint(lua, 3); + int y = luaL_checkinteger(lua, 2); + int x = luaL_checkinteger(lua, 3); lua_pushboolean(lua, XM_CURSES_OK(wmove(w, y, x))); return 1; } @@ -276,7 +276,7 @@ static int xm_curses_window_addch(lua_State *lua) { static int xm_curses_window_addnstr(lua_State *lua) { WINDOW *w = xm_curses_window_check(lua, 1); const char *str = luaL_checkstring(lua, 2); - int n = luaL_optint(lua, 3, -1); + int n = luaL_optinteger(lua, 3, -1); if (n < 0) n = (int)lua_strlen(lua, 2); lua_pushboolean(lua, XM_CURSES_OK(waddnstr(w, str, n))); @@ -333,7 +333,7 @@ static int xm_curses_window_getch(lua_State *lua) { // window:attroff(attrs) static int xm_curses_window_attroff(lua_State *lua) { WINDOW *w = xm_curses_window_check(lua, 1); - int attrs = luaL_checkint(lua, 2); + int attrs = luaL_checkinteger(lua, 2); lua_pushboolean(lua, XM_CURSES_OK(wattroff(w, attrs))); return 1; } @@ -341,7 +341,7 @@ static int xm_curses_window_attroff(lua_State *lua) { // window:attron(attrs) static int xm_curses_window_attron(lua_State *lua) { WINDOW *w = xm_curses_window_check(lua, 1); - int attrs = luaL_checkint(lua, 2); + int attrs = luaL_checkinteger(lua, 2); lua_pushboolean(lua, XM_CURSES_OK(wattron(w, attrs))); return 1; } @@ -349,7 +349,7 @@ static int xm_curses_window_attron(lua_State *lua) { // window:attrset(attrs) static int xm_curses_window_attrset(lua_State *lua) { WINDOW *w = xm_curses_window_check(lua, 1); - int attrs = luaL_checkint(lua, 2); + int attrs = luaL_checkinteger(lua, 2); lua_pushboolean(lua, XM_CURSES_OK(wattrset(w, attrs))); return 1; } @@ -358,12 +358,12 @@ static int xm_curses_window_attrset(lua_State *lua) { static int xm_curses_window_copywin(lua_State *lua) { WINDOW *srcwin = xm_curses_window_check(lua, 1); WINDOW *dstwin = xm_curses_window_check(lua, 2); - int sminrow = luaL_checkint(lua, 3); - int smincol = luaL_checkint(lua, 4); - int dminrow = luaL_checkint(lua, 5); - int dmincol = luaL_checkint(lua, 6); - int dmaxrow = luaL_checkint(lua, 7); - int dmaxcol = luaL_checkint(lua, 8); + int sminrow = luaL_checkinteger(lua, 3); + int smincol = luaL_checkinteger(lua, 4); + int dminrow = luaL_checkinteger(lua, 5); + int dmincol = luaL_checkinteger(lua, 6); + int dmaxrow = luaL_checkinteger(lua, 7); + int dmaxcol = luaL_checkinteger(lua, 8); int overlay = lua_toboolean(lua, 9); lua_pushboolean(lua, XM_CURSES_OK( @@ -646,7 +646,7 @@ static int xm_curses_getmouse(lua_State *lua) { } static int xm_curses_mousemask(lua_State *lua) { - mmask_t m = luaL_checkint(lua, 1); + mmask_t m = luaL_checkinteger(lua, 1); mmask_t om; m = mousemask(m, &om); lua_pushinteger(lua, m); @@ -656,22 +656,22 @@ static int xm_curses_mousemask(lua_State *lua) { #endif static int xm_curses_init_pair(lua_State *lua) { - short pair = luaL_checkint(lua, 1); - short f = luaL_checkint(lua, 2); - short b = luaL_checkint(lua, 3); + short pair = luaL_checkinteger(lua, 1); + short f = luaL_checkinteger(lua, 2); + short b = luaL_checkinteger(lua, 3); lua_pushboolean(lua, XM_CURSES_OK(init_pair(pair, f, b))); return 1; } static int xm_curses_COLOR_PAIR(lua_State *lua) { - int n = luaL_checkint(lua, 1); + int n = luaL_checkinteger(lua, 1); lua_pushnumber(lua, COLOR_PAIR(n)); return 1; } static int xm_curses_curs_set(lua_State *lua) { - int vis = luaL_checkint(lua, 1); + int vis = luaL_checkinteger(lua, 1); int state = curs_set(vis); if (state == ERR) return 0; @@ -681,7 +681,7 @@ static int xm_curses_curs_set(lua_State *lua) { } static int xm_curses_napms(lua_State *lua) { - int ms = luaL_checkint(lua, 1); + int ms = luaL_checkinteger(lua, 1); lua_pushboolean(lua, XM_CURSES_OK(napms(ms))); return 1; } @@ -714,8 +714,8 @@ static int xm_curses_nl(lua_State *lua) { } static int xm_curses_newpad(lua_State *lua) { - int nlines = luaL_checkint(lua, 1); - int ncols = luaL_checkint(lua, 2); + int nlines = luaL_checkinteger(lua, 1); + int ncols = luaL_checkinteger(lua, 2); xm_curses_window_new(lua, newpad(nlines, ncols)); return 1; } diff --git a/core/src/xmake/os/sleep.c b/core/src/xmake/os/sleep.c index 0c8fa135e..384121981 100644 --- a/core/src/xmake/os/sleep.c +++ b/core/src/xmake/os/sleep.c @@ -35,7 +35,7 @@ */ tb_int_t xm_os_sleep(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); - tb_long_t interval = (tb_long_t)luaL_checklong(lua, 1); + tb_long_t interval = (tb_long_t)luaL_checkinteger(lua, 1); if (interval >= 0) { tb_msleep(interval); } |
