diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 20:49:37 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 21:24:30 +0200 |
commit | 947612865d5dce64240955bc152e225f385349a8 (patch) | |
tree | 01ba755c77440230a91bd2cd31398deee222c958 | |
parent | d4b4a9128eefe9ac57de1fea371f3b3dacae0b1c (diff) |
Remove const qualifier from command callback in examples
-rw-r--r-- | libev-example.c | 6 | ||||
-rw-r--r-- | libevent-example.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libev-example.c b/libev-example.c index 8c48121..4cf2c0e 100644 --- a/libev-example.c +++ b/libev-example.c @@ -4,8 +4,8 @@ #include <hiredis/libev.h> #include <signal.h> -void getCallback(redisContext *c, redisReply *reply, const void *privdata) { - printf("argv[%s]: %s\n", (const char*)privdata, reply->reply); +void getCallback(redisContext *c, redisReply *reply, void *privdata) { + printf("argv[%s]: %s\n", (char*)privdata, reply->reply); /* Disconnect after receiving the reply to GET */ redisDisconnect(c); @@ -23,7 +23,7 @@ int main (int argc, char **argv) { if (c == NULL) return 1; redisCommand(c, "SET key %b", argv[argc-1], strlen(argv[argc-1])); - redisCommandWithCallback(c, getCallback, "end-1", "GET key"); + redisCommandWithCallback(c, getCallback, (char*)"end-1", "GET key"); ev_loop(loop, 0); redisFree(c); return 0; diff --git a/libevent-example.c b/libevent-example.c index 19d4d16..ef68674 100644 --- a/libevent-example.c +++ b/libevent-example.c @@ -4,7 +4,7 @@ #include <hiredis/libevent.h> #include <signal.h> -void getCallback(redisContext *c, redisReply *reply, const void *privdata) { +void getCallback(redisContext *c, redisReply *reply, void *privdata) { printf("argv[%s]: %s\n", (const char*)privdata, reply->reply); /* Disconnect after receiving the reply to GET */ @@ -23,7 +23,7 @@ int main (int argc, char **argv) { if (c == NULL) return 1; redisCommand(c, "SET key %b", argv[argc-1], strlen(argv[argc-1])); - redisCommandWithCallback(c, getCallback, "end-1", "GET key"); + redisCommandWithCallback(c, getCallback, (char*)"end-1", "GET key"); event_base_dispatch(base); redisFree(c); return 0; |