Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile warnings. #626

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@ static void luv_fs_cb(uv_fs_t* req) {
// variable 'nargs' to the number of return values
#define FS_CALL_NORETURN(func, req, ...) { \
int ret, sync; \
luv_req_t* data = (luv_req_t*)req->data; \
sync = data->callback_ref == LUA_NOREF; \
ret = func(data->ctx->loop, req, __VA_ARGS__, \
luv_req_t* lreq = (luv_req_t*)req->data; \
sync = lreq->callback_ref == LUA_NOREF; \
ret = func(lreq->ctx->loop, req, __VA_ARGS__, \
sync ? NULL : luv_fs_cb); \
if (req->fs_type != UV_FS_ACCESS && ret < 0) { \
lua_pushnil(L); \
if (fs_req_has_dest_path(req)) { \
lua_rawgeti(L, LUA_REGISTRYINDEX, data->data_ref); \
lua_rawgeti(L, LUA_REGISTRYINDEX, lreq->data_ref); \
const char* dest_path = lua_tostring(L, -1); \
lua_pop(L, 1); \
lua_pushfstring(L, "%s: %s: %s -> %s", \
Expand All @@ -455,7 +455,7 @@ static void luv_fs_cb(uv_fs_t* req) {
} \
lua_pushstring(L, uv_err_name(req->result)); \
if(req->fs_type != UV_FS_SCANDIR) { \
luv_cleanup_req(L, data); \
luv_cleanup_req(L, lreq); \
req->data = NULL; \
uv_fs_req_cleanup(req); \
} \
Expand All @@ -464,13 +464,13 @@ static void luv_fs_cb(uv_fs_t* req) {
else if (sync) { \
nargs = push_fs_result(L, req); \
if(req->fs_type != UV_FS_SCANDIR) { \
luv_cleanup_req(L, data); \
luv_cleanup_req(L, lreq); \
req->data = NULL; \
uv_fs_req_cleanup(req); \
} \
} \
else { \
lua_rawgeti(L, LUA_REGISTRYINDEX, data->req_ref); \
lua_rawgeti(L, LUA_REGISTRYINDEX, lreq->req_ref); \
nargs = 1; \
} \
}
Expand Down
2 changes: 1 addition & 1 deletion src/luv.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ LUALIB_API void luv_set_cthread(lua_State* L, luv_CFcpcall cpcall);
*/
LUALIB_API int luaopen_luv (lua_State *L);

typedef lua_State* (*luv_acquire_vm)();
typedef lua_State* (*luv_acquire_vm)(void);
typedef void (*luv_release_vm)(lua_State* L);
LUALIB_API void luv_set_thread_cb(luv_acquire_vm acquire, luv_release_vm release);

Expand Down
2 changes: 1 addition & 1 deletion src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int luv_arg_type_error(lua_State* L, int index, const char* fmt);
static int luv_optboolean(lua_State*L, int idx, int defaultval);

/* From thread.c */
static lua_State* luv_thread_acquire_vm();
static lua_State* luv_thread_acquire_vm(void);

/* From process.c */
static int luv_parse_signal(lua_State* L, int slot);
Expand Down
2 changes: 1 addition & 1 deletion src/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef struct {
luv_thread_arg_t args;
} luv_thread_t;

static lua_State* luv_thread_acquire_vm() {
static lua_State* luv_thread_acquire_vm(void) {
lua_State* L = luaL_newstate();

// Add in the lua standard libraries
Expand Down
6 changes: 3 additions & 3 deletions src/work.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int luv_work_cb(lua_State* L) {
return LUA_OK;
}

static lua_State* luv_work_acquire_vm()
static lua_State* luv_work_acquire_vm(void)
{
lua_State* L = uv_key_get(&tls_vmkey);
if (L == NULL)
Expand Down Expand Up @@ -245,7 +245,7 @@ static const luaL_Reg luv_work_ctx_methods[] = {
{NULL, NULL}
};

static void luv_key_init_once()
static void luv_key_init_once(void)
{
const char* val;
int status = uv_key_create(&tls_vmkey);
Expand Down Expand Up @@ -287,7 +287,7 @@ static void luv_key_init_once()
idx_vms = 0;
}

static void luv_work_cleanup()
static void luv_work_cleanup(void)
{
unsigned int i;

Expand Down