Skip to content

Commit

Permalink
Libuv: Fix compile warnings and C++ compatability
Browse files Browse the repository at this point in the history
Closes redis#189
  • Loading branch information
austinwiltshire authored and mattsta committed Apr 9, 2014
1 parent 303a042 commit f20f5ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adapters/libuv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#include <uv.h>
#include "../hiredis.h"
#include "../async.h"

#include <string.h>

typedef struct redisLibuvEvents {
redisAsyncContext* context;
uv_poll_t handle;
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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f20f5ad

Please sign in to comment.