diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-11-22 09:45:55 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-11-22 09:45:55 +0100 |
commit | 4f4d1ed7b536f2358830751d2501c1147f5a4dad (patch) | |
tree | 7c2a370f8b375034516951fc83044e97180c95e7 | |
parent | 0d925bb497358148885642163a1716fbaeebd5a2 (diff) |
Explicit casts for the libev adapter
-rw-r--r-- | adapters/libev.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/adapters/libev.h b/adapters/libev.h index 79c069d..9e28bc4 100644 --- a/adapters/libev.h +++ b/adapters/libev.h @@ -12,18 +12,18 @@ typedef struct redisLibevEvents { void redisLibevReadEvent(struct ev_loop *loop, ev_io *watcher, int revents) { ((void)loop); ((void)revents); - redisLibevEvents *e = watcher->data; + redisLibevEvents *e = (redisLibevEvents*)watcher->data; redisAsyncHandleRead(e->context); } void redisLibevWriteEvent(struct ev_loop *loop, ev_io *watcher, int revents) { ((void)loop); ((void)revents); - redisLibevEvents *e = watcher->data; + redisLibevEvents *e = (redisLibevEvents*)watcher->data; redisAsyncHandleWrite(e->context); } void redisLibevAddRead(void *privdata) { - redisLibevEvents *e = privdata; + redisLibevEvents *e = (redisLibevEvents*)privdata; if (!e->reading) { e->reading = 1; ev_io_start(e->loop,&e->rev); @@ -31,7 +31,7 @@ void redisLibevAddRead(void *privdata) { } void redisLibevDelRead(void *privdata) { - redisLibevEvents *e = privdata; + redisLibevEvents *e = (redisLibevEvents*)privdata; if (e->reading) { e->reading = 0; ev_io_stop(e->loop,&e->rev); @@ -39,7 +39,7 @@ void redisLibevDelRead(void *privdata) { } void redisLibevAddWrite(void *privdata) { - redisLibevEvents *e = privdata; + redisLibevEvents *e = (redisLibevEvents*)privdata; if (!e->writing) { e->writing = 1; ev_io_start(e->loop,&e->wev); @@ -47,7 +47,7 @@ void redisLibevAddWrite(void *privdata) { } void redisLibevDelWrite(void *privdata) { - redisLibevEvents *e = privdata; + redisLibevEvents *e = (redisLibevEvents*)privdata; if (e->writing) { e->writing = 0; ev_io_stop(e->loop,&e->wev); @@ -55,7 +55,7 @@ void redisLibevDelWrite(void *privdata) { } void redisLibevCleanup(void *privdata) { - redisLibevEvents *e = privdata; + redisLibevEvents *e = (redisLibevEvents*)privdata; redisLibevDelRead(privdata); redisLibevDelWrite(privdata); free(e); @@ -70,7 +70,7 @@ int redisLibevAttach(redisAsyncContext *ac, struct ev_loop *loop) { return REDIS_ERR; /* Create container for context and r/w events */ - e = malloc(sizeof(*e)); + e = (redisLibevEvents*)malloc(sizeof(*e)); e->context = ac; e->loop = loop; e->reading = e->writing = 0; @@ -90,3 +90,4 @@ int redisLibevAttach(redisAsyncContext *ac, struct ev_loop *loop) { ev_io_init(&e->wev,redisLibevWriteEvent,c->fd,EV_WRITE); return REDIS_OK; } + |