diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-11 00:15:32 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-12 21:23:18 +0300 |
| commit | 7d67b9ff28d09de58c632f80ef7d330e45e698f6 (patch) | |
| tree | 16c8afc9dc80d70951f83d2f1182ace0edc7ee49 /lib/jhash.c | |
| parent | 9bc4d9eaec92589deda092bd867054e25e64be3f (diff) | |
build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/jhash.c')
| -rw-r--r-- | lib/jhash.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/jhash.c b/lib/jhash.c index 0d561ef3a4..4e02112e09 100644 --- a/lib/jhash.c +++ b/lib/jhash.c @@ -86,34 +86,34 @@ uint32_t jhash(const void *key, uint32_t length, uint32_t initval) switch (len) { case 11: c += ((uint32_t)k[10] << 24); - /* fallthru */ + fallthrough; case 10: c += ((uint32_t)k[9] << 16); - /* fallthru */ + fallthrough; case 9: c += ((uint32_t)k[8] << 8); - /* fallthru */ + fallthrough; case 8: b += ((uint32_t)k[7] << 24); - /* fallthru */ + fallthrough; case 7: b += ((uint32_t)k[6] << 16); - /* fallthru */ + fallthrough; case 6: b += ((uint32_t)k[5] << 8); - /* fallthru */ + fallthrough; case 5: b += k[4]; - /* fallthru */ + fallthrough; case 4: a += ((uint32_t)k[3] << 24); - /* fallthru */ + fallthrough; case 3: a += ((uint32_t)k[2] << 16); - /* fallthru */ + fallthrough; case 2: a += ((uint32_t)k[1] << 8); - /* fallthru */ + fallthrough; case 1: a += k[0]; } @@ -148,7 +148,7 @@ uint32_t jhash2(const uint32_t *k, uint32_t length, uint32_t initval) switch (len) { case 2: b += k[1]; - /* fallthru */ + fallthrough; case 1: a += k[0]; } |
