Skip to content

Commit

Permalink
(build) trying to merge patches from laptop
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 58dbb69f95903b5bb2e637a01e5aa7e5cc8bb5b99c6697feed536137194e1fe0
  • Loading branch information
void committed Feb 3, 2025
2 parents aa6d2b1 + e5b35b2 commit f2e572a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/engine/alt/nbio.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ int alt_nbio_process_read(
}
}

lua_Number luaL_optbnumber(lua_State* L, int narg, lua_Number opt)
bool luaL_optbnumber(lua_State* L, int narg, lua_Number opt)
{
if (lua_isnumber(L, narg))
return lua_tonumber(L, narg);
Expand All @@ -876,7 +876,7 @@ lua_Number luaL_optbnumber(lua_State* L, int narg, lua_Number opt)
return opt;
}

lua_Number luaL_checkbnumber(lua_State* L, int narg)
bool luaL_checkbnumber(lua_State* L, int narg)
{
lua_Number d = lua_tonumber(L, narg);
if (d == 0 && !lua_isnumber(L, narg)){
Expand Down
4 changes: 2 additions & 2 deletions src/engine/alt/support.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ static void set_tblbool(lua_State* ctx, char* k, bool v, int top, size_t k_sz)

/* a type-cohersion variant that accepts both bool and if (0) style
* argument passing for functions. */
lua_Number luaL_checkbnumber(lua_State* L, int narg);
lua_Number luaL_optbnumber(lua_State* L, int narg, lua_Number opt);
bool luaL_checkbnumber(lua_State* L, int narg);
bool luaL_optbnumber(lua_State* L, int narg, lua_Number opt);

/* used as a lua_call wrapper that provides different error handling, ... */
void alt_call(lua_State*,
Expand Down
2 changes: 1 addition & 1 deletion src/engine/alt/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void alt_trace_dumptable_raw(lua_State* L, int ofs, int cap, FILE* out)
void alt_trace_dumpstack_raw(lua_State* L, FILE* out)
{
int top = lua_gettop(L);
while (top >= 0){
while (top > 0){
fprintf(out, "type=stack:index=%d:name=%d:var", top, top);
alt_trace_print_type(L, top, "\n", out);
top--;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/arcan_frameserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ arcan_errc arcan_frameserver_free(arcan_frameserver* src)
arcan_renderfun_release_fontgroup(src->desc.text.group);
src->desc.text.group = NULL;

char msg[32];
char msg[36];

if (src->cookie_fail)
snprintf(msg, COUNT_OF(msg), "Integrity cookie mismatch");
Expand Down
4 changes: 2 additions & 2 deletions src/engine/arcan_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ static int debugstall(lua_State* ctx)
if (tn <= 0)
unsetenv("ARCAN_FRAMESERVER_DEBUGSTALL");
else{
char buf[4];
snprintf(buf, 4, "%4d", tn);
char buf[5];
snprintf(buf, 5, "%4d", tn);
setenv("ARCAN_FRAMESERVER_DEBUGSTALL", buf, 1);
}

Expand Down
4 changes: 3 additions & 1 deletion src/engine/arcan_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ void arcan_monitor_finish(bool ok)
arcan_monitor_watchdog(NULL, NULL);
}

extern struct arcan_luactx* main_lua_context;
void arcan_monitor_tick(int n)
{
static size_t count;
Expand All @@ -988,7 +989,8 @@ void arcan_monitor_tick(int n)
.events = POLLIN
};
if (1 == poll(&pfd, 1, 0)){
arcan_monitor_watchdog(NULL, NULL);
arcan_monitor_watchdog(
(lua_State*)main_lua_context, NULL);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shmif/tui/lua/tui_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static void init_lmeta(lua_State* L, struct tui_lmeta* l, struct tui_lmeta* p)
lua_setmetatable(L, -2);
}

static lua_Number luaL_optbnumber(lua_State* L, int narg, lua_Number opt)
static bool luaL_optbnumber(lua_State* L, int narg, lua_Number opt)
{
if (lua_isnumber(L, narg))
return lua_tonumber(L, narg);
Expand Down

0 comments on commit f2e572a

Please sign in to comment.