aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>2021-10-31 07:48:08 +0100
committerGitHub <noreply@github.com>2021-10-31 07:48:08 +0100
commit5c4a4bfe852b9512ed576d067c3cfbbdec5642dd (patch)
treeed6b5c5ae30a8d204050720dd58e5e1938ab6e2a
parentMerge pull request #36 from themaxdavitt/themaxdavitt-patch-1 (diff)
parent-Wimplicit-fallthrough=4 compliance (diff)
downloadsiphash-5c4a4bfe852b9512ed576d067c3cfbbdec5642dd.tar.gz
siphash-5c4a4bfe852b9512ed576d067c3cfbbdec5642dd.tar.xz
Merge pull request #37 from pjanx/master
-Wimplicit-fallthrough=4 compliance
Diffstat (limited to '')
-rw-r--r--halfsiphash.c2
-rw-r--r--siphash.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/halfsiphash.c b/halfsiphash.c
index 652f3cc..5da4425 100644
--- a/halfsiphash.c
+++ b/halfsiphash.c
@@ -109,8 +109,10 @@ int halfsiphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
switch (left) {
case 3:
b |= ((uint32_t)ni[2]) << 16;
+ /* FALLTHRU */
case 2:
b |= ((uint32_t)ni[1]) << 8;
+ /* FALLTHRU */
case 1:
b |= ((uint32_t)ni[0]);
break;
diff --git a/siphash.c b/siphash.c
index f724058..003eb5b 100644
--- a/siphash.c
+++ b/siphash.c
@@ -116,16 +116,22 @@ int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
switch (left) {
case 7:
b |= ((uint64_t)ni[6]) << 48;
+ /* FALLTHRU */
case 6:
b |= ((uint64_t)ni[5]) << 40;
+ /* FALLTHRU */
case 5:
b |= ((uint64_t)ni[4]) << 32;
+ /* FALLTHRU */
case 4:
b |= ((uint64_t)ni[3]) << 24;
+ /* FALLTHRU */
case 3:
b |= ((uint64_t)ni[2]) << 16;
+ /* FALLTHRU */
case 2:
b |= ((uint64_t)ni[1]) << 8;
+ /* FALLTHRU */
case 1:
b |= ((uint64_t)ni[0]);
break;