diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 16:23:05 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-05 16:23:05 -0400 |
| commit | bac14fa6c79b6abea50fd5f188799ae8e83cb20d (patch) | |
| tree | 416a7b9ff39075ab33fb93ab4e86003df4d25aca /builtins/array.c | |
| parent | 47e8972427c152891c4c6c4b458f78cd7ceb8aee (diff) | |
Fully clean up siphash code and fix some issues
Diffstat (limited to 'builtins/array.c')
| -rw-r--r-- | builtins/array.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)); |
