diff options
author | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:24:59 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:42:21 +0300 |
commit | c50e5fcc344d00b03eb4a3141b5b45944c3570fd (patch) | |
tree | f683ae1a1f38551d160a5be2ee86561d51faca26 /source/blender/functions/FN_attributes_ref.hh | |
parent | 28b10224346a9a2e55267f98357991a841eeda5b (diff) |
Cleanup: use C++ style casts in various places
Diffstat (limited to 'source/blender/functions/FN_attributes_ref.hh')
-rw-r--r-- | source/blender/functions/FN_attributes_ref.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/functions/FN_attributes_ref.hh b/source/blender/functions/FN_attributes_ref.hh index 0cac8d82d26..a9236f73549 100644 --- a/source/blender/functions/FN_attributes_ref.hh +++ b/source/blender/functions/FN_attributes_ref.hh @@ -51,7 +51,7 @@ class AttributesInfoBuilder : NonCopyable, NonMovable { template<typename T> bool add(StringRef name, const T &default_value) { - return this->add(name, CPPType::get<T>(), (const void *)&default_value); + return this->add(name, CPPType::get<T>(), static_cast<const void *>(&default_value)); } bool add(StringRef name, const CPPType &type, const void *default_value = nullptr); @@ -107,7 +107,7 @@ class AttributesInfo : NonCopyable, NonMovable { template<typename T> const T &default_of(int index) const { BLI_assert(type_by_index_[index]->is<T>()); - return *(T *)defaults_[index]; + return *static_cast<T *>(defaults_[index]); } template<typename T> const T &default_of(StringRef name) const @@ -203,7 +203,7 @@ class MutableAttributesRef { template<typename T> MutableSpan<T> get(int index) const { BLI_assert(info_->type_of(index).is<T>()); - return MutableSpan<T>((T *)buffers_[index] + range_.start(), range_.size()); + return MutableSpan<T>(static_cast<T *>(buffers_[index]) + range_.start(), range_.size()); } template<typename T> MutableSpan<T> get(StringRef name) const @@ -294,7 +294,7 @@ class AttributesRef { template<typename T> Span<T> get(int index) const { BLI_assert(info_->type_of(index).is<T>()); - return Span<T>((T *)buffers_[index] + range_.start(), range_.size()); + return Span<T>(static_cast<T *>(buffers_[index]) + range_.start(), range_.size()); } template<typename T> Span<T> get(StringRef name) const |