Commit e1222d8b authored by Yossi Gottlieb's avatar Yossi Gottlieb
Browse files

Clean gcc 7.x warnings, redis-cli cluster fix.

parent 86de089a
...@@ -429,14 +429,14 @@ uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) { ...@@ -429,14 +429,14 @@ uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) {
} }
switch(len & 7) { switch(len & 7) {
case 7: h ^= (uint64_t)data[6] << 48; case 7: h ^= (uint64_t)data[6] << 48; /* fall-thru */
case 6: h ^= (uint64_t)data[5] << 40; case 6: h ^= (uint64_t)data[5] << 40; /* fall-thru */
case 5: h ^= (uint64_t)data[4] << 32; case 5: h ^= (uint64_t)data[4] << 32; /* fall-thru */
case 4: h ^= (uint64_t)data[3] << 24; case 4: h ^= (uint64_t)data[3] << 24; /* fall-thru */
case 3: h ^= (uint64_t)data[2] << 16; case 3: h ^= (uint64_t)data[2] << 16; /* fall-thru */
case 2: h ^= (uint64_t)data[1] << 8; case 2: h ^= (uint64_t)data[1] << 8; /* fall-thru */
case 1: h ^= (uint64_t)data[0]; case 1: h ^= (uint64_t)data[0];
h *= m; h *= m; /* fall-thru */
}; };
h ^= h >> r; h ^= h >> r;
......
...@@ -86,6 +86,8 @@ lzf_decompress (const void *const in_data, unsigned int in_len, ...@@ -86,6 +86,8 @@ lzf_decompress (const void *const in_data, unsigned int in_len,
#ifdef lzf_movsb #ifdef lzf_movsb
lzf_movsb (op, ip, ctrl); lzf_movsb (op, ip, ctrl);
#else #else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
switch (ctrl) switch (ctrl)
{ {
case 32: *op++ = *ip++; case 31: *op++ = *ip++; case 30: *op++ = *ip++; case 29: *op++ = *ip++; case 32: *op++ = *ip++; case 31: *op++ = *ip++; case 30: *op++ = *ip++; case 29: *op++ = *ip++;
...@@ -97,6 +99,7 @@ lzf_decompress (const void *const in_data, unsigned int in_len, ...@@ -97,6 +99,7 @@ lzf_decompress (const void *const in_data, unsigned int in_len,
case 8: *op++ = *ip++; case 7: *op++ = *ip++; case 6: *op++ = *ip++; case 5: *op++ = *ip++; case 8: *op++ = *ip++; case 7: *op++ = *ip++; case 6: *op++ = *ip++; case 5: *op++ = *ip++;
case 4: *op++ = *ip++; case 3: *op++ = *ip++; case 2: *op++ = *ip++; case 1: *op++ = *ip++; case 4: *op++ = *ip++; case 3: *op++ = *ip++; case 2: *op++ = *ip++; case 1: *op++ = *ip++;
} }
#pragma GCC diagnostic pop
#endif #endif
} }
else /* back reference */ else /* back reference */
...@@ -163,17 +166,17 @@ lzf_decompress (const void *const in_data, unsigned int in_len, ...@@ -163,17 +166,17 @@ lzf_decompress (const void *const in_data, unsigned int in_len,
break; break;
case 9: *op++ = *ref++; case 9: *op++ = *ref++; /* fall-thru */
case 8: *op++ = *ref++; case 8: *op++ = *ref++; /* fall-thru */
case 7: *op++ = *ref++; case 7: *op++ = *ref++; /* fall-thru */
case 6: *op++ = *ref++; case 6: *op++ = *ref++; /* fall-thru */
case 5: *op++ = *ref++; case 5: *op++ = *ref++; /* fall-thru */
case 4: *op++ = *ref++; case 4: *op++ = *ref++; /* fall-thru */
case 3: *op++ = *ref++; case 3: *op++ = *ref++; /* fall-thru */
case 2: *op++ = *ref++; case 2: *op++ = *ref++; /* fall-thru */
case 1: *op++ = *ref++; case 1: *op++ = *ref++; /* fall-thru */
case 0: *op++ = *ref++; /* two octets more */ case 0: *op++ = *ref++; /* two octets more */
*op++ = *ref++; *op++ = *ref++; /* fall-thru */
} }
#endif #endif
} }
......
...@@ -5091,7 +5091,7 @@ static int clusterManagerCommandImport(int argc, char **argv) { ...@@ -5091,7 +5091,7 @@ static int clusterManagerCommandImport(int argc, char **argv) {
// Build a slot -> node map // Build a slot -> node map
clusterManagerNode *slots_map[CLUSTER_MANAGER_SLOTS]; clusterManagerNode *slots_map[CLUSTER_MANAGER_SLOTS];
memset(slots_map, 0, sizeof(slots_map) / sizeof(clusterManagerNode *)); memset(slots_map, 0, sizeof(slots_map));
listIter li; listIter li;
listNode *ln; listNode *ln;
for (i = 0; i < CLUSTER_MANAGER_SLOTS; i++) { for (i = 0; i < CLUSTER_MANAGER_SLOTS; i++) {
......
...@@ -142,12 +142,12 @@ uint64_t siphash(const uint8_t *in, const size_t inlen, const uint8_t *k) { ...@@ -142,12 +142,12 @@ uint64_t siphash(const uint8_t *in, const size_t inlen, const uint8_t *k) {
} }
switch (left) { switch (left) {
case 7: b |= ((uint64_t)in[6]) << 48; case 7: b |= ((uint64_t)in[6]) << 48; /* fall-thru */
case 6: b |= ((uint64_t)in[5]) << 40; case 6: b |= ((uint64_t)in[5]) << 40; /* fall-thru */
case 5: b |= ((uint64_t)in[4]) << 32; case 5: b |= ((uint64_t)in[4]) << 32; /* fall-thru */
case 4: b |= ((uint64_t)in[3]) << 24; case 4: b |= ((uint64_t)in[3]) << 24; /* fall-thru */
case 3: b |= ((uint64_t)in[2]) << 16; case 3: b |= ((uint64_t)in[2]) << 16; /* fall-thru */
case 2: b |= ((uint64_t)in[1]) << 8; case 2: b |= ((uint64_t)in[1]) << 8; /* fall-thru */
case 1: b |= ((uint64_t)in[0]); break; case 1: b |= ((uint64_t)in[0]); break;
case 0: break; case 0: break;
} }
...@@ -202,12 +202,12 @@ uint64_t siphash_nocase(const uint8_t *in, const size_t inlen, const uint8_t *k) ...@@ -202,12 +202,12 @@ uint64_t siphash_nocase(const uint8_t *in, const size_t inlen, const uint8_t *k)
} }
switch (left) { switch (left) {
case 7: b |= ((uint64_t)siptlw(in[6])) << 48; case 7: b |= ((uint64_t)siptlw(in[6])) << 48; /* fall-thru */
case 6: b |= ((uint64_t)siptlw(in[5])) << 40; case 6: b |= ((uint64_t)siptlw(in[5])) << 40; /* fall-thru */
case 5: b |= ((uint64_t)siptlw(in[4])) << 32; case 5: b |= ((uint64_t)siptlw(in[4])) << 32; /* fall-thru */
case 4: b |= ((uint64_t)siptlw(in[3])) << 24; case 4: b |= ((uint64_t)siptlw(in[3])) << 24; /* fall-thru */
case 3: b |= ((uint64_t)siptlw(in[2])) << 16; case 3: b |= ((uint64_t)siptlw(in[2])) << 16; /* fall-thru */
case 2: b |= ((uint64_t)siptlw(in[1])) << 8; case 2: b |= ((uint64_t)siptlw(in[1])) << 8; /* fall-thru */
case 1: b |= ((uint64_t)siptlw(in[0])); break; case 1: b |= ((uint64_t)siptlw(in[0])); break;
case 0: break; case 0: break;
} }
......
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