Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-04-12 11:56:51 +0300
committerSergey Sharybin <sergey@blender.org>2022-04-13 12:48:12 +0300
commit25c357124de8905360c44a5a842284089ddec341 (patch)
treed7f7de7c459d622366ba5b0a7caec720c97f35c7 /source/blender/nodes
parentda66c0519fce9bff981370868a359e64198552bc (diff)
Cover some DNA files with C++ utility macros
Solves compilation warning with Clang, and moves manipulation with DNA structures to the designed way for C++. The tests and few other places are update to the new code by Jacques. Ref T96847 Maniphest Tasks: T96847 Differential Revision: https://developer.blender.org/D14625
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc4
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc4
2 files changed, 4 insertions, 4 deletions
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 bc34a1a6f2c..658de02fdab 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
@@ -186,7 +186,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 = dna::shallow_zero_initialize();
cu.type = OB_FONT;
/* Set defaults */
cu.resolu = 12;
@@ -278,7 +278,7 @@ static Map<int, int> create_curve_instances(GeoNodeExecParams &params,
if (handles.contains(layout.char_codes[i])) {
continue;
}
- Curve cu = {{nullptr}};
+ Curve cu = dna::shallow_zero_initialize();
cu.type = OB_FONT;
cu.resolu = 12;
cu.vfont = vfont;
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc
index f628d1ec77b..17fff4a7e1e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc
@@ -79,7 +79,7 @@ static void node_shader_free_tex_pointdensity(bNode *node)
PointDensity *pd = &point_density->pd;
RE_point_density_free(pd);
BKE_texture_pointdensity_free_data(pd);
- memset(pd, 0, sizeof(*pd));
+ *pd = dna::shallow_zero_initialize();
MEM_freeN(point_density);
}
@@ -90,7 +90,7 @@ static void node_shader_copy_tex_pointdensity(bNodeTree *UNUSED(dest_ntree),
dest_node->storage = MEM_dupallocN(src_node->storage);
NodeShaderTexPointDensity *point_density = (NodeShaderTexPointDensity *)dest_node->storage;
PointDensity *pd = &point_density->pd;
- memset(pd, 0, sizeof(*pd));
+ *pd = dna::shallow_zero_initialize();
}
} // namespace blender::nodes::node_shader_tex_pointdensity_cc