summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2013-07-10 23:31:30 -0700
committerPieter Noordhuis <pcnoordhuis@gmail.com>2013-07-10 23:31:30 -0700
commitc532edc27f51d302246aea1b26ff830511cdf5ec (patch)
treeb49cc4321f7e998351e9198c9a063330ba184228
parent049346aa3399f98306656921350ca4f04e473e6b (diff)
Fix const-related compiler errors
-rw-r--r--async.c10
-rw-r--r--hiredis.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/async.c b/async.c
index 9d7cad1..6532712 100644
--- a/async.c
+++ b/async.c
@@ -62,8 +62,8 @@ void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
/* Functions managing dictionary of callbacks for pub/sub. */
static unsigned int callbackHash(const void *key) {
- return dictGenHashFunction((const unsigned char*)key
- , sdslen((const char*)key));
+ return dictGenHashFunction((const unsigned char *)key,
+ sdslen((const sds)key));
}
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) {
- const int l1, l2;
+ int l1, l2;
((void) privdata);
- l1 = sdslen((sds)key1);
- l2 = sdslen((sds)key2);
+ l1 = sdslen((const sds)key1);
+ l2 = sdslen((const sds)key2);
if (l1 != l2) return 0;
return memcmp(key1,key2,l1) == 0;
}
diff --git a/hiredis.c b/hiredis.c
index 65f84d0..80599db 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -665,7 +665,7 @@ int redisReaderGetReply(redisReader *r, void **reply) {
}
/* 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;
if (i < 0) {
len++;
@@ -679,7 +679,7 @@ static const int intlen(int i) {
}
/* 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;
}