Skip to content

Commit

Permalink
Limit the scope of the FNV1a seed externs
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed May 18, 2024
1 parent 5925c3f commit 8455a52
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ bool hash_iter_next(struct hash_iter *iter,
const void **key,
const void **value);

extern uint64_t fnv1a_64_seed;
extern uint32_t fnv1a_32_seed;

static inline uint64_t fnv1a_64(const void *buffer, size_t len)
{
const unsigned char *data = (unsigned char *)buffer;
extern uint64_t fnv1a_64_seed;
uint64_t hash;

for (hash = fnv1a_64_seed; len--; data++) {
Expand All @@ -50,6 +48,7 @@ static inline uint64_t fnv1a_64(const void *buffer, size_t len)
static inline uint32_t fnv1a_32(const void *buffer, size_t len)
{
const unsigned char *data = (unsigned char *)buffer;
extern uint32_t fnv1a_32_seed;
uint32_t hash;

for (hash = fnv1a_32_seed; len--; data++) {
Expand Down

0 comments on commit 8455a52

Please sign in to comment.