]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Update fxhash constants
authorOndřej Surý <ondrej@isc.org>
Tue, 26 Aug 2025 05:56:03 +0000 (07:56 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 26 Aug 2025 07:45:58 +0000 (09:45 +0200)
The fxhash implementation was missing a constant for 32-bit platforms.
This has been fixed.  Constant for 64-bit platform was update to match
the current Rust constants.

lib/isc/include/isc/fxhash.h

index ac19d0ac4e27393350fc2480b536b31508bd067a..55a4f31e3ba3f76759922e1bad94bcf31c472b91 100644 (file)
 #include <isc/bit.h>
 
 /* The constant K from Rust's fxhash */
-#define K 0x9e3779b97f4a7c15ull
+#if SIZE_MAX == UINT64_MAX
+#define K UINT64_C(0x517cc1b727220a95)
+#else
+#define K UINT32_C(0x9e3779b9)
+#endif
 
 static inline size_t
 fx_add_to_hash(size_t hash, size_t i) {