Fix warnings that appeared in GCC7+ (related to -Wimplicit-fallthrough)

This commit is contained in:
Anton Maklakov 2018-07-04 23:29:33 +07:00
parent bc7eb925bb
commit f16896146a
2 changed files with 12 additions and 0 deletions

View File

@ -33,16 +33,22 @@ crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in,
switch (left) { switch (left) {
case 7: case 7:
b |= ((uint64_t) in[6]) << 48; b |= ((uint64_t) in[6]) << 48;
/* FALLTHRU */
case 6: case 6:
b |= ((uint64_t) in[5]) << 40; b |= ((uint64_t) in[5]) << 40;
/* FALLTHRU */
case 5: case 5:
b |= ((uint64_t) in[4]) << 32; b |= ((uint64_t) in[4]) << 32;
/* FALLTHRU */
case 4: case 4:
b |= ((uint64_t) in[3]) << 24; b |= ((uint64_t) in[3]) << 24;
/* FALLTHRU */
case 3: case 3:
b |= ((uint64_t) in[2]) << 16; b |= ((uint64_t) in[2]) << 16;
/* FALLTHRU */
case 2: case 2:
b |= ((uint64_t) in[1]) << 8; b |= ((uint64_t) in[1]) << 8;
/* FALLTHRU */
case 1: case 1:
b |= ((uint64_t) in[0]); b |= ((uint64_t) in[0]);
break; break;

View File

@ -32,16 +32,22 @@ crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in,
switch (left) { switch (left) {
case 7: case 7:
b |= ((uint64_t) in[6]) << 48; b |= ((uint64_t) in[6]) << 48;
/* FALLTHRU */
case 6: case 6:
b |= ((uint64_t) in[5]) << 40; b |= ((uint64_t) in[5]) << 40;
/* FALLTHRU */
case 5: case 5:
b |= ((uint64_t) in[4]) << 32; b |= ((uint64_t) in[4]) << 32;
/* FALLTHRU */
case 4: case 4:
b |= ((uint64_t) in[3]) << 24; b |= ((uint64_t) in[3]) << 24;
/* FALLTHRU */
case 3: case 3:
b |= ((uint64_t) in[2]) << 16; b |= ((uint64_t) in[2]) << 16;
/* FALLTHRU */
case 2: case 2:
b |= ((uint64_t) in[1]) << 8; b |= ((uint64_t) in[1]) << 8;
/* FALLTHRU */
case 1: case 1:
b |= ((uint64_t) in[0]); b |= ((uint64_t) in[0]);
break; break;