aboutsummaryrefslogtreecommitdiff
path: root/stdlib/siphash.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/siphash.c')
-rw-r--r--stdlib/siphash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stdlib/siphash.c b/stdlib/siphash.c
index a8e64c8e..44e8b6eb 100644
--- a/stdlib/siphash.c
+++ b/stdlib/siphash.c
@@ -49,11 +49,13 @@ public uint64_t TOMO_HASH_KEY[2] = {23, 42}; // Randomized in tomo_init()
PUREFUNC public uint64_t siphash24(const uint8_t *src, size_t src_sz) {
siphash sh;
if ((uint64_t)src % __alignof__(uint64_t) == 0) {
+#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
const uint64_t *in = (uint64_t*)src;
/* Find largest src_sz evenly divisible by 8 bytes. */
const ptrdiff_t src_sz_nearest_8bits = ((ptrdiff_t)src_sz >> 3) << 3;
const uint64_t *goal = (uint64_t*)(src + src_sz_nearest_8bits);
+#pragma GCC diagnostic pop
siphashinit(&sh, src_sz);
src_sz -= (size_t)src_sz_nearest_8bits;
while (in < goal) {