[Bf-blender-cvs] [b6945930e89] functions: remove unused functionality

Jacques Lucke noreply at git.blender.org
Sat Dec 14 17:58:29 CET 2019


Commit: b6945930e891feff42794fb391b11aa25cc1943f
Author: Jacques Lucke
Date:   Sat Dec 14 17:57:19 2019 +0100
Branches: functions
https://developer.blender.org/rBb6945930e891feff42794fb391b11aa25cc1943f

remove unused functionality

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

M	source/blender/functions/FN_cpp_type.h
M	source/blender/functions/FN_generic_array_ref.h
M	source/blender/functions/FN_generic_tuple.h
M	source/blender/functions/FN_generic_vector_array.h
M	source/blender/functions/FN_generic_virtual_list_list_ref.h
M	source/blender/functions/FN_generic_virtual_list_ref.h
M	source/blender/functions/intern/cpp_types.cc

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

diff --git a/source/blender/functions/FN_cpp_type.h b/source/blender/functions/FN_cpp_type.h
index bea8208975a..47c4eb8a47d 100644
--- a/source/blender/functions/FN_cpp_type.h
+++ b/source/blender/functions/FN_cpp_type.h
@@ -68,8 +68,7 @@ class CPPType {
           FillInitializedF fill_initialized,
           FillInitializedIndicesF fill_initialized_indices,
           FillUninitializedF fill_uninitialized,
-          FillUninitializedIndicesF fill_uninitialized_indices,
-          const CPPType *generalization)
+          FillUninitializedIndicesF fill_uninitialized_indices)
       : m_size(size),
         m_alignment(alignment),
         m_trivially_destructible(trivially_destructible),
@@ -95,13 +94,9 @@ class CPPType {
         m_fill_initialized_indices(fill_initialized_indices),
         m_fill_uninitialized(fill_uninitialized),
         m_fill_uninitialized_indices(fill_uninitialized_indices),
-        m_generalization(generalization),
         m_name(name)
   {
     BLI_assert(is_power_of_2_i(m_alignment));
-    BLI_assert(generalization == nullptr ||
-               (generalization->size() == size && generalization->alignment() <= alignment));
-
     m_alignment_mask = m_alignment - 1;
   }
 
@@ -121,12 +116,6 @@ class CPPType {
   {
     return m_alignment;
   }
-
-  const CPPType *generalization() const
-  {
-    return m_generalization;
-  }
-
   bool trivially_destructible() const
   {
     return m_trivially_destructible;
@@ -307,17 +296,6 @@ class CPPType {
     m_fill_uninitialized_indices(value, dst, indices);
   }
 
-  bool is_same_or_generalization(const CPPType &other) const
-  {
-    if (&other == this) {
-      return true;
-    }
-    if (m_generalization == nullptr) {
-      return false;
-    }
-    return m_generalization->is_same_or_generalization(other);
-  }
-
   friend bool operator==(const CPPType &a, const CPPType &b)
   {
     return &a == &b;
@@ -364,7 +342,6 @@ class CPPType {
   FillUninitializedF m_fill_uninitialized;
   FillUninitializedIndicesF m_fill_uninitialized_indices;
 
-  const CPPType *m_generalization;
   std::string m_name;
 };
 
diff --git a/source/blender/functions/FN_generic_array_ref.h b/source/blender/functions/FN_generic_array_ref.h
index d1732e3d258..c69cfce8507 100644
--- a/source/blender/functions/FN_generic_array_ref.h
+++ b/source/blender/functions/FN_generic_array_ref.h
@@ -51,7 +51,7 @@ class GenericArrayRef {
 
   template<typename T> ArrayRef<T> as_typed_ref() const
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(*m_type));
+    BLI_assert(CPP_TYPE<T>() == *m_type);
     return ArrayRef<T>((const T *)m_buffer, m_size);
   }
 };
@@ -155,7 +155,7 @@ class GenericMutableArrayRef {
 
   template<typename T> MutableArrayRef<T> as_typed_ref()
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(*m_type));
+    BLI_assert(CPP_TYPE<T>() == *m_type);
     return MutableArrayRef<T>((T *)m_buffer, m_size);
   }
 };
