diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2014-04-09 22:27:18 -0700 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2014-04-09 22:27:18 -0700 |
commit | fa8bcca1dcf8fd87f3b3ce2853d1fe32526a0afa (patch) | |
tree | 9b4dc4b065f9f72226c8129322dfbc1be6db9ebc /adapters/libuv.h | |
parent | 065e90557c2f2bce6205c5006144bec75638836f (diff) | |
parent | 4369ee5d086967883ee91597540a599e543eacd6 (diff) |
Merge pull request #234 from mattsta/next-version
Next version of hiredis
Diffstat (limited to 'adapters/libuv.h')
-rw-r--r-- | adapters/libuv.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/adapters/libuv.h b/adapters/libuv.h index e61d5ca..a1967f4 100644 --- a/adapters/libuv.h +++ b/adapters/libuv.h @@ -3,7 +3,7 @@ #include <uv.h> #include "../hiredis.h" #include "../async.h" - +#include <string.h> 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; @@ -86,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) { @@ -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; |