diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-18 07:27:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-18 07:41:24 +0300 |
commit | af4167441bc37707c1ed32ded348bc0865f9c093 (patch) | |
tree | 586d24617fe21cc8b6257851e5176ba664d6ccdb /source/blender/blenkernel/intern | |
parent | 50a4b9d502104aabdd33ed924a89fe018cfa80b3 (diff) |
Cleanup: clang-tidy
Diffstat (limited to 'source/blender/blenkernel/intern')
4 files changed, 9 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 5ac85ad3aaf..9f5f70ab2ba 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -249,9 +249,7 @@ bool BKE_gpencil_is_first_lineart_in_stack(const Object *ob, const GpencilModifi if (gmd == md) { return true; } - else { - return false; - } + return false; } } /* If we reach here it means md is not in ob's modifier stack. */ diff --git a/source/blender/blenkernel/intern/lib_id_test.cc b/source/blender/blenkernel/intern/lib_id_test.cc index 8e21ae88aa6..f6988a2d71f 100644 --- a/source/blender/blenkernel/intern/lib_id_test.cc +++ b/source/blender/blenkernel/intern/lib_id_test.cc @@ -123,7 +123,7 @@ TEST(lib_id_main_unique_name, local_ids_1) test_lib_id_main_sort_check_order({id_a, id_b, id_c}); BLI_strncpy(id_c->name, id_a->name, sizeof(id_c->name)); - BKE_id_new_name_validate(&ctx.bmain->objects, id_c, NULL, false); + BKE_id_new_name_validate(&ctx.bmain->objects, id_c, nullptr, false); EXPECT_TRUE(strcmp(id_c->name + 2, "OB_A.001") == 0); EXPECT_TRUE(strcmp(id_a->name + 2, "OB_A") == 0); EXPECT_TRUE(ctx.bmain->objects.first == id_a); @@ -150,7 +150,7 @@ TEST(lib_id_main_unique_name, linked_ids_1) id_b->lib = lib_a; id_sort_by_name(&ctx.bmain->objects, id_b, nullptr); BLI_strncpy(id_b->name, id_a->name, sizeof(id_b->name)); - BKE_id_new_name_validate(&ctx.bmain->objects, id_b, NULL, true); + BKE_id_new_name_validate(&ctx.bmain->objects, id_b, nullptr, true); EXPECT_TRUE(strcmp(id_b->name + 2, "OB_A.001") == 0); EXPECT_TRUE(strcmp(id_a->name + 2, "OB_A") == 0); EXPECT_TRUE(ctx.bmain->objects.first == id_c); @@ -160,7 +160,7 @@ TEST(lib_id_main_unique_name, linked_ids_1) id_b->lib = lib_b; id_sort_by_name(&ctx.bmain->objects, id_b, nullptr); BLI_strncpy(id_b->name, id_a->name, sizeof(id_b->name)); - BKE_id_new_name_validate(&ctx.bmain->objects, id_b, NULL, true); + BKE_id_new_name_validate(&ctx.bmain->objects, id_b, nullptr, true); EXPECT_TRUE(strcmp(id_b->name + 2, "OB_A") == 0); EXPECT_TRUE(strcmp(id_a->name + 2, "OB_A") == 0); EXPECT_TRUE(ctx.bmain->objects.first == id_c); diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index e8294086c35..e375fa929ed 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -241,9 +241,7 @@ static float3 calculate_next_normal(const float3 &last_normal, const float3 axis = float3::cross(last_tangent, current_tangent).normalized(); return rotate_direction_around_axis(last_normal, axis, angle); } - else { - return last_normal; - } + return last_normal; } static void calculate_normals_minimum(Span<float3> tangents, diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c index 5f732ba91ab..4ca6f93b014 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.c +++ b/source/blender/blenkernel/intern/subdiv_ccg.c @@ -1042,7 +1042,7 @@ typedef struct AverageGridsBoundariesData { CCGKey *key; /* Optional lookup table. Maps task index to index in `subdiv_ccg->adjacent_vertices`. */ - int *adjacent_edge_index_map; + const int *adjacent_edge_index_map; } AverageGridsBoundariesData; typedef struct AverageGridsBoundariesTLSData { @@ -1117,7 +1117,7 @@ typedef struct AverageGridsCornerData { CCGKey *key; /* Optional lookup table. Maps task range index to index in subdiv_ccg->adjacent_vertices*/ - int *adjacent_vert_index_map; + const int *adjacent_vert_index_map; } AverageGridsCornerData; static void subdiv_ccg_average_grids_corners(SubdivCCG *subdiv_ccg, @@ -1161,7 +1161,7 @@ static void subdiv_ccg_average_grids_corners_task(void *__restrict userdata_v, static void subdiv_ccg_average_boundaries(SubdivCCG *subdiv_ccg, CCGKey *key, - int *adjacent_edge_index_map, + const int *adjacent_edge_index_map, int num_adjacent_edges) { TaskParallelSettings parallel_range_settings; @@ -1186,7 +1186,7 @@ static void subdiv_ccg_average_all_boundaries(SubdivCCG *subdiv_ccg, CCGKey *key static void subdiv_ccg_average_corners(SubdivCCG *subdiv_ccg, CCGKey *key, - int *adjacent_vert_index_map, + const int *adjacent_vert_index_map, int num_adjacent_vertices) { TaskParallelSettings parallel_range_settings; |