From 4f4d1ed7b536f2358830751d2501c1147f5a4dad Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 22 Nov 2010 09:45:55 +0100 Subject: Explicit casts for the libev adapter --- adapters/libev.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'adapters') 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; } + -- cgit v1.2.3