diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-09-02 21:26:49 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-09-02 21:34:37 +0300 |
commit | 9ba04c4598fced674d784e1b6dcb30965deac211 (patch) | |
tree | 7fe8003d60b848b05ae94791eda08cc3936c3797 /source/blender/editors/space_view3d | |
parent | 361a2de6f1f458071d03b6db98f135c98378f07f (diff) |
Cleanup: Fix clang-tidy warnings: [modernize-use-bool-literals]
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.cc | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index b60a7c6d0e4..e7a3c5e0e4d 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -439,24 +439,24 @@ static bool view3d_selectable_data(bContext *C) Object *ob = CTX_data_active_object(C); if (!ED_operator_region_view3d_active(C)) { - return 0; + return false; } if (ob) { if (ob->mode & OB_MODE_EDIT) { if (ob->type == OB_FONT) { - return 0; + return false; } } else { if ((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) && !BKE_paint_select_elem_test(ob)) { - return 0; + return false; } } } - return 1; + return true; } /* helper also for box_select */ @@ -471,21 +471,21 @@ static bool edge_inside_rect(const rctf *rect, const float v1[2], const float v2 /* check points in rect */ if (edge_fully_inside_rect(rect, v1, v2)) { - return 1; + return true; } /* check points completely out rect */ if (v1[0] < rect->xmin && v2[0] < rect->xmin) { - return 0; + return false; } if (v1[0] > rect->xmax && v2[0] > rect->xmax) { - return 0; + return false; } if (v1[1] < rect->ymin && v2[1] < rect->ymin) { - return 0; + return false; } if (v1[1] > rect->ymax && v2[1] > rect->ymax) { - return 0; + return false; } /* simple check lines intersecting. */ @@ -495,13 +495,13 @@ static bool edge_inside_rect(const rctf *rect, const float v1[2], const float v2 d4 = (v1[1] - v2[1]) * (v1[0] - rect->xmax) + (v2[0] - v1[0]) * (v1[1] - rect->ymin); if (d1 < 0 && d2 < 0 && d3 < 0 && d4 < 0) { - return 0; + return false; } if (d1 > 0 && d2 > 0 && d3 > 0 && d4 > 0) { - return 0; + return false; } - return 1; + return true; } static void do_lasso_select_pose__do_tag(void *userData, @@ -1544,11 +1544,11 @@ void VIEW3D_OT_select_menu(wmOperatorType *ot) RNA_def_property_flag(prop, (PropertyFlag)(PROP_HIDDEN | PROP_ENUM_NO_TRANSLATE)); ot->prop = prop; - prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend", ""); + prop = RNA_def_boolean(ot->srna, "extend", false, "Extend", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", ""); + prop = RNA_def_boolean(ot->srna, "deselect", false, "Deselect", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", ""); + prop = RNA_def_boolean(ot->srna, "toggle", false, "Toggle", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } @@ -1734,11 +1734,11 @@ void VIEW3D_OT_bone_select_menu(wmOperatorType *ot) RNA_def_property_flag(prop, (PropertyFlag)(PROP_HIDDEN | PROP_ENUM_NO_TRANSLATE)); ot->prop = prop; - prop = RNA_def_boolean(ot->srna, "extend", 0, "Extend", ""); + prop = RNA_def_boolean(ot->srna, "extend", false, "Extend", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", ""); + prop = RNA_def_boolean(ot->srna, "deselect", false, "Deselect", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", ""); + prop = RNA_def_boolean(ot->srna, "toggle", false, "Toggle", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } @@ -3014,21 +3014,25 @@ void VIEW3D_OT_select(wmOperatorType *ot) prop = RNA_def_boolean( ot->srna, "center", - 0, + false, "Center", "Use the object center when selecting, in edit mode used to extend object selection"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean( - ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)"); + prop = RNA_def_boolean(ot->srna, + "enumerate", + false, + "Enumerate", + "List objects under the mouse (object mode only)"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (edit mode only)"); + prop = RNA_def_boolean( + ot->srna, "object", false, "Object", "Use object selection (edit mode only)"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); /* Needed for select-through to usefully drag handles, see: T98254. * NOTE: this option may be removed and become default behavior, see design task: T98552. */ prop = RNA_def_boolean(ot->srna, "vert_without_handles", - 0, + false, "Control Point Without Handles", "Only select the curve control point, not it's handles"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); @@ -4276,9 +4280,9 @@ static bool pchan_circle_doSelectJoint(void *userData, else { pchan->bone->flag &= ~BONE_SELECTED; } - return 1; + return true; } - return 0; + return false; } static void do_circle_select_pose__doSelectBone(void *userData, bPoseChannel *pchan, @@ -4386,9 +4390,9 @@ static bool armature_circle_doSelectJoint(void *userData, ebone->flag &= ~BONE_TIPSEL; } } - return 1; + return true; } - return 0; + return false; } static void do_circle_select_armature__doSelectBone(void *userData, EditBone *ebone, |