Skip to content

Commit

Permalink
(lua) suppress warning in trace function reg.
Browse files Browse the repository at this point in the history
even if there's 0 arguments returned on the stack, lua needs that
information to be happy.
  • Loading branch information
letoram committed Oct 9, 2023
1 parent e03b524 commit ba00b99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/engine/alt/trace.c
Expand Up @@ -199,7 +199,7 @@ void alt_trace_finish(lua_State* L)
luaL_unref(L, LUA_REGISTRYINDEX, trace_cb);
}

void alt_trace_log(lua_State* ctx)
int alt_trace_log(lua_State* ctx)
{
const char str_prefix[] = "LUA_PRINT: ";

Expand All @@ -222,7 +222,7 @@ void alt_trace_log(lua_State* ctx)
if (log_buffer == 0) {
const char oom_msg[] = "Couldn't log trace message: Out of memory\n";
arcan_trace_log(oom_msg, sizeof(oom_msg));
return;
return 0;
}

int running_len = sizeof(str_prefix) - 1;
Expand All @@ -244,4 +244,5 @@ void alt_trace_log(lua_State* ctx)
arcan_trace_log(log_buffer, total_len);

arcan_mem_free(log_buffer);
return 0;
}
2 changes: 1 addition & 1 deletion src/engine/alt/trace.h
Expand Up @@ -12,7 +12,7 @@ void alt_trace_finish(lua_State* ctx);
/*
* logs text string in stdout and in active trace buffer
*/
void alt_trace_log(lua_State* ctx);
int alt_trace_log(lua_State* ctx);

/*
* copy [msg] and keep as the last known crash source in the
Expand Down

0 comments on commit ba00b99

Please sign in to comment.