Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
e5dd32d8
Commit
e5dd32d8
authored
Oct 07, 2010
by
Pieter Noordhuis
Browse files
Add const qualifier to privdata pointer for command callbacks
parent
5c7b5fca
Changes
2
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
e5dd32d8
...
...
@@ -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
;
...
...
hiredis.h
View file @
e5dd32d8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment