Cleanup: Clang tidy

This commit is contained in:
Hans Goudey 2022-03-08 13:28:22 -06:00
parent 90c3147e05
commit d09695b4dd
6 changed files with 14 additions and 13 deletions

View File

@ -483,7 +483,7 @@ void deg_graph_node_tag_zero(Main *bmain,
if (comp_node->type == NodeType::ANIMATION) {
continue;
}
else if (comp_node->type == NodeType::COPY_ON_WRITE) {
if (comp_node->type == NodeType::COPY_ON_WRITE) {
id_node->is_cow_explicitly_tagged = true;
}

View File

@ -739,7 +739,7 @@ void update_id_after_copy(const Depsgraph *depsgraph,
case ID_GD: {
bGPdata *gpd_cow = (bGPdata *)id_cow;
bGPDlayer *gpl = (bGPDlayer *)(gpd_cow->layers.first);
if (gpl != NULL && gpl->runtime.gpl_orig == NULL) {
if (gpl != nullptr && gpl->runtime.gpl_orig == nullptr) {
BKE_gpencil_data_update_orig_pointers((bGPdata *)id_orig, gpd_cow);
}
break;

View File

@ -518,7 +518,7 @@ class AddOperation : public CurvesSculptStrokeOperation {
};
public:
~AddOperation()
~AddOperation() override
{
if (old_kdtree_ != nullptr) {
BLI_kdtree_3d_free(old_kdtree_);

View File

@ -2348,10 +2348,8 @@ static BIFIconID tree_element_get_icon_from_id(const ID *id)
if (text->filepath == nullptr || (text->flags & TXT_ISMEM)) {
return ICON_FILE_TEXT;
}
else {
/* Helps distinguish text-based formats like the file-browser does. */
return (BIFIconID)ED_file_extension_icon(text->filepath);
}
/* Helps distinguish text-based formats like the file-browser does. */
return (BIFIconID)ED_file_extension_icon(text->filepath);
}
case ID_GR:
return ICON_OUTLINER_COLLECTION;

View File

@ -1518,11 +1518,11 @@ static int uv_hide_exec(bContext *C, wmOperator *op)
BM_face_select_set(em->bm, efa, false);
break;
}
else if (UV_VERT_SEL_TEST(luv, !swap) && (ts->uv_selectmode == UV_SELECT_VERTEX)) {
if (UV_VERT_SEL_TEST(luv, !swap) && (ts->uv_selectmode == UV_SELECT_VERTEX)) {
BM_face_select_set(em->bm, efa, false);
break;
}
else if (ts->uv_selectmode == UV_SELECT_ISLAND) {
if (ts->uv_selectmode == UV_SELECT_ISLAND) {
BM_face_select_set(em->bm, efa, false);
break;
}
@ -1533,18 +1533,21 @@ static int uv_hide_exec(bContext *C, wmOperator *op)
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
if (UV_EDGE_SEL_TEST(luv, !swap) && (ts->uv_selectmode == UV_SELECT_EDGE)) {
if (em->selectmode == SCE_SELECT_EDGE)
if (em->selectmode == SCE_SELECT_EDGE) {
BM_edge_select_set(em->bm, l->e, false);
}
else {
BM_vert_select_set(em->bm, l->v, false);
BM_vert_select_set(em->bm, l->next->v, false);
}
}
else if (UV_VERT_SEL_TEST(luv, !swap) && (ts->uv_selectmode != UV_SELECT_EDGE)) {
if (em->selectmode == SCE_SELECT_EDGE)
if (em->selectmode == SCE_SELECT_EDGE) {
BM_edge_select_set(em->bm, l->e, false);
else
}
else {
BM_vert_select_set(em->bm, l->v, false);
}
}
}
if (!swap) {

View File

@ -1720,7 +1720,7 @@ static int uv_select_edgering(Scene *scene, Object *obedit, UvNearestHit *hit, c
if (select && uvedit_edge_select_test(scene, l_step, cd_loop_uv_offset)) {
break;
}
else if (!select && !uvedit_edge_select_test(scene, l_step, cd_loop_uv_offset)) {
if (!select && !uvedit_edge_select_test(scene, l_step, cd_loop_uv_offset)) {
break;
}
}