diff options
author | michael-grunder <michael.grunder@gmail.com> | 2016-06-02 20:44:57 +0300 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2016-06-02 20:44:57 +0300 |
commit | 254319ddb84f19d7296f3e92b3b9c665853189c5 (patch) | |
tree | 6a2025a4dce9f618f5b1c0b97bcb98f6ed050566 | |
parent | 455fffaa46f2b7e412a173ad6ea2825759203467 (diff) |
Fix compiler warning
-rw-r--r-- | cluster_library.c | 5 | ||||
-rw-r--r-- | crc16.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cluster_library.c b/cluster_library.c index 248758b4..38e4827a 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -117,7 +117,7 @@ static void cluster_multibulk_resp_recursive(RedisSock *sock, size_t elements, clusterReply **element, int *err TSRMLS_DC) { - size_t idx = 0; + size_t idx = 0, sz; clusterReply *r; long len; char buf[1024]; @@ -138,10 +138,11 @@ cluster_multibulk_resp_recursive(RedisSock *sock, size_t elements, switch(r->type) { case TYPE_ERR: case TYPE_LINE: - if(redis_sock_gets(sock, buf, sizeof(buf), &r->len) < 0) { + if(redis_sock_gets(sock, buf, sizeof(buf), &sz) < 0) { *err = 1; return; } + r->len = (long long)sz; break; case TYPE_INT: r->integer = len; @@ -78,7 +78,7 @@ static const uint16_t crc16tab[256]= { 0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0 }; -static uint16_t crc16(const char *buf, int len) { +static inline uint16_t crc16(const char *buf, int len) { int counter; uint16_t crc = 0; for (counter = 0; counter < len; counter++) |