Skip to content

Commit

Permalink
make burtlemix an (inline) function
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Jun 1, 2022
1 parent b2c3da4 commit 86c49d2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
60 changes: 30 additions & 30 deletions pdns/burtle.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@

#include <cinttypes>

#define burtlemix(a, b, c) \
{ \
a -= b; \
a -= c; \
a ^= (c >> 13); \
b -= c; \
b -= a; \
b ^= (a << 8); \
c -= a; \
c -= b; \
c ^= (b >> 13); \
a -= b; \
a -= c; \
a ^= (c >> 12); \
b -= c; \
b -= a; \
b ^= (a << 16); \
c -= a; \
c -= b; \
c ^= (b >> 5); \
a -= b; \
a -= c; \
a ^= (c >> 3); \
b -= c; \
b -= a; \
b ^= (a << 10); \
c -= a; \
c -= b; \
c ^= (b >> 15); \
}
inline void burtlemix(uint32_t& a, uint32_t& b, uint32_t& c)
{
a -= b;
a -= c;
a ^= (c >> 13);
b -= c;
b -= a;
b ^= (a << 8);
c -= a;
c -= b;
c ^= (b >> 13);
a -= b;
a -= c;
a ^= (c >> 12);
b -= c;
b -= a;
b ^= (a << 16);
c -= a;
c -= b;
c ^= (b >> 5);
a -= b;
a -= c;
a ^= (c >> 3);
b -= c;
b -= a;
b ^= (a << 10);
c -= a;
c -= b;
c ^= (b >> 15);
}

inline uint32_t burtle(const unsigned char* k, uint32_t length, uint32_t initval)
{
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ dnsdist-lua-ffi.$(OBJEXT): dnsdist-lua-ffi-interface.inc

dnsdist_SOURCES = \
base64.hh \
burtle.hh \
bpf-filter.cc bpf-filter.hh \
burtle.hh \
cachecleaner.hh \
capabilities.cc capabilities.hh \
circular_buffer.hh \
Expand Down

0 comments on commit 86c49d2

Please sign in to comment.