diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /source/blender/blenlib/intern/array_store.c | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'source/blender/blenlib/intern/array_store.c')
-rw-r--r-- | source/blender/blenlib/intern/array_store.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 9a8bda48c8d..65518427656 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -736,17 +736,17 @@ static void bchunk_list_fill_from_array(const BArrayInfo *info, BLI_INLINE uint hash_data_single(const uchar p) { - return ((HASH_INIT << 5) + HASH_INIT) + (unsigned int)(*((signed char *)&p)); + return ((HASH_INIT << 5) + HASH_INIT) + (uint)(*((signed char *)&p)); } /* hash bytes, from BLI_ghashutil_strhash_n */ static uint hash_data(const uchar *key, size_t n) { const signed char *p; - unsigned int h = HASH_INIT; + uint h = HASH_INIT; for (p = (const signed char *)key; n--; p++) { - h = ((h << 5) + h) + (unsigned int)*p; + h = (uint)((h << 5) + h) + (uint)*p; } return h; @@ -805,7 +805,7 @@ static void hash_array_from_cref(const BArrayInfo *info, static void hash_accum(hash_key *hash_array, const size_t hash_array_len, size_t iter_steps) { /* _very_ unlikely, can happen if you select a chunk-size of 1 for example. */ - if (UNLIKELY((iter_steps > hash_array_len))) { + if (UNLIKELY(iter_steps > hash_array_len)) { iter_steps = hash_array_len; } @@ -1403,7 +1403,7 @@ BArrayStore *BLI_array_store_create(uint stride, uint chunk_count) /* Triangle number, identifying now much read-ahead we need: * https://en.wikipedia.org/wiki/Triangular_number (+ 1) */ bs->info.accum_read_ahead_len = - (uint)((((bs->info.accum_steps * (bs->info.accum_steps + 1))) / 2) + 1); + (uint)(((bs->info.accum_steps * (bs->info.accum_steps + 1)) / 2) + 1); bs->info.accum_read_ahead_bytes = bs->info.accum_read_ahead_len * stride; #else bs->info.accum_read_ahead_bytes = BCHUNK_HASH_LEN * stride; |