From bac14fa6c79b6abea50fd5f188799ae8e83cb20d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 5 Sep 2024 16:23:05 -0400 Subject: Fully clean up siphash code and fix some issues --- builtins/array.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'builtins/array.c') diff --git a/builtins/array.c b/builtins/array.c index 174bcbdd..f09af917 100644 --- a/builtins/array.c +++ b/builtins/array.c @@ -18,7 +18,9 @@ #include "types.h" #include "util.h" -#include "siphash.c" +// Use inline version of siphash code: +#include "siphash.h" +#include "siphash-internals.h" static inline int64_t get_padded_item_size(const TypeInfo *info) { @@ -555,7 +557,7 @@ public uint64_t Array$hash(const Array_t *arr, const TypeInfo *type) { const TypeInfo *item = type->ArrayInfo.item; siphash sh; - siphashinit(&sh, sizeof(uint64_t[arr->length]), (uint64_t*)TOMO_HASH_KEY); + siphashinit(&sh, sizeof(uint64_t[arr->length])); if (item->tag == PointerInfo || (item->tag == CustomInfo && item->CustomInfo.hash == NULL && item->size == sizeof(void*))) { // Raw data hash for (int64_t i = 0; i < arr->length; i++) siphashadd64bits(&sh, (uint64_t)(arr->data + i*arr->stride)); -- cgit v1.2.3