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:
        |     ^~~~
pull/80/head
Philipp Zabel 2022-10-14 15:39:28 +02:00 committed by Andri Yngvason
parent 5b2a062f0e
commit df84f371fe
1 changed files with 2 additions and 1 deletions

View File

@ -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;