[Bf-blender-cvs] [98395e0bdfc] master: Cleanup: Use r_ prefix for boolean return parameters

Hans Goudey noreply at git.blender.org
Fri Jul 22 17:49:52 CEST 2022


Commit: 98395e0bdfc849e2d2770052c6e8651a42500608
Author: Hans Goudey
Date:   Fri Jul 22 10:49:09 2022 -0500
Branches: master
https://developer.blender.org/rB98395e0bdfc849e2d2770052c6e8651a42500608

Cleanup: Use r_ prefix for boolean return parameters

Also rearrange some lines to simplify logic.

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

M	source/blender/io/alembic/intern/abc_reader_object.cc
M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc

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

diff --git a/source/blender/io/alembic/intern/abc_reader_object.cc b/source/blender/io/alembic/intern/abc_reader_object.cc
index a698eeca8f1..db056c0eef6 100644
--- a/source/blender/io/alembic/intern/abc_reader_object.cc
+++ b/source/blender/io/alembic/intern/abc_reader_object.cc
@@ -218,12 +218,12 @@ Alembic::AbcGeom::IXform AbcObjectReader::xform()
 void AbcObjectReader::read_matrix(float r_mat[4][4] /* local matrix */,
                                   const chrono_t time,
                                   const float scale,
-                                  bool &is_constant)
+                                  bool &r_is_constant)
 {
   IXform ixform = xform();
   if (!ixform) {
     unit_m4(r_mat);
-    is_constant = true;
+    r_is_constant = true;
     return;
   }
 
@@ -254,7 +254,7 @@ void AbcObjectReader::read_matrix(float r_mat[4][4] /* local matrix */,
     mul_m4_m4m4(r_mat, scale_mat, r_mat);
   }
 
-  is_constant = schema.isConstant();
+  r_is_constant = schema.isConstant();
 }
 
 void AbcObjectReader::addCacheModifier()
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 01e4d5ff6b3..223e4b757b7 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -200,7 +200,7 @@ static bool node_needs_own_transform_relation(const bNode &node)
 
 static void process_nodes_for_depsgraph(const bNodeTree &tree,
                                         Set<ID *> &ids,
-                                        bool &needs_own_transform_relation)
+                                        bool &r_needs_own_transform_relation)
 {
   Set<const bNodeTree *> handled_groups;
 
@@ -211,10 +211,10 @@ static void process_nodes_for_depsgraph(const bNodeTree &tree,
     if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
       const bNodeTree *group = (bNodeTree *)node->id;
       if (group != nullptr && handled_groups.add(group)) {
-        process_nodes_for_depsgraph(*group, ids, needs_own_transform_relation);
+        process_nodes_for_depsgraph(*group, ids, r_needs_own_transform_relation);
       }
     }
-    needs_own_transform_relation |= node_needs_own_transform_relation(*node);
+    r_needs_own_transform_relation |= node_needs_own_transform_relation(*node);
   }
 }
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
index 2a784430683..dbd68f4c783 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc
@@ -90,13 +90,13 @@ static void try_capture_field_on_geometry(GeometryComponent &component,
                                           const StringRef name,
                                           const eAttrDomain domain,
                                           const GField &field,
-                                          std::atomic<bool> &failure)
+                                          std::atomic<bool> &r_failure)
 {
-  const int domain_size = component.attribute_domain_size(domain);
+  MutableAttributeAccessor attributes = *component.attributes_for_write();
+  const int domain_size = attributes.domain_size(domain);
   if (domain_size == 0) {
     return;
   }
-  MutableAttributeAccessor attributes = *component.attributes_for_write();
 
   GeometryComponentFieldContext field_context{component, domain};
   const IndexMask mask{IndexMask(domain_size)};
@@ -133,7 +133,7 @@ static void try_capture_field_on_geometry(GeometryComponent &component,
    * it's required, and adding the attribute might fail if the domain or type is incorrect. */
   type.destruct_n(buffer, domain_size);
   MEM_freeN(buffer);
-  failure = true;
+  r_failure = true;
 }
 
 static void node_geo_exec(GeoNodeExecParams params)



More information about the Bf-blender-cvs mailing list