From c6e70e7bacf82b38ca7125d6821713a711489c0b Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 25 Sep 2022 17:39:45 +0200 Subject: Cleanup: follow C++ type cast style guide in some files https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907. --- source/blender/blenlib/BLI_span.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib/BLI_span.hh') diff --git a/source/blender/blenlib/BLI_span.hh b/source/blender/blenlib/BLI_span.hh index 0f3fcea1270..adfccd8d6fe 100644 --- a/source/blender/blenlib/BLI_span.hh +++ b/source/blender/blenlib/BLI_span.hh @@ -112,13 +112,11 @@ template class Span { * Span span = {1, 2, 3, 4}; * call_function_with_array(span); */ - constexpr Span(const std::initializer_list &list) - : Span(list.begin(), static_cast(list.size())) + constexpr Span(const std::initializer_list &list) : Span(list.begin(), int64_t(list.size())) { } - constexpr Span(const std::vector &vector) - : Span(vector.data(), static_cast(vector.size())) + constexpr Span(const std::vector &vector) : Span(vector.data(), int64_t(vector.size())) { } @@ -718,7 +716,7 @@ template class MutableSpan { { BLI_assert((size_ * sizeof(T)) % sizeof(NewT) == 0); int64_t new_size = size_ * sizeof(T) / sizeof(NewT); - return MutableSpan((NewT *)data_, new_size); + return MutableSpan(reinterpret_cast(data_), new_size); } }; -- cgit v1.2.3