From f16896146ac7624615050a473e470b964425c825 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Wed, 4 Jul 2018 23:29:33 +0700 Subject: [PATCH] Fix warnings that appeared in GCC7+ (related to -Wimplicit-fallthrough) --- .../siphash24/ref/shorthash_siphash24_ref.c | 6 ++++++ .../siphash24/ref/shorthash_siphashx24_ref.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c b/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c index 0c173d4c..5487745b 100644 --- a/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c +++ b/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c @@ -33,16 +33,22 @@ crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, switch (left) { case 7: b |= ((uint64_t) in[6]) << 48; + /* FALLTHRU */ case 6: b |= ((uint64_t) in[5]) << 40; + /* FALLTHRU */ case 5: b |= ((uint64_t) in[4]) << 32; + /* FALLTHRU */ case 4: b |= ((uint64_t) in[3]) << 24; + /* FALLTHRU */ case 3: b |= ((uint64_t) in[2]) << 16; + /* FALLTHRU */ case 2: b |= ((uint64_t) in[1]) << 8; + /* FALLTHRU */ case 1: b |= ((uint64_t) in[0]); break; diff --git a/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c b/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c index 20480d0d..be984eee 100644 --- a/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c +++ b/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c @@ -32,16 +32,22 @@ crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in, switch (left) { case 7: b |= ((uint64_t) in[6]) << 48; + /* FALLTHRU */ case 6: b |= ((uint64_t) in[5]) << 40; + /* FALLTHRU */ case 5: b |= ((uint64_t) in[4]) << 32; + /* FALLTHRU */ case 4: b |= ((uint64_t) in[3]) << 24; + /* FALLTHRU */ case 3: b |= ((uint64_t) in[2]) << 16; + /* FALLTHRU */ case 2: b |= ((uint64_t) in[1]) << 8; + /* FALLTHRU */ case 1: b |= ((uint64_t) in[0]); break;