Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2675
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Jacques Lucke (JacquesLucke)
on Dec 20 2021, 11:05 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc
index 1e24b29038d..36cd24ec847 100644
--- a/source/blender/blenkernel/intern/geometry_component_curve.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curve.cc
@@ -455,7 +455,8 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider {
}
};
-static int get_spline_resolution(const SplinePtr &spline)
+namespace {
+int get_spline_resolution(const SplinePtr &spline)
{
if (const BezierSpline *bezier_spline = dynamic_cast<const BezierSpline *>(spline.get())) {
return bezier_spline->resolution();
@@ -465,8 +466,7 @@ static int get_spline_resolution(const SplinePtr &spline)
}
return 1;
}
-
-static void set_spline_resolution(SplinePtr &spline, const int resolution)
+void set_spline_resolution(SplinePtr &spline, const int resolution)
{
if (BezierSpline *bezier_spline = dynamic_cast<BezierSpline *>(spline.get())) {
bezier_spline->set_resolution(std::max(resolution, 1));
@@ -475,6 +475,7 @@ static void set_spline_resolution(SplinePtr &spline, const int resolution)
nurb_spline->set_resolution(std::max(resolution, 1));
}
}
+} // namespace
static GVArray make_resolution_read_attribute(const CurveEval &curve)
{
@@ -487,11 +488,11 @@ static GVMutableArray make_resolution_write_attribute(CurveEval &curve)
ForDerivedSpan<SplinePtr, get_spline_resolution, set_spline_resolution>(curve.splines());
}
+namespace {
static bool get_cyclic_value(const SplinePtr &spline)
{
return spline->is_cyclic();
}
-
static void set_cyclic_value(SplinePtr &spline, const bool value)
{
if (spline->is_cyclic() != value) {
@@ -499,6 +500,7 @@ static void set_cyclic_value(SplinePtr &spline, const bool value)
spline->mark_cache_invalid();
}
}
+} // namespace
static GVArray make_cyclic_read_attribute(const CurveEval &curve)
{
diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc
index 93a7646fed0..1602445fbc5 100644
--- a/source/blender/blenkernel/intern/geometry_component_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_component_instances.cc
@@ -340,15 +340,17 @@ const blender::bke::CustomDataAttributes &InstancesComponent::attributes() const
namespace blender::bke {
-static float3 get_transform_position(const float4x4 &transform)
+namespace {
+float3 get_transform_position(const float4x4 &transform)
{
return transform.translation();
}
-static void set_transform_position(float4x4 &transform, const float3 position)
+void set_transform_position(float4x4 &transform, const float3 position)
{
copy_v3_v3(transform.values[3], position);
}
+} // namespace
class InstancePositionAttributeProvider final : public BuiltinAttributeProvider {
public:
diff --git a/source/blender/blenlib/tests/BLI_virtual_array_test.cc b/source/blender/blenlib/tests/BLI_virtual_array_test.cc
index 62b7b383831..d0e45a77809 100644
--- a/source/blender/blenlib/tests/BLI_virtual_array_test.cc
+++ b/source/blender/blenlib/tests/BLI_virtual_array_test.cc
@@ -118,15 +118,16 @@ TEST(virtual_array, AsSpan)
EXPECT_EQ(span[6], 60);
}
-static int get_x(const std::array<int, 3> &item)
+namespace {
+int get_x(const std::array<int, 3> &item)
{
return item[0];
}
-
-static void set_x(std::array<int, 3> &item, int value)
+void set_x(std::array<int, 3> &item, int value)
{
item[0] = value;
}
+} // namespace
TEST(virtual_array, DerivedSpan)
{
Event Timeline
Jacques Lucke (JacquesLucke)
created this paste.
Dec 20 2021, 11:05 AM
Log In to Comment