Commit e5dd32d8 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Add const qualifier to privdata pointer for command callbacks

parent 5c7b5fca
...@@ -806,7 +806,7 @@ void *redisCommand(redisContext *c, const char *format, ...) { ...@@ -806,7 +806,7 @@ void *redisCommand(redisContext *c, const char *format, ...) {
* Always returns NULL. In a non-blocking context this will never fail because * 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 * 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). */ * 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; va_list ap;
sds cmd; sds cmd;
int status; int status;
......
...@@ -76,10 +76,10 @@ struct redisContext; /* need forward declaration of redisContext */ ...@@ -76,10 +76,10 @@ struct redisContext; /* need forward declaration of redisContext */
typedef void (redisContextCallback)(struct redisContext*, void*); typedef void (redisContextCallback)(struct redisContext*, void*);
/* Reply callback prototype and container */ /* Reply callback prototype and container */
typedef void redisCallbackFn(struct redisContext*, redisReply*, void*); typedef void redisCallbackFn(struct redisContext*, redisReply*, const void*);
typedef struct redisCallback { typedef struct redisCallback {
redisCallbackFn *fn; redisCallbackFn *fn;
void *privdata; const void *privdata;
} redisCallback; } redisCallback;
/* Context for a connection to Redis */ /* Context for a connection to Redis */
...@@ -124,6 +124,6 @@ int redisGetReply(redisContext *c, void **reply); ...@@ -124,6 +124,6 @@ int redisGetReply(redisContext *c, void **reply);
int redisProcessCallbacks(redisContext *c); int redisProcessCallbacks(redisContext *c);
void *redisCommand(redisContext *c, const char *format, ...); 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 #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment