Cleanup: clang-tidy

This commit is contained in:
2021-06-18 14:27:43 +10:00
parent 50a4b9d502
commit af4167441b
17 changed files with 32 additions and 36 deletions

View File

@@ -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. */

View File

@@ -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);

View File

@@ -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,

View File

@@ -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;