From df84f371fef11a705eccc1264b5c9ef154625f05 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Fri, 14 Oct 2022 15:39:28 +0200 Subject: [PATCH] Fix fallthrough warnings in murmurhash Fix two -Wimplicit-fallthrough warnings in the murmurhash function: ../src/murmurhash.c: In function 'murmurhash': ../src/murmurhash.c:71:15: warning: this statement may fall through [-Wimplicit-fallthrough=] 71 | case 3: k ^= (tail[2] << 16); | ~~^~~~~~~~~~~~~~~~~~ ../src/murmurhash.c:72:5: note: here 72 | case 2: k ^= (tail[1] << 8); | ^~~~ ../src/murmurhash.c:72:15: warning: this statement may fall through [-Wimplicit-fallthrough=] 72 | case 2: k ^= (tail[1] << 8); | ~~^~~~~~~~~~~~~~~~~ ../src/murmurhash.c:74:5: note: here 74 | case 1: | ^~~~ --- src/murmurhash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/murmurhash.c b/src/murmurhash.c index 2edbf0e..c3eb8c3 100644 --- a/src/murmurhash.c +++ b/src/murmurhash.c @@ -69,8 +69,9 @@ murmurhash (const char *key, uint32_t len, uint32_t seed) { // remainder switch (len & 3) { // `len % 4' case 3: k ^= (tail[2] << 16); + // fallthrough case 2: k ^= (tail[1] << 8); - + // fallthrough case 1: k ^= tail[0]; k *= c1;