summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libev-example.c6
-rw-r--r--libevent-example.c4
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;