Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-08-07 19:24:59 +0300
committerJacques Lucke <jacques@blender.org>2020-08-07 19:42:21 +0300
commitc50e5fcc344d00b03eb4a3141b5b45944c3570fd (patch)
treef683ae1a1f38551d160a5be2ee86561d51faca26 /source/blender/blenlib/BLI_map.hh
parent28b10224346a9a2e55267f98357991a841eeda5b (diff)
Cleanup: use C++ style casts in various places
Diffstat (limited to 'source/blender/blenlib/BLI_map.hh')
-rw-r--r--source/blender/blenlib/BLI_map.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_map.hh b/source/blender/blenlib/BLI_map.hh
index f90d59f45a5..229bbfad0e4 100644
--- a/source/blender/blenlib/BLI_map.hh
+++ b/source/blender/blenlib/BLI_map.hh
@@ -824,7 +824,7 @@ class Map {
*/
int64_t size_in_bytes() const
{
- return (int64_t)(sizeof(Slot) * slots_.size());
+ return static_cast<int64_t>(sizeof(Slot) * slots_.size());
}
/**
@@ -863,7 +863,7 @@ class Map {
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<uint64_t>(total_slots) - 1;
/**
* Optimize the case when the map was empty beforehand. We can avoid some copies here.
@@ -1107,7 +1107,7 @@ class Map {
bool add_overwrite__impl(ForwardKey &&key, ForwardValue &&value, uint64_t hash)
{
auto create_func = [&](Value *ptr) {
- new ((void *)ptr) Value(std::forward<ForwardValue>(value));
+ new (static_cast<void *>(ptr)) Value(std::forward<ForwardValue>(value));
return true;
};
auto modify_func = [&](Value *ptr) {
@@ -1185,7 +1185,7 @@ template<typename Key, typename Value> class StdUnorderedMapWrapper {
public:
int64_t size() const
{
- return (int64_t)map_.size();
+ return static_cast<int64_t>(map_.size());
}
bool is_empty() const