diff options
author | Ryan Tecco <ryan@triggit.com> | 2010-11-21 16:26:55 -0800 |
---|---|---|
committer | Ryan Tecco <ryan@triggit.com> | 2010-11-21 16:26:55 -0800 |
commit | 0d925bb497358148885642163a1716fbaeebd5a2 (patch) | |
tree | ce48761d3dd7878a612cb94209a11c06f8720c22 | |
parent | a01c5b1352dd81d946b1c403bf632fa079a26c0b (diff) |
add explicit casts for C++ compiles - C++ disallows implicit casts from
void*
-rw-r--r-- | adapters/libevent.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/adapters/libevent.h b/adapters/libevent.h index 1b759c1..8531c52 100644 --- a/adapters/libevent.h +++ b/adapters/libevent.h @@ -10,38 +10,38 @@ typedef struct redisLibeventEvents { void redisLibeventReadEvent(int fd, short event, void *arg) { ((void)fd); ((void)event); - redisLibeventEvents *e = arg; + redisLibeventEvents *e = (redisLibeventEvents*)arg; redisAsyncHandleRead(e->context); } void redisLibeventWriteEvent(int fd, short event, void *arg) { ((void)fd); ((void)event); - redisLibeventEvents *e = arg; + redisLibeventEvents *e = (redisLibeventEvents*)arg; redisAsyncHandleWrite(e->context); } void redisLibeventAddRead(void *privdata) { - redisLibeventEvents *e = privdata; + redisLibeventEvents *e = (redisLibeventEvents*)privdata; event_add(&e->rev,NULL); } void redisLibeventDelRead(void *privdata) { - redisLibeventEvents *e = privdata; + redisLibeventEvents *e = (redisLibeventEvents*)privdata; event_del(&e->rev); } void redisLibeventAddWrite(void *privdata) { - redisLibeventEvents *e = privdata; + redisLibeventEvents *e = (redisLibeventEvents*)privdata; event_add(&e->wev,NULL); } void redisLibeventDelWrite(void *privdata) { - redisLibeventEvents *e = privdata; + redisLibeventEvents *e = (redisLibeventEvents*)privdata; event_del(&e->wev); } void redisLibeventCleanup(void *privdata) { - redisLibeventEvents *e = privdata; + redisLibeventEvents *e = (redisLibeventEvents*)privdata; event_del(&e->rev); event_del(&e->wev); free(e); @@ -56,7 +56,7 @@ int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { return REDIS_ERR; /* Create container for context and r/w events */ - e = malloc(sizeof(*e)); + e = (redisLibeventEvents*)malloc(sizeof(*e)); e->context = ac; /* Register functions to start/stop listening for events */ |