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_span.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 5aee0028846..165814cf23c 100644 --- a/source/blender/blenlib/BLI_span.hh +++ b/source/blender/blenlib/BLI_span.hh @@ -101,7 +101,7 @@ template class Span { } template> * = nullptr> - Span(const U *start, int64_t size) : data_((const T *)start), size_(size) + Span(const U *start, int64_t size) : data_(static_cast(start)), size_(size) { BLI_assert(size >= 0); } @@ -117,11 +117,12 @@ template class Span { * Span span = {1, 2, 3, 4}; * call_function_with_array(span); */ - Span(const std::initializer_list &list) : Span(list.begin(), (int64_t)list.size()) + Span(const std::initializer_list &list) + : Span(list.begin(), static_cast(list.size())) { } - Span(const std::vector &vector) : Span(vector.data(), (int64_t)vector.size()) + Span(const std::vector &vector) : Span(vector.data(), static_cast(vector.size())) { } @@ -132,10 +133,9 @@ template class Span { /** * Support implicit conversions like the ones below: * Span -> Span - * Span -> Span */ template> * = nullptr> - Span(Span array) : data_((T *)array.data()), size_(array.size()) + Span(Span array) : data_(static_cast(array.data())), size_(array.size()) { } @@ -373,7 +373,7 @@ template class Span { { const int64_t index = this->first_index_try(search_value); BLI_assert(index >= 0); - return (int64_t)index; + return index; } /** -- cgit v1.2.3