Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
abbycin committed Oct 20, 2023
1 parent 3ea4bad commit 213f5c4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
33 changes: 30 additions & 3 deletions bloom/murmur3/MurmurHash3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out)
switch (len & 3) {
case 3:
k1 ^= tail[2] << 16;
[[fallthrough]];
case 2:
k1 ^= tail[1] << 8;
[[fallthrough]];
case 1:
k1 ^= tail[0];
k1 *= c1;
Expand Down Expand Up @@ -229,47 +231,59 @@ void MurmurHash3_x86_128(const void *key,
switch (len & 15) {
case 15:
k4 ^= tail[14] << 16;
[[fallthrough]];
case 14:
k4 ^= tail[13] << 8;
[[fallthrough]];
case 13:
k4 ^= tail[12] << 0;
k4 *= c4;
k4 = ROTL32(k4, 18);
k4 *= c1;
h4 ^= k4;
[[fallthrough]];

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

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

[[fallthrough]];
case 4:
k1 ^= tail[3] << 24;
[[fallthrough]];
case 3:
k1 ^= tail[2] << 16;
[[fallthrough]];
case 2:
k1 ^= tail[1] << 8;
[[fallthrough]];
case 1:
k1 ^= tail[0] << 0;
k1 *= c1;
Expand Down Expand Up @@ -366,37 +380,50 @@ void MurmurHash3_x64_128(const void *key,
switch (len & 15) {
case 15:
k2 ^= ((uint64_t)tail[14]) << 48;
[[fallthrough]];
case 14:
k2 ^= ((uint64_t)tail[13]) << 40;
[[fallthrough]];
case 13:
k2 ^= ((uint64_t)tail[12]) << 32;
[[fallthrough]];
case 12:
k2 ^= ((uint64_t)tail[11]) << 24;
[[fallthrough]];
case 11:
k2 ^= ((uint64_t)tail[10]) << 16;
[[fallthrough]];
case 10:
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;

[[fallthrough]];
case 8:
k1 ^= ((uint64_t)tail[7]) << 56;
[[fallthrough]];
case 7:
k1 ^= ((uint64_t)tail[6]) << 48;
[[fallthrough]];
case 6:
k1 ^= ((uint64_t)tail[5]) << 40;
[[fallthrough]];
case 5:
k1 ^= ((uint64_t)tail[4]) << 32;
[[fallthrough]];
case 4:
k1 ^= ((uint64_t)tail[3]) << 24;
[[fallthrough]];
case 3:
k1 ^= ((uint64_t)tail[2]) << 16;
[[fallthrough]];
case 2:
k1 ^= ((uint64_t)tail[1]) << 8;
[[fallthrough]];
case 1:
k1 ^= ((uint64_t)tail[0]) << 0;
k1 *= c1;
Expand Down
4 changes: 2 additions & 2 deletions router/radix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Router
else if(path.size() < n->path.size())
{
// doge, did
int i = common_prefix(n->path, path);
auto i = common_prefix(n->path, path);
if(i < path.size())
{
path = path.substr(i);
Expand Down Expand Up @@ -191,7 +191,7 @@ class Router

static size_t common_prefix(const std::string_view& l, const std::string_view& r)
{
int m = std::min(l.size(), r.size());
auto m = std::min(l.size(), r.size());
size_t i = 0;
for(; i < m && l[i] == r[i];)
{
Expand Down
2 changes: 1 addition & 1 deletion variant/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ class variant {
}
data_type data_;
};
Data data_;
Data data_ {};

template<typename T>
void check()
Expand Down

0 comments on commit 213f5c4

Please sign in to comment.