[Bf-blender-cvs] [c850189adf6] master: Cleanup: make naming more consistent

Jacques Lucke noreply at git.blender.org
Mon Nov 22 09:48:48 CET 2021


Commit: c850189adf6dcf98dfe0140df30b6186e17fb040
Author: Jacques Lucke
Date:   Mon Nov 22 09:48:25 2021 +0100
Branches: master
https://developer.blender.org/rBc850189adf6dcf98dfe0140df30b6186e17fb040

Cleanup: make naming more consistent

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

M	source/blender/functions/FN_field_cpp_type.hh
M	source/blender/modifiers/intern/MOD_nodes_evaluator.cc

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

diff --git a/source/blender/functions/FN_field_cpp_type.hh b/source/blender/functions/FN_field_cpp_type.hh
index 5e6f1b5a585..c3636fb3c7b 100644
--- a/source/blender/functions/FN_field_cpp_type.hh
+++ b/source/blender/functions/FN_field_cpp_type.hh
@@ -30,19 +30,19 @@ template<typename T> struct FieldCPPTypeParam {
 
 class FieldCPPType : public CPPType {
  private:
-  const CPPType &field_type_;
+  const CPPType &base_type_;
 
  public:
   template<typename T>
   FieldCPPType(FieldCPPTypeParam<Field<T>> /* unused */, StringRef debug_name)
       : CPPType(CPPTypeParam<Field<T>, CPPTypeFlags::None>(), debug_name),
-        field_type_(CPPType::get<T>())
+        base_type_(CPPType::get<T>())
   {
   }
 
-  const CPPType &field_type() const
+  const CPPType &base_type() const
   {
-    return field_type_;
+    return base_type_;
   }
 
   /* Ensure that #GField and #Field<T> have the same layout, to enable casting between the two. */
diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index badd633f648..01862e4c03f 100644
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@ -1471,8 +1471,8 @@ class GeometryNodesEvaluator {
     const FieldCPPType *to_field_type = dynamic_cast<const FieldCPPType *>(&to_type);
 
     if (from_field_type != nullptr && to_field_type != nullptr) {
-      const CPPType &from_base_type = from_field_type->field_type();
-      const CPPType &to_base_type = to_field_type->field_type();
+      const CPPType &from_base_type = from_field_type->base_type();
+      const CPPType &to_base_type = to_field_type->base_type();
       if (conversions_.is_convertible(from_base_type, to_base_type)) {
         const MultiFunction &fn = *conversions_.get_conversion_multi_function(
             MFDataType::ForSingle(from_base_type), MFDataType::ForSingle(to_base_type));
@@ -1495,7 +1495,7 @@ class GeometryNodesEvaluator {
   void construct_default_value(const CPPType &type, void *r_value)
   {
     if (const FieldCPPType *field_cpp_type = dynamic_cast<const FieldCPPType *>(&type)) {
-      const CPPType &base_type = field_cpp_type->field_type();
+      const CPPType &base_type = field_cpp_type->base_type();
       auto constant_fn = std::make_unique<fn::CustomMF_GenericConstant>(
           base_type, base_type.default_value(), false);
       auto operation = std::make_shared<fn::FieldOperation>(std::move(constant_fn));



More information about the Bf-blender-cvs mailing list