diff options
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 |