diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 07:23:52 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-26 07:23:52 +0300 |
commit | 34477bbfcde34d0b27f04eccdddd0a093d8be1c0 (patch) | |
tree | de6f4349f103671e0f1f9b459c0064cd0ce7a344 /source/blender/editors | |
parent | 6275541df7e02c40e8c8650bba3104b5df8d34ef (diff) |
Cleanup: remove redundant parenthesis
Diffstat (limited to 'source/blender/editors')
16 files changed, 41 insertions, 41 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 5b4d436b0e0..e0df7328c74 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1341,7 +1341,7 @@ static size_t animfilter_fcurves(ListBase *anim_data, * Back to step 2 :) */ for (fcu = first; - ((fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id))); + (fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id)); fcu = fcu->next) { if (UNLIKELY(fcurve_type == ANIMTYPE_NLACURVE)) { /* NLA Control Curve - Basically the same as normal F-Curves, @@ -1602,7 +1602,7 @@ static size_t animfilter_nla_controls( /* add control curves from each NLA strip... */ /* NOTE: ANIMTYPE_FCURVES are created here, to avoid duplicating the code needed */ - BEGIN_ANIMFILTER_SUBCHANNELS (((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0)) { + BEGIN_ANIMFILTER_SUBCHANNELS ((adt->flag & ADT_NLA_SKEYS_COLLAPSED) == 0) { NlaTrack *nlt; NlaStrip *strip; @@ -1892,7 +1892,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, } /* check selection and object type filters */ - if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & BASE_SELECTED))) { + if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !(base->flag & BASE_SELECTED)) { /* only selected should be shown */ continue; } diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 81b1c096d76..9e828ebd501 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -1377,12 +1377,12 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* break connections for unseen bones */ if (((arm->layer & ebone->layer) && - ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED)))) == 0) { + (ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED))) == 0) { ebone->temp.ebone = NULL; } if (((arm->layer & ebone->layer) && - ((ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED)))) == 0) { + (ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED))) == 0) { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { ebone->parent->temp.ebone = NULL; } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 1af5916c5fe..3aa83262505 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -5588,7 +5588,7 @@ static int gpencil_cutter_lasso_select(bContext *C, /* Select points */ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { - if ((gpl->flag & GP_LAYER_LOCKED) || ((gpl->flag & GP_LAYER_HIDE))) { + if ((gpl->flag & GP_LAYER_LOCKED) || (gpl->flag & GP_LAYER_HIDE)) { continue; } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 37acd7540cf..e1eeda5437a 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -3716,7 +3716,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) * is essential for ensuring that they can quickly return to that view. */ } - else if ((!ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP))) { + else if (!ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP)) { gpencil_guide_event_handling(C, op, event, p); estate = OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 0c8af215e9f..b13cab8be6d 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -1703,7 +1703,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_PADPLUSKEY: case WHEELUPMOUSE: { - if ((event->val != KM_RELEASE)) { + if (event->val != KM_RELEASE) { tgpi->tot_edges = tgpi->tot_edges + 1; CLAMP(tgpi->tot_edges, tgpi->type == GP_STROKE_BOX ? 1 : MIN_EDGES, MAX_EDGES); RNA_int_set(op->ptr, "edges", tgpi->tot_edges); @@ -1713,7 +1713,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_PADMINUS: case WHEELDOWNMOUSE: { - if ((event->val != KM_RELEASE)) { + if (event->val != KM_RELEASE) { tgpi->tot_edges = tgpi->tot_edges - 1; CLAMP(tgpi->tot_edges, tgpi->type == GP_STROKE_BOX ? 1 : MIN_EDGES, MAX_EDGES); RNA_int_set(op->ptr, "edges", tgpi->tot_edges); @@ -1723,7 +1723,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_FKEY: /* brush thickness/ brush strength */ { - if ((event->val == KM_PRESS)) { + if (event->val == KM_PRESS) { if (event->modifier & KM_SHIFT) { tgpi->prev_flag = tgpi->flag; tgpi->flag = IN_BRUSH_STRENGTH; @@ -1869,7 +1869,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_PADPLUSKEY: case WHEELUPMOUSE: { - if ((event->val != KM_RELEASE)) { + if (event->val != KM_RELEASE) { tgpi->tot_edges = tgpi->tot_edges + 1; CLAMP(tgpi->tot_edges, tgpi->type == GP_STROKE_BOX ? 1 : MIN_EDGES, MAX_EDGES); RNA_int_set(op->ptr, "edges", tgpi->tot_edges); @@ -1881,7 +1881,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_PADMINUS: case WHEELDOWNMOUSE: { - if ((event->val != KM_RELEASE)) { + if (event->val != KM_RELEASE) { tgpi->tot_edges = tgpi->tot_edges - 1; CLAMP(tgpi->tot_edges, tgpi->type == GP_STROKE_BOX ? 1 : MIN_EDGES, MAX_EDGES); RNA_int_set(op->ptr, "edges", tgpi->tot_edges); @@ -1893,7 +1893,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_GKEY: /* grab mode */ { - if ((event->val == KM_PRESS)) { + if (event->val == KM_PRESS) { tgpi->flag = IN_MOVE; WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL); } @@ -1901,7 +1901,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } case EVT_FKEY: /* brush thickness/ brush strength */ { - if ((event->val == KM_PRESS)) { + if (event->val == KM_PRESS) { if (event->modifier & KM_SHIFT) { tgpi->prev_flag = tgpi->flag; tgpi->flag = IN_BRUSH_STRENGTH; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 56b550995be..7133c533e11 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9553,8 +9553,8 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi else if (val == KM_PRESS) { if ((ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY, EVT_LEFTARROWKEY, EVT_RIGHTARROWKEY) && (event->modifier & (KM_SHIFT | KM_CTRL | KM_ALT | KM_OSKEY)) == 0) || - ((ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE) && (event->modifier & KM_CTRL) && - (event->modifier & (KM_SHIFT | KM_ALT | KM_OSKEY)) == 0))) { + (ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE) && (event->modifier & KM_CTRL) && + (event->modifier & (KM_SHIFT | KM_ALT | KM_OSKEY)) == 0)) { const int value_orig = RNA_property_int_get(&listbox->rnapoin, listbox->rnaprop); int value, min, max; diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index bae5050f0ac..1eae5550703 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -4173,7 +4173,7 @@ static bool project_paint_check_face_sel(const ProjPaintState *ps, int orig_index; if ((face_lookup->index_mp_to_orig != NULL) && - (((orig_index = (face_lookup->index_mp_to_orig[lt->poly]))) != ORIGINDEX_NONE)) { + ((orig_index = (face_lookup->index_mp_to_orig[lt->poly])) != ORIGINDEX_NONE)) { return face_lookup->select_poly_orig && face_lookup->select_poly_orig[orig_index]; } return ps->select_poly_eval && ps->select_poly_eval[lt->poly]; diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c index 22346434ed5..9ab36fe1402 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c @@ -258,7 +258,7 @@ BLI_INLINE float wval_exclusion(float weight, float paintval, float fac) return weight; } mfac = 1.0f - fac; - temp = 0.5f - ((2.0f * (weight - 0.5f) * (paintval - 0.5f))); + temp = 0.5f - (2.0f * (weight - 0.5f) * (paintval - 0.5f)); return temp * fac + weight * mfac; } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 3dc522ffcb9..c15fcc634dd 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1188,22 +1188,22 @@ static void buttons_panel_context_draw(const bContext *C, Panel *panel) PointerRNA *ptr = &path->ptr[i]; /* Skip scene and view layer to save space. */ - if ((!ELEM(sbuts->mainb, - BCONTEXT_RENDER, - BCONTEXT_OUTPUT, - BCONTEXT_SCENE, - BCONTEXT_VIEW_LAYER, - BCONTEXT_WORLD) && - ptr->type == &RNA_Scene)) { + if (!ELEM(sbuts->mainb, + BCONTEXT_RENDER, + BCONTEXT_OUTPUT, + BCONTEXT_SCENE, + BCONTEXT_VIEW_LAYER, + BCONTEXT_WORLD) && + ptr->type == &RNA_Scene) { continue; } - if ((!ELEM(sbuts->mainb, - BCONTEXT_RENDER, - BCONTEXT_OUTPUT, - BCONTEXT_SCENE, - BCONTEXT_VIEW_LAYER, - BCONTEXT_WORLD) && - ptr->type == &RNA_ViewLayer)) { + if (!ELEM(sbuts->mainb, + BCONTEXT_RENDER, + BCONTEXT_OUTPUT, + BCONTEXT_SCENE, + BCONTEXT_VIEW_LAYER, + BCONTEXT_WORLD) && + ptr->type == &RNA_ViewLayer) { continue; } diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index e2d4f094137..8ad998e2124 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -2714,7 +2714,7 @@ uint filelist_entry_select_set(const FileList *filelist, BLI_assert(entry); BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); - if (((check == CHECK_ALL)) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || + if ((check == CHECK_ALL) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) { switch (select) { case FILE_SEL_REMOVE: @@ -2775,7 +2775,7 @@ uint filelist_entry_select_get(FileList *filelist, FileDirEntry *entry, FileChec BLI_assert(entry); BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); - if (((check == CHECK_ALL)) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || + if ((check == CHECK_ALL) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) { /* Default NULL pointer if not found is fine here! */ return POINTER_AS_UINT( diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index 8a2ff8c2ece..8e7bd07e987 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -1571,7 +1571,7 @@ static int outliner_filter_subtree(SpaceOutliner *space_outliner, for (te = static_cast<TreeElement *>(lb->first); te; te = te_next) { te_next = te->next; - if ((outliner_element_visible_get(scene, view_layer, te, exclude_filter) == false)) { + if (outliner_element_visible_get(scene, view_layer, te, exclude_filter) == false) { /* Don't free the tree, but extract the children from the parent and add to this tree. */ /* This also needs filtering the subtree prior (see T69246). */ outliner_filter_subtree( diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 9a2885c44b1..d7ee224adff 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2403,7 +2403,7 @@ void ED_view3d_datamask(const bContext *C, (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_WEIGHT)) { r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT; } - if ((CTX_data_mode_enum(C) == CTX_MODE_SCULPT)) { + if (CTX_data_mode_enum(C) == CTX_MODE_SCULPT) { r_cddata_masks->vmask |= CD_MASK_PAINT_MASK; } } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 2f5ca79a660..8be170a3481 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -1040,7 +1040,7 @@ static int gizmo_ruler_modal(bContext *C, const bool do_snap = !(tweak_flag & WM_GIZMO_TWEAK_SNAP); #endif const bool do_thickness = tweak_flag & WM_GIZMO_TWEAK_PRECISE; - if ((ruler_info->drag_state_prev.do_thickness != do_thickness)) { + if (ruler_info->drag_state_prev.do_thickness != do_thickness) { do_cursor_update = true; } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 95aa48efd84..85bb8c1b31a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1658,8 +1658,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) orient_type_set = orient_type_curr; } - if (((prop = RNA_struct_find_property(op->ptr, "orient_matrix_type")) && - !RNA_property_is_set(op->ptr, prop))) { + if ((prop = RNA_struct_find_property(op->ptr, "orient_matrix_type")) && + !RNA_property_is_set(op->ptr, prop)) { /* Set the first time to register on redo. */ RNA_property_enum_set(op->ptr, prop, orient_type_set); RNA_float_set_array(op->ptr, "orient_matrix", &t->spacemtx[0][0]); diff --git a/source/blender/editors/transform/transform_convert_object.c b/source/blender/editors/transform/transform_convert_object.c index caa11fa5db4..c82364ba7ba 100644 --- a/source/blender/editors/transform/transform_convert_object.c +++ b/source/blender/editors/transform/transform_convert_object.c @@ -658,7 +658,7 @@ static void createTransObject(bContext *C, TransInfo *t) if (ob->parent != NULL) { if (ob->parent && !BLI_gset_haskey(objects_in_transdata, ob->parent) && !BLI_gset_haskey(objects_in_transdata, ob)) { - if (((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0)) { + if ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0) { Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent); if (base_parent && !BASE_XFORM_INDIRECT(base_parent)) { Object *ob_parent_recurse = ob->parent; diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index 422ab85279b..2f77009e720 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -3461,7 +3461,7 @@ static eSnapMode transform_snap_context_project_view3d_mixed_impl(SnapObjectCont copy_v3_v3(r_face_nor, no); } - if ((snap_to_flag & SCE_SNAP_MODE_FACE_RAYCAST)) { + if (snap_to_flag & SCE_SNAP_MODE_FACE_RAYCAST) { retval = SCE_SNAP_MODE_FACE_RAYCAST; copy_v3_v3(r_loc, loc); |