From 1a09024eacbdfa52b3ec669f2bdea313a06b82db Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 7 Apr 2022 17:14:47 +0200 Subject: Cleanup: Compilation warning about virtual functions Method which overrides a base class's virtual methods are expetced to be marked with `override`. This also gives better idea to the developers about what is going on. --- source/blender/blenlib/BLI_virtual_array.hh | 5 +++-- source/blender/blenlib/intern/generic_virtual_array.cc | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh index 206e0191a54..27bb04f5796 100644 --- a/source/blender/blenlib/BLI_virtual_array.hh +++ b/source/blender/blenlib/BLI_virtual_array.hh @@ -295,7 +295,7 @@ template class VArrayImpl_For_Span : public VMutableArrayImpl { return data_ == other_span.data(); } - void materialize_compressed(IndexMask mask, MutableSpan r_span) const + void materialize_compressed(IndexMask mask, MutableSpan r_span) const override { mask.to_best_mask_type([&](auto best_mask) { for (const int64_t i : IndexRange(best_mask.size())) { @@ -304,7 +304,8 @@ template class VArrayImpl_For_Span : public VMutableArrayImpl { }); } - void materialize_compressed_to_uninitialized(IndexMask mask, MutableSpan r_span) const + void materialize_compressed_to_uninitialized(IndexMask mask, + MutableSpan r_span) const override { T *dst = r_span.data(); mask.to_best_mask_type([&](auto best_mask) { diff --git a/source/blender/blenlib/intern/generic_virtual_array.cc b/source/blender/blenlib/intern/generic_virtual_array.cc index 6cdbbde671a..e1a150c3f08 100644 --- a/source/blender/blenlib/intern/generic_virtual_array.cc +++ b/source/blender/blenlib/intern/generic_virtual_array.cc @@ -279,12 +279,12 @@ class GVArrayImpl_For_SingleValueRef : public GVArrayImpl { type_->fill_construct_indices(value_, dst, mask); } - void materialize_compressed(const IndexMask mask, void *dst) const + void materialize_compressed(const IndexMask mask, void *dst) const override { type_->fill_assign_n(value_, dst, mask.size()); } - void materialize_compressed_to_uninitialized(const IndexMask mask, void *dst) const + void materialize_compressed_to_uninitialized(const IndexMask mask, void *dst) const override { type_->fill_construct_n(value_, dst, mask.size()); } -- cgit v1.2.3