From 86c49d2bec75f8aac83c1d9f768e0a4ca1fce8d7 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 6 May 2022 19:54:08 +0200 Subject: [PATCH] make burtlemix an (inline) function --- pdns/burtle.hh | 60 ++++++++++++++++++------------------ pdns/dnsdistdist/Makefile.am | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pdns/burtle.hh b/pdns/burtle.hh index 4d56936b3ae8..53f8b8d017b1 100644 --- a/pdns/burtle.hh +++ b/pdns/burtle.hh @@ -24,36 +24,36 @@ #include -#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) { diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index 99abefede61d..f1722e290448 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -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 \