aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/siphash.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-23 19:28:08 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-23 19:28:08 -0400
commitfcda36561d668f43bac91ea31cd55cbbd605d330 (patch)
treeeb74c0b17df584af0fd8154422ad924e04c96cc2 /src/stdlib/siphash.c
parent414b0c7472c87c5a013029aefef49e2dbc41e700 (diff)
Autoformat everything with clang-format
Diffstat (limited to 'src/stdlib/siphash.c')
-rw-r--r--src/stdlib/siphash.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/stdlib/siphash.c b/src/stdlib/siphash.c
index 274b3195..9af845e7 100644
--- a/src/stdlib/siphash.c
+++ b/src/stdlib/siphash.c
@@ -5,7 +5,8 @@
#include "siphash.h"
#include "util.h"
-public uint64_t TOMO_HASH_KEY[2] = {23, 42}; // Randomized in tomo_init()
+public
+uint64_t TOMO_HASH_KEY[2] = {23, 42}; // Randomized in tomo_init()
/* <MIT License>
Copyright (c) 2013 Marek Majkowski <marek@popcount.org>
@@ -53,10 +54,10 @@ PUREFUNC public uint64_t siphash24(const uint8_t *src, size_t src_sz) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
#endif
- const uint64_t *in = (uint64_t*)src;
+ 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);
+ const uint64_t *goal = (uint64_t *)(src + src_sz_nearest_8bits);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
@@ -74,7 +75,8 @@ PUREFUNC public uint64_t siphash24(const uint8_t *src, size_t src_sz) {
uint64_t in_64;
memcpy(&in_64, in, sizeof(uint64_t));
siphashadd64bits(&sh, in_64);
- in += 8; src_sz -= 8;
+ in += 8;
+ src_sz -= 8;
}
return siphashfinish(&sh, (uint8_t *)in, src_sz);
}