From d5f8e1699d72311b4f7e9fc8f696c7d73236c32f Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Sat, 13 Nov 2021 17:36:37 +0100 Subject: [PATCH] BUILD: Fix some warnings in the STB DS header --- inc/lektor/stb/ds.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/lektor/stb/ds.h b/inc/lektor/stb/ds.h index 2a0c631e..d26097e0 100644 --- a/inc/lektor/stb/ds.h +++ b/inc/lektor/stb/ds.h @@ -795,7 +795,7 @@ stbds_arrgrowf(void *a, size_t elemsize, size_t addlen, size_t min_cap) { stbds_array_header temp = { 0 }; // force debugging void *b; - size_t min_len = stbds_arrlen(a) + addlen; + size_t min_len = ((size_t)stbds_arrlen(a)) + addlen; (void)sizeof(temp); // compute the minimum capacity needed @@ -921,13 +921,13 @@ stbds_log2(size_t slot_count) static stbds_hash_index * stbds_make_hash_index(size_t slot_count, stbds_hash_index *ot) { - stbds_hash_index *t; - t = (stbds_hash_index *)STBDS_REALLOC(NULL, 0, - (slot_count >> STBDS_BUCKET_SHIFT) * - sizeof(stbds_hash_bucket) + - sizeof(stbds_hash_index) + STBDS_CACHE_LINE_SIZE - 1); - t->storage = (stbds_hash_bucket *)STBDS_ALIGN_FWD((size_t)(t + 1), STBDS_CACHE_LINE_SIZE); - t->slot_count = slot_count; + stbds_hash_index *t = (stbds_hash_index *)STBDS_REALLOC( + NULL, 0, + (slot_count >> STBDS_BUCKET_SHIFT) * sizeof(stbds_hash_bucket) + sizeof(stbds_hash_index) + + (size_t)(STBDS_CACHE_LINE_SIZE - 1)); + t->storage = + (stbds_hash_bucket *)STBDS_ALIGN_FWD((size_t)(t + 1), (size_t)STBDS_CACHE_LINE_SIZE); + t->slot_count = slot_count; t->slot_count_log2 = stbds_log2(slot_count); t->tombstone_count = 0; t->used_count = 0; -- GitLab