[Bf-blender-cvs] [28d1c86b490] temp-T96710-pbvh-pixels: Cleanup: Compilation warning about virtual functions

Sergey Sharybin noreply at git.blender.org
Fri Apr 8 11:07:48 CEST 2022


Commit: 28d1c86b490d64a04e61882a462252b9547e13dc
Author: Sergey Sharybin
Date:   Thu Apr 7 17:14:47 2022 +0200
Branches: temp-T96710-pbvh-pixels
https://developer.blender.org/rB28d1c86b490d64a04e61882a462252b9547e13dc

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.

===================================================================

M	source/blender/blenlib/BLI_virtual_array.hh
M	source/blender/blenlib/intern/generic_virtual_array.cc

===================================================================

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<typename T> class VArrayImpl_For_Span : public VMutableArrayImpl<T> {
     return data_ == other_span.data();
   }
 
-  void materialize_compressed(IndexMask mask, MutableSpan<T> r_span) const
+  void materialize_compressed(IndexMask mask, MutableSpan<T> 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<typename T> class VArrayImpl_For_Span : public VMutableArrayImpl<T> {
     });
   }
 
-  void materialize_compressed_to_uninitialized(IndexMask mask, MutableSpan<T> r_span) const
+  void materialize_compressed_to_uninitialized(IndexMask mask,
+                                               MutableSpan<T> 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());
   }



More information about the Bf-blender-cvs mailing list