From c50e5fcc344d00b03eb4a3141b5b45944c3570fd Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 7 Aug 2020 18:24:59 +0200 Subject: Cleanup: use C++ style casts in various places --- source/blender/blenlib/BLI_vector_set.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib/BLI_vector_set.hh') diff --git a/source/blender/blenlib/BLI_vector_set.hh b/source/blender/blenlib/BLI_vector_set.hh index c3b15bcf454..9d7c61f9e3b 100644 --- a/source/blender/blenlib/BLI_vector_set.hh +++ b/source/blender/blenlib/BLI_vector_set.hh @@ -457,7 +457,7 @@ class VectorSet { */ int64_t size_in_bytes() const { - return (int64_t)(sizeof(Slot) * slots_.size() + sizeof(Key) * usable_slots_); + return static_cast(sizeof(Slot) * slots_.size() + sizeof(Key) * usable_slots_); } /** @@ -486,7 +486,7 @@ class VectorSet { max_load_factor_.compute_total_and_usable_slots( SlotArray::inline_buffer_capacity(), min_usable_slots, &total_slots, &usable_slots); BLI_assert(total_slots >= 1); - const uint64_t new_slot_mask = (uint64_t)total_slots - 1; + const uint64_t new_slot_mask = static_cast(total_slots) - 1; /* Optimize the case when the set was empty beforehand. We can avoid some copies here. */ if (this->size() == 0) { @@ -722,7 +722,8 @@ class VectorSet { Key *allocate_keys_array(const int64_t size) { - return (Key *)slots_.allocator().allocate(sizeof(Key) * (size_t)size, alignof(Key), AT); + return static_cast( + slots_.allocator().allocate(sizeof(Key) * static_cast(size), alignof(Key), AT)); } void deallocate_keys_array(Key *keys) -- cgit v1.2.3