diff --git a/source/blender/functions/FN_generic_tuple.h b/source/blender/functions/FN_generic_tuple.h
index 9a8be9f1af3..eba36b3dfb7 100644
--- a/source/blender/functions/FN_generic_tuple.h
+++ b/source/blender/functions/FN_generic_tuple.h
@@ -84,7 +84,7 @@ class GenericTupleInfo : BLI::NonCopyable, BLI::NonMovable {
 
   template<typename T> bool element_has_type(uint index) const
   {
-    return CPP_TYPE<T>().is_same_or_generalization(*m_types[index]);
+    return CPP_TYPE<T>() == *m_types[index];
   }
 };
 
diff --git a/source/blender/functions/FN_generic_vector_array.h b/source/blender/functions/FN_generic_vector_array.h
index 30b6543ebe8..90daa9511bf 100644
--- a/source/blender/functions/FN_generic_vector_array.h
+++ b/source/blender/functions/FN_generic_vector_array.h
@@ -197,13 +197,13 @@ class GenericVectorArray : BLI::NonCopyable, BLI::NonMovable {
 
   template<typename T> const TypedRef<T> as_typed_ref() const
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(m_type));
+    BLI_assert(CPP_TYPE<T>() == m_type);
     return TypedRef<T>(*this);
   }
 
   template<typename T> MutableTypedRef<T> as_mutable_typed_ref()
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(m_type));
+    BLI_assert(CPP_TYPE<T>() == m_type);
     return MutableTypedRef<T>(*this);
   }
 
diff --git a/source/blender/functions/FN_generic_virtual_list_list_ref.h b/source/blender/functions/FN_generic_virtual_list_list_ref.h
index a5dd0433bf4..32e80d721e7 100644
--- a/source/blender/functions/FN_generic_virtual_list_list_ref.h
+++ b/source/blender/functions/FN_generic_virtual_list_list_ref.h
@@ -127,7 +127,7 @@ class GenericVirtualListListRef {
 
   template<typename T> VirtualListListRef<T> as_typed_ref() const
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(*m_type));
+    BLI_assert(CPP_TYPE<T>() == *m_type);
 
     switch (m_category) {
       case Category::SingleArray:
diff --git a/source/blender/functions/FN_generic_virtual_list_ref.h b/source/blender/functions/FN_generic_virtual_list_ref.h
index 56d41ac2162..41c1cdb37d4 100644
--- a/source/blender/functions/FN_generic_virtual_list_ref.h
+++ b/source/blender/functions/FN_generic_virtual_list_ref.h
@@ -188,7 +188,7 @@ class GenericVirtualListRef {
 
   template<typename T> VirtualListRef<T> as_typed_ref() const
   {
-    BLI_assert(CPP_TYPE<T>().is_same_or_generalization(*m_type));
+    BLI_assert(CPP_TYPE<T>() == *m_type);
 
     switch (m_category) {
       case Category::Single:
diff --git a/source/blender/functions/intern/cpp_types.cc b/source/blender/functions/intern/cpp_types.cc
index a35b36e3511..c6c93ef86bf 100644
--- a/source/blender/functions/intern/cpp_types.cc
+++ b/source/blender/functions/intern/cpp_types.cc
@@ -197,8 +197,7 @@ template<typename T> static std::unique_ptr<const CPPType> create_cpp_type(Strin
                                     FillInitialized_CB<T>,
                                     FillInitializedIndices_CB<T>,
                                     FillUninitialized_CB<T>,
-                                    FillUninitializedIndices_CB<T>,
-                                    nullptr);
+                                    FillUninitializedIndices_CB<T>);
   return std::unique_ptr<const CPPType>(type);
 }



More information about the Bf-blender-cvs mailing list