summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-07 17:35:31 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-07 17:35:31 +0200
commite5dd32d809b46a300e14f8cd1422b5a0d817a680 (patch)
tree25a3a35ef03230c1a52f4c3a1ed0d5b8130a68fb
parent5c7b5fca4d36fbf5050a1b36e9308fdd8bf5813c (diff)
Add const qualifier to privdata pointer for command callbacks
-rw-r--r--hiredis.c2
-rw-r--r--hiredis.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/hiredis.c b/hiredis.c
index 4544c28..97ef78b 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -806,7 +806,7 @@ void *redisCommand(redisContext *c, const char *format, ...) {
* Always returns NULL. In a non-blocking context this will never fail because
* this function does not do any I/O. In a blocking context this function will
* have no effect (a callback in a blocking context makes no sense). */
-void *redisCommandWithCallback(redisContext *c, redisCallbackFn *fn, void *privdata, const char *format, ...) {
+void *redisCommandWithCallback(redisContext *c, redisCallbackFn *fn, const void *privdata, const char *format, ...) {
va_list ap;
sds cmd;
int status;
diff --git a/hiredis.h b/hiredis.h
index 72a4077..0dd32bd 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -76,10 +76,10 @@ struct redisContext; /* need forward declaration of redisContext */
typedef void (redisContextCallback)(struct redisContext*, void*);
/* Reply callback prototype and container */
-typedef void redisCallbackFn(struct redisContext*, redisReply*, void*);
+typedef void redisCallbackFn(struct redisContext*, redisReply*, const void*);
typedef struct redisCallback {
redisCallbackFn *fn;
- void *privdata;
+ const void *privdata;
} redisCallback;
/* Context for a connection to Redis */
@@ -124,6 +124,6 @@ int redisGetReply(redisContext *c, void **reply);
int redisProcessCallbacks(redisContext *c);
void *redisCommand(redisContext *c, const char *format, ...);
-void *redisCommandWithCallback(redisContext *c, redisCallbackFn *fn, void *privdata, const char *format, ...);
+void *redisCommandWithCallback(redisContext *c, redisCallbackFn *fn, const void *privdata, const char *format, ...);
#endif