[Bf-blender-cvs] [c1a1644db7b] master: Cleanup: Attempt to fix benign macOS compile warnings

Hans Goudey noreply at git.blender.org
Tue Oct 12 16:13:29 CEST 2021


Commit: c1a1644db7b13425675819eeea9ef96bab4f5c97
Author: Hans Goudey
Date:   Tue Oct 12 09:13:21 2021 -0500
Branches: master
https://developer.blender.org/rBc1a1644db7b13425675819eeea9ef96bab4f5c97

Cleanup: Attempt to fix benign macOS compile warnings

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

M	source/blender/modifiers/intern/MOD_nodes_evaluator.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_curve_endpoints.cc
M	source/blender/nodes/geometry/nodes/legacy/node_geo_curve_to_points.cc
M	source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
M	source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
M	source/blender/nodes/geometry/nodes/node_geo_proximity.cc
M	source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
M	source/blender/nodes/intern/node_common.cc

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

diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
index 8209d46ec24..a85fc29430f 100644
--- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
+++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc
@@ -1108,7 +1108,7 @@ class GeometryNodesEvaluator {
       return;
     }
     bool will_be_triggered_by_other_node = false;
-    for (const DSocket origin_socket : origin_sockets) {
+    for (const DSocket &origin_socket : origin_sockets) {
       if (origin_socket->is_input()) {
         /* Load the value directly from the origin socket. In most cases this is an unlinked
          * group input. */
diff --git a/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_endpoints.cc b/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_endpoints.cc
index 65d22eca39c..b226cc2d3be 100644
--- a/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_endpoints.cc
+++ b/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_endpoints.cc
@@ -124,7 +124,7 @@ static void copy_endpoint_attributes(Span<SplinePtr> splines,
       end_data.tilts[i] = spline.tilts().last();
 
       /* Copy the point attribute data over. */
-      for (const auto &item : start_data.point_attributes.items()) {
+      for (const auto item : start_data.point_attributes.items()) {
         const AttributeIDRef attribute_id = item.key;
         GMutableSpan point_span = item.value;
 
@@ -133,7 +133,7 @@ static void copy_endpoint_attributes(Span<SplinePtr> splines,
         blender::fn::GVArray_For_GSpan(spline_span).get(0, point_span[i]);
       }
 
-      for (const auto &item : end_data.point_attributes.items()) {
+      for (const auto item : end_data.point_attributes.items()) {
         const AttributeIDRef attribute_id = item.key;
         GMutableSpan point_span = item.value;
 
diff --git a/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_to_points.cc
index 0c435d69991..b6409290f31 100644
--- a/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_to_points.cc
+++ b/source/blender/nodes/geometry/nodes/legacy/node_geo_curve_to_points.cc
@@ -180,7 +180,7 @@ static void copy_evaluated_point_attributes(Span<SplinePtr> splines,
       spline.interpolate_to_evaluated(spline.radii())->materialize(data.radii.slice(offset, size));
       spline.interpolate_to_evaluated(spline.tilts())->materialize(data.tilts.slice(offset, size));
 
-      for (const Map<AttributeIDRef, GMutableSpan>::Item &item : data.point_attributes.items()) {
+      for (const Map<AttributeIDRef, GMutableSpan>::Item item : data.point_attributes.items()) {
         const AttributeIDRef attribute_id = item.key;
         GMutableSpan point_span = item.value;
 
@@ -223,7 +223,7 @@ static void copy_uniform_sample_point_attributes(Span<SplinePtr> splines,
                                               uniform_samples,
                                               data.tilts.slice(offset, size));
 
-      for (const Map<AttributeIDRef, GMutableSpan>::Item &item : data.point_attributes.items()) {
+      for (const Map<AttributeIDRef, GMutableSpan>::Item item : data.point_attributes.items()) {
         const AttributeIDRef attribute_id = item.key;
         GMutableSpan point_span = item.value;
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
index fc9cba73b01..33f8c53e343 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc
@@ -923,10 +923,10 @@ static void do_mesh_separation(GeometrySet &geometry_set,
   switch (mode) {
     case GEO_NODE_DELETE_GEOMETRY_MODE_ALL: {
       Array<int> vertex_map(mesh_in.totvert);
-      int num_selected_vertices;
+      int num_selected_vertices = 0;
 
       Array<int> edge_map(mesh_in.totedge);
-      int num_selected_edges;
+      int num_selected_edges = 0;
 
       /* Fill all the maps based on the selection. */
       switch (domain) {
@@ -990,7 +990,7 @@ static void do_mesh_separation(GeometrySet &geometry_set,
     }
     case GEO_NODE_DELETE_GEOMETRY_MODE_EDGE_FACE: {
       Array<int> edge_map(mesh_in.totedge);
-      int num_selected_edges;
+      int num_selected_edges = 0;
 
       /* Fill all the maps based on the selection. */
       switch (domain) {
diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
index 3e9b615f478..b628c5cbab8 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
@@ -209,7 +209,7 @@ static void join_attributes(Span<const GeometryComponent *> src_components,
   const Map<AttributeIDRef, AttributeMetaData> info = get_final_attribute_info(src_components,
                                                                                ignored_attributes);
 
-  for (const Map<AttributeIDRef, AttributeMetaData>::Item &item : info.items()) {
+  for (const Map<AttributeIDRef, AttributeMetaData>::Item item : info.items()) {
     const AttributeIDRef attribute_id = item.key;
     const AttributeMetaData &meta_data = item.value;
 
@@ -399,7 +399,7 @@ static void join_curve_attributes(const Map<AttributeIDRef, AttributeMetaData> &
                                   Span<CurveComponent *> src_components,
                                   CurveEval &result)
 {
-  for (const Map<AttributeIDRef, AttributeMetaData>::Item &item : info.items()) {
+  for (const Map<AttributeIDRef, AttributeMetaData>::Item item : info.items()) {
     const AttributeIDRef attribute_id = item.key;
     const AttributeMetaData meta_data = item.value;
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
index 7062deff2f1..9f357ce2b1c 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc
@@ -201,7 +201,7 @@ static void geo_node_proximity_exec(GeoNodeExecParams params)
 
   if (!geometry_set_target.has_mesh() && !geometry_set_target.has_pointcloud()) {
     params.set_output("Position", fn::make_constant_field<float3>({0.0f, 0.0f, 0.0f}));
-    params.set_output("Distance", fn::make_constant_field<float>({0.0f}));
+    params.set_output("Distance", fn::make_constant_field<float>(0.0f));
     return;
   }
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
index 3eec2279f24..1cb6d43f685 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
@@ -136,7 +136,7 @@ static TextLayout get_text_layout(GeoNodeExecParams &params)
                               params.extract_input<float>("Text Box Height");
   VFont *vfont = (VFont *)params.node().id;
 
-  Curve cu = {nullptr};
+  Curve cu = {{nullptr}};
   cu.type = OB_FONT;
   /* Set defaults */
   cu.resolu = 12;
@@ -214,7 +214,7 @@ static Map<int, int> create_curve_instances(GeoNodeExecParams &params,
     if (handles.contains(charcodes[i])) {
       continue;
     }
-    Curve cu = {nullptr};
+    Curve cu = {{nullptr}};
     cu.type = OB_FONT;
     cu.resolu = 12;
     cu.vfont = vfont;
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc
index f5e6e7640ad..e5ec50858d9 100644
--- a/source/blender/nodes/intern/node_common.cc
+++ b/source/blender/nodes/intern/node_common.cc
@@ -372,7 +372,7 @@ void ntree_update_reroute_nodes(bNodeTree *ntree)
   }
 
   /* Actually update reroute nodes with changed types. */
-  for (const auto &item : reroute_types.items()) {
+  for (const auto item : reroute_types.items()) {
     bNode *reroute_node = item.key;
     const bNodeSocketType *socket_type = item.value;
     bNodeSocket *input_socket = (bNodeSocket *)reroute_node->inputs.first;



More information about the Bf-blender-cvs mailing list