Skip to content

Commit

Permalink
fix fallthrough warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hegner authored and tmadlener committed May 25, 2023
1 parent 84e8217 commit 191999a
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/MurmurHash3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ void MurmurHash3_x86_32(const void* key, int len, uint32_t seed, void* out) {

switch (len & 3) {
case 3:
k1 ^= tail[2] << 16;
k1 ^= tail[2] << 16; [[fallthrough]];
case 2:
k1 ^= tail[1] << 8;
k1 ^= tail[1] << 8; [[fallthrough]];
case 1:
k1 ^= tail[0];
k1 *= c1;
Expand Down Expand Up @@ -217,48 +217,48 @@ void MurmurHash3_x86_128(const void* key, const int len, uint32_t seed, void* ou

switch (len & 15) {
case 15:
k4 ^= tail[14] << 16;
k4 ^= tail[14] << 16; [[fallthrough]];
case 14:
k4 ^= tail[13] << 8;
k4 ^= tail[13] << 8; [[fallthrough]];
case 13:
k4 ^= tail[12] << 0;
k4 *= c4;
k4 = ROTL32(k4, 18);
k4 *= c1;
h4 ^= k4;
h4 ^= k4; [[fallthrough]];

case 12:
k3 ^= tail[11] << 24;
k3 ^= tail[11] << 24; [[fallthrough]];
case 11:
k3 ^= tail[10] << 16;
k3 ^= tail[10] << 16; [[fallthrough]];
case 10:
k3 ^= tail[9] << 8;
k3 ^= tail[9] << 8; [[fallthrough]];
case 9:
k3 ^= tail[8] << 0;
k3 *= c3;
k3 = ROTL32(k3, 17);
k3 *= c4;
h3 ^= k3;
h3 ^= k3; [[fallthrough]];

case 8:
k2 ^= tail[7] << 24;
k2 ^= tail[7] << 24; [[fallthrough]];
case 7:
k2 ^= tail[6] << 16;
k2 ^= tail[6] << 16; [[fallthrough]];
case 6:
k2 ^= tail[5] << 8;
k2 ^= tail[5] << 8; [[fallthrough]];
case 5:
k2 ^= tail[4] << 0;
k2 *= c2;
k2 = ROTL32(k2, 16);
k2 *= c3;
h2 ^= k2;
h2 ^= k2; [[fallthrough]];

case 4:
k1 ^= tail[3] << 24;
k1 ^= tail[3] << 24; [[fallthrough]];
case 3:
k1 ^= tail[2] << 16;
k1 ^= tail[2] << 16; [[fallthrough]];
case 2:
k1 ^= tail[1] << 8;
k1 ^= tail[1] << 8; [[fallthrough]];
case 1:
k1 ^= tail[0] << 0;
k1 *= c1;
Expand Down Expand Up @@ -350,38 +350,38 @@ void MurmurHash3_x64_128(const void* key, const int len, const uint32_t seed, vo

switch (len & 15) {
case 15:
k2 ^= ((uint64_t)tail[14]) << 48;
k2 ^= ((uint64_t)tail[14]) << 48; [[fallthrough]];
case 14:
k2 ^= ((uint64_t)tail[13]) << 40;
k2 ^= ((uint64_t)tail[13]) << 40; [[fallthrough]];
case 13:
k2 ^= ((uint64_t)tail[12]) << 32;
k2 ^= ((uint64_t)tail[12]) << 32; [[fallthrough]];
case 12:
k2 ^= ((uint64_t)tail[11]) << 24;
k2 ^= ((uint64_t)tail[11]) << 24; [[fallthrough]];
case 11:
k2 ^= ((uint64_t)tail[10]) << 16;
k2 ^= ((uint64_t)tail[10]) << 16; [[fallthrough]];
case 10:
k2 ^= ((uint64_t)tail[9]) << 8;
k2 ^= ((uint64_t)tail[9]) << 8; [[fallthrough]];
case 9:
k2 ^= ((uint64_t)tail[8]) << 0;
k2 *= c2;
k2 = ROTL64(k2, 33);
k2 *= c1;
h2 ^= k2;
h2 ^= k2; [[fallthrough]];

case 8:
k1 ^= ((uint64_t)tail[7]) << 56;
k1 ^= ((uint64_t)tail[7]) << 56; [[fallthrough]];
case 7:
k1 ^= ((uint64_t)tail[6]) << 48;
k1 ^= ((uint64_t)tail[6]) << 48; [[fallthrough]];
case 6:
k1 ^= ((uint64_t)tail[5]) << 40;
k1 ^= ((uint64_t)tail[5]) << 40; [[fallthrough]];
case 5:
k1 ^= ((uint64_t)tail[4]) << 32;
k1 ^= ((uint64_t)tail[4]) << 32; [[fallthrough]];
case 4:
k1 ^= ((uint64_t)tail[3]) << 24;
k1 ^= ((uint64_t)tail[3]) << 24; [[fallthrough]];
case 3:
k1 ^= ((uint64_t)tail[2]) << 16;
k1 ^= ((uint64_t)tail[2]) << 16; [[fallthrough]];
case 2:
k1 ^= ((uint64_t)tail[1]) << 8;
k1 ^= ((uint64_t)tail[1]) << 8; [[fallthrough]];
case 1:
k1 ^= ((uint64_t)tail[0]) << 0;
k1 *= c1;
Expand Down

0 comments on commit 191999a

Please sign in to comment.