From 947612865d5dce64240955bc152e225f385349a8 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 19 Oct 2010 20:49:37 +0200 Subject: Remove const qualifier from command callback in examples --- libev-example.c | 6 +++--- 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 #include -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 #include -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; -- cgit v1.2.3