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
c532edc2
Commit
c532edc2
authored
Jul 10, 2013
by
Pieter Noordhuis
Browse files
Fix const-related compiler errors
parent
049346aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
async.c
View file @
c532edc2
...
@@ -62,8 +62,8 @@ void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
...
@@ -62,8 +62,8 @@ void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
/* Functions managing dictionary of callbacks for pub/sub. */
/* Functions managing dictionary of callbacks for pub/sub. */
static
unsigned
int
callbackHash
(
const
void
*
key
)
{
static
unsigned
int
callbackHash
(
const
void
*
key
)
{
return
dictGenHashFunction
((
const
unsigned
char
*
)
key
return
dictGenHashFunction
((
const
unsigned
char
*
)
key
,
,
sdslen
((
const
char
*
)
key
));
sdslen
((
const
sds
)
key
));
}
}
static
void
*
callbackValDup
(
void
*
privdata
,
const
void
*
src
)
{
static
void
*
callbackValDup
(
void
*
privdata
,
const
void
*
src
)
{
...
@@ -74,11 +74,11 @@ static void *callbackValDup(void *privdata, const void *src) {
...
@@ -74,11 +74,11 @@ static void *callbackValDup(void *privdata, const void *src) {
}
}
static
int
callbackKeyCompare
(
void
*
privdata
,
const
void
*
key1
,
const
void
*
key2
)
{
static
int
callbackKeyCompare
(
void
*
privdata
,
const
void
*
key1
,
const
void
*
key2
)
{
const
int
l1
,
l2
;
int
l1
,
l2
;
((
void
)
privdata
);
((
void
)
privdata
);
l1
=
sdslen
((
sds
)
key1
);
l1
=
sdslen
((
const
sds
)
key1
);
l2
=
sdslen
((
sds
)
key2
);
l2
=
sdslen
((
const
sds
)
key2
);
if
(
l1
!=
l2
)
return
0
;
if
(
l1
!=
l2
)
return
0
;
return
memcmp
(
key1
,
key2
,
l1
)
==
0
;
return
memcmp
(
key1
,
key2
,
l1
)
==
0
;
}
}
...
...
hiredis.c
View file @
c532edc2
...
@@ -665,7 +665,7 @@ int redisReaderGetReply(redisReader *r, void **reply) {
...
@@ -665,7 +665,7 @@ int redisReaderGetReply(redisReader *r, void **reply) {
}
}
/* Calculate the number of bytes needed to represent an integer as string. */
/* Calculate the number of bytes needed to represent an integer as string. */
static
const
int
intlen
(
int
i
)
{
static
int
intlen
(
int
i
)
{
int
len
=
0
;
int
len
=
0
;
if
(
i
<
0
)
{
if
(
i
<
0
)
{
len
++
;
len
++
;
...
@@ -679,7 +679,7 @@ static const int intlen(int i) {
...
@@ -679,7 +679,7 @@ static const int intlen(int i) {
}
}
/* Helper that calculates the bulk length given a certain string length. */
/* Helper that calculates the bulk length given a certain string length. */
static
const
size_t
bulklen
(
size_t
len
)
{
static
size_t
bulklen
(
size_t
len
)
{
return
1
+
intlen
(
len
)
+
2
+
len
+
2
;
return
1
+
intlen
(
len
)
+
2
+
len
+
2
;
}
}
...
...
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