From f20f5ad10264a10d41aa2a47c029fba71820d62a Mon Sep 17 00:00:00 2001 From: John Graham Date: Tue, 10 Sep 2013 15:18:16 -0500 Subject: Libuv: Fix compile warnings and C++ compatability Closes #189 --- adapters/libuv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'adapters/libuv.h') diff --git a/adapters/libuv.h b/adapters/libuv.h index e61d5ca..f959095 100644 --- a/adapters/libuv.h +++ b/adapters/libuv.h @@ -3,7 +3,7 @@ #include #include "../hiredis.h" #include "../async.h" - +#include typedef struct redisLibuvEvents { redisAsyncContext* context; @@ -11,6 +11,7 @@ typedef struct redisLibuvEvents { int events; } redisLibuvEvents; +int redisLibuvAttach(redisAsyncContext*, uv_loop_t*); static void redisLibuvPoll(uv_poll_t* handle, int status, int events) { redisLibuvEvents* p = (redisLibuvEvents*)handle->data; @@ -99,7 +100,7 @@ int redisLibuvAttach(redisAsyncContext* ac, uv_loop_t* loop) { ac->ev.delWrite = redisLibuvDelWrite; ac->ev.cleanup = redisLibuvCleanup; - redisLibuvEvents* p = malloc(sizeof(*p)); + redisLibuvEvents* p = (redisLibuvEvents*)malloc(sizeof(*p)); if (!p) { return REDIS_ERR; -- cgit v1.2.3 From 4ede1bada156038b83aa2c883fc8bc836a120ac4 Mon Sep 17 00:00:00 2001 From: Charlie Somerville Date: Fri, 6 Dec 2013 14:00:10 +1100 Subject: Define redisLibuvAttach as static Closes #206 --- adapters/libuv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'adapters/libuv.h') diff --git a/adapters/libuv.h b/adapters/libuv.h index f959095..a1967f4 100644 --- a/adapters/libuv.h +++ b/adapters/libuv.h @@ -87,7 +87,7 @@ static void redisLibuvCleanup(void *privdata) { } -int redisLibuvAttach(redisAsyncContext* ac, uv_loop_t* loop) { +static int redisLibuvAttach(redisAsyncContext* ac, uv_loop_t* loop) { redisContext *c = &(ac->c); if (ac->ev.data != NULL) { -- cgit v1.2.3