diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 08:14:13 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 08:34:32 +0300 |
commit | c9e35c2ced92082c86f1ecb9ecd16c6230218c7c (patch) | |
tree | 24bd862961d2bbfa022cfc3c5262cfe1e63550b3 /source/blender/editors | |
parent | 865894481ce76325d817533c654bda2ce2e65c66 (diff) |
Cleanup: remove redundant double parenthesis
Diffstat (limited to 'source/blender/editors')
48 files changed, 76 insertions, 77 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 8edeea49cbb..58bcf0efea8 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -85,7 +85,7 @@ #define ANIM_CHAN_NAME_SIZE 256 /* get the pointer used for some flag */ -#define GET_ACF_FLAG_PTR(ptr, type) ((*(type) = sizeof((ptr))), &(ptr)) +#define GET_ACF_FLAG_PTR(ptr, type) ((*(type) = sizeof(ptr)), &(ptr)) /* *********************************************** */ /* Generic Functions (Type independent) */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c index 600abaf3737..4b78b122764 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c @@ -83,8 +83,8 @@ static bool gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[2], return false; } - margin[0] = ((handle_size * scale_xy[0])); - margin[1] = ((handle_size * scale_xy[1])); + margin[0] = (handle_size * scale_xy[0]); + margin[1] = (handle_size * scale_xy[1]); return true; } diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c index 0a5ec3330c2..8e4b4519ff8 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c @@ -81,9 +81,9 @@ static void gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[3], float scale_xyz[3]; gizmo_calc_rect_view_scale(gz, dims, scale_xyz); - margin[0] = ((handle_size * scale_xyz[0])); - margin[1] = ((handle_size * scale_xyz[1])); - margin[2] = ((handle_size * scale_xyz[2])); + margin[0] = (handle_size * scale_xyz[0]); + margin[1] = (handle_size * scale_xyz[1]); + margin[2] = (handle_size * scale_xyz[2]); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index 9b7b157dc7e..d7ae9be6c33 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -106,9 +106,9 @@ static void dial_geom_draw(const float color[4], UNUSED_VARS(gz, axis_modal_mat, clip_plane); wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_dial, select, color); #else - const bool filled = ((draw_options & (select ? (ED_GIZMO_DIAL_DRAW_FLAG_FILL | - ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT) : - ED_GIZMO_DIAL_DRAW_FLAG_FILL))); + const bool filled = (draw_options & (select ? (ED_GIZMO_DIAL_DRAW_FLAG_FILL | + ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT) : + ED_GIZMO_DIAL_DRAW_FLAG_FILL)); GPUVertFormat *format = immVertexFormat(); /* NOTE(Metal): Prefer using 3D coordinates with 3D shader, even if rendering 2D gizmo's. */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index af1f09d7e25..f6ae02dd010 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -93,9 +93,9 @@ static void move_geom_draw(const wmGizmo *gz, #else const int draw_style = RNA_enum_get(gz->ptr, "draw_style"); const bool filled = (draw_style != ED_GIZMO_MOVE_STYLE_CROSS_2D) && - ((draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL | - ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT) : - ED_GIZMO_MOVE_DRAW_FLAG_FILL))); + (draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL | + ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT) : + ED_GIZMO_MOVE_DRAW_FLAG_FILL)); GPUVertFormat *format = immVertexFormat(); /* NOTE(Metal): Prefer using 3D coordinates with 3D shader, even if rendering 2D gizmo's. */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 7446c727a0c..37acd7540cf 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1743,14 +1743,14 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, /* 2) Tag any point with overly low influence for removal in the next pass */ if ((inf1 > 0.0f) && - (((pt1->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)))) { + ((pt1->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) { pt1->flag |= GP_SPOINT_TAG; do_cull = true; } if ((inf1 > 2.0f) && - (((pt2->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)))) { + ((pt2->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) { pt2->flag |= GP_SPOINT_TAG; do_cull = true; } diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 4a4fffc9638..0c8af215e9f 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -677,8 +677,8 @@ static void gpencil_primitive_circle(tGPDprimitive *tgpi, tGPspoint *points2D) center[0] = tgpi->start[0] + ((tgpi->end[0] - tgpi->start[0]) / 2.0f); center[1] = tgpi->start[1] + ((tgpi->end[1] - tgpi->start[1]) / 2.0f); - radius[0] = fabsf(((tgpi->end[0] - tgpi->start[0]) / 2.0f)); - radius[1] = fabsf(((tgpi->end[1] - tgpi->start[1]) / 2.0f)); + radius[0] = fabsf((tgpi->end[0] - tgpi->start[0]) / 2.0f); + radius[1] = fabsf((tgpi->end[1] - tgpi->start[1]) / 2.0f); for (int i = tgpi->tot_stored_edges; i < totpoints; i++) { tGPspoint *p2d = &points2D[i]; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 729e8412684..c972d7c680f 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -770,7 +770,7 @@ void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc, float xyval[2]; /* sanity checks */ - BLI_assert((gsc->area->spacetype == SPACE_VIEW3D)); + BLI_assert(gsc->area->spacetype == SPACE_VIEW3D); if (flag & GP_STROKE_3DSPACE) { if (ED_view3d_project_float_global(region, pt, xyval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) { diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c index 22fbf0021fc..fbfea067eca 100644 --- a/source/blender/editors/gpencil/gpencil_weight_paint.c +++ b/source/blender/editors/gpencil/gpencil_weight_paint.c @@ -235,7 +235,7 @@ static bool brush_draw_apply(tGP_BrushWeightpaintData *gso, if (gso->vrgroup == -1) { if (gso->object) { Object *ob_armature = BKE_modifiers_is_deformed_by_armature(gso->object); - if ((ob_armature != NULL)) { + if (ob_armature != NULL) { Bone *actbone = ((bArmature *)ob_armature->data)->act_bone; if (actbone != NULL) { bPoseChannel *pchan = BKE_pose_channel_find_name(ob_armature->pose, actbone->name); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ea1770db6f5..a6c700bdc2f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6152,7 +6152,7 @@ static bool ui_numedit_but_UNITVEC( * do this in "angle" space - this gives increments of same size */ for (int i = 0; i < 3; i++) { angle = asinf(fp[i]); - angle_snap = roundf((angle / snap_steps_angle)) * snap_steps_angle; + angle_snap = roundf(angle / snap_steps_angle) * snap_steps_angle; fp[i] = sinf(angle_snap); } normalize_v3(fp); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index ad2c08194aa..5d71e828d05 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1956,7 +1956,7 @@ static void ui_id_preview_image_render_size( const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job) { /* changed only ever set by dynamic icons */ - if (((pi->flag[size] & PRV_CHANGED) || !pi->rect[size])) { + if ((pi->flag[size] & PRV_CHANGED) || !pi->rect[size]) { /* create the rect if necessary */ icon_set_image(C, scene, id, pi, size, use_job); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 842201894a3..1b13632b131 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1371,7 +1371,7 @@ static void widget_draw_icon( alpha = 0.75f; } } - else if ((but->type == UI_BTYPE_LABEL)) { + else if (but->type == UI_BTYPE_LABEL) { /* extra feature allows more alpha blending */ if (but->a1 == 1.0f) { alpha *= but->a2; @@ -1422,7 +1422,7 @@ static void widget_draw_icon( if (ui_but_drag_is_draggable(but) && (but->flag & UI_ACTIVE)) { UI_icon_draw_ex(xs, ys, icon, aspect, 1.25f, 0.0f, color, has_theme); } - else if ((but->flag & (UI_ACTIVE | UI_SELECT | UI_SELECT_DRAW))) { + else if (but->flag & (UI_ACTIVE | UI_SELECT | UI_SELECT_DRAW)) { UI_icon_draw_ex(xs, ys, icon, aspect, alpha, 0.0f, color, has_theme); } else if (!((but->icon != ICON_NONE) && UI_but_is_tool(but))) { diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c index 9e2b7aa7f4d..1b9c98db5eb 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin.c @@ -48,7 +48,7 @@ static int edbm_spin_exec(bContext *C, wmOperator *op) const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip"); const bool dupli = RNA_boolean_get(op->ptr, "dupli"); const bool use_auto_merge = (RNA_boolean_get(op->ptr, "use_auto_merge") && (dupli == false) && - (steps >= 3) && fabsf((fabsf(angle) - (float)(M_PI * 2))) <= 1e-6f); + (steps >= 3) && fabsf(fabsf(angle) - (float)(M_PI * 2)) <= 1e-6f); if (is_zero_v3(axis)) { BKE_report(op->reports, RPT_ERROR, "Invalid/unset axis"); diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index d364aa2274f..8130b0ac83d 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1220,7 +1220,7 @@ static void knife_bvh_init(KnifeTool_OpData *kcd) /* Test Function. */ bool (*test_fn)(BMFace *); - if ((kcd->only_select && kcd->cut_through)) { + if (kcd->only_select && kcd->cut_through) { test_fn = knife_bm_face_is_select; } else { @@ -2068,7 +2068,7 @@ static bool knife_add_single_cut__is_linehit_outside_face(BMFace *f, return true; } } - else if ((lh->kfe && lh->kfe->e)) { + else if (lh->kfe && lh->kfe->e) { BMLoop *l; /* side-of-edge */ if ((l = BM_face_edge_share_loop(f, lh->kfe->e)) && (BM_loop_point_side_of_edge_test(l, co) < 0.0f)) { diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c index 17580dbe7d1..06565fbf314 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.c +++ b/source/blender/editors/mesh/editmesh_polybuild.c @@ -77,7 +77,7 @@ static void edbm_flag_disable_all_multi(const Scene *scene, static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele) { ARegion *region = CTX_wm_region(C); - const bool show_gizmo = !((v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL))); + const bool show_gizmo = !(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)); wmGizmoMap *gzmap = show_gizmo ? region->gizmo_map : NULL; wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_elem") : diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index b66fe84e84e..34f7301c4b1 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -3226,7 +3226,7 @@ static void select_linked_delimit_begin(BMesh *bm, int delimit) BMEdge *e; BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { - const bool is_walk_ok = ((select_linked_delimit_test(e, delimit, &delimit_data) == false)); + const bool is_walk_ok = (select_linked_delimit_test(e, delimit, &delimit_data) == false); BMO_edge_flag_set(bm, e, BMO_ELE_TAG, is_walk_ok); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 3c3b66b4b1d..fa9ded0f989 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -114,7 +114,7 @@ ListBase *ED_object_constraint_list_from_constraint(Object *ob, } /* try object constraints first */ - if ((BLI_findindex(&ob->constraints, con) != -1)) { + if (BLI_findindex(&ob->constraints, con) != -1) { return &ob->constraints; } @@ -126,7 +126,7 @@ ListBase *ED_object_constraint_list_from_constraint(Object *ob, * NOTE: it's not possible to directly look up the active bone yet, so this will have to do */ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - if ((BLI_findindex(&pchan->constraints, con) != -1)) { + if (BLI_findindex(&pchan->constraints, con) != -1) { if (r_pchan) { *r_pchan = pchan; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c3482b13db6..2e22e3bb00d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1490,7 +1490,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) ViewLayer *view_layer = CTX_data_view_layer(C); BKE_view_layer_synced_ensure(scene, view_layer); Object *obact = BKE_view_layer_active_object_get(view_layer); - if (obact && ((obact->mode & OB_MODE_ALL_PAINT))) { + if (obact && (obact->mode & OB_MODE_ALL_PAINT)) { ctx_ob_single_active.ptr.data = obact; BLI_addtail(&ctx_objects, &ctx_ob_single_active); } diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index 44fea0b32f0..0e671257972 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -2789,7 +2789,7 @@ static bool vertex_group_vert_poll_ex(bContext *C, return false; } - if (ob_type_flag && (((1 << ob->type) & ob_type_flag)) == 0) { + if (ob_type_flag && ((1 << ob->type) & ob_type_flag) == 0) { return false; } diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 07a93d3907a..f19017cb723 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -333,7 +333,7 @@ static const EnumPropertyItem *scene_new_sequencer_enum_itemf(bContext *C, else { Scene *scene = CTX_data_scene(C); Sequence *seq = SEQ_select_active_get(scene); - if ((seq && (seq->type == SEQ_TYPE_SCENE) && (seq->scene != NULL))) { + if (seq && (seq->type == SEQ_TYPE_SCENE) && (seq->scene != NULL)) { has_scene_or_no_context = true; } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 29f78b2a0ef..c24850fdad5 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1584,28 +1584,28 @@ static void area_move_set_limits(wmWindow *win, /* logic here is only tested for lower edge :) */ /* left edge */ - if ((area->v1->editflag && area->v2->editflag)) { + if (area->v1->editflag && area->v2->editflag) { *smaller = area->v4->vec.x - size_max; *bigger = area->v4->vec.x - size_min; *use_bigger_smaller_snap = true; return; } /* top edge */ - if ((area->v2->editflag && area->v3->editflag)) { + if (area->v2->editflag && area->v3->editflag) { *smaller = area->v1->vec.y + size_min; *bigger = area->v1->vec.y + size_max; *use_bigger_smaller_snap = true; return; } /* right edge */ - if ((area->v3->editflag && area->v4->editflag)) { + if (area->v3->editflag && area->v4->editflag) { *smaller = area->v1->vec.x + size_min; *bigger = area->v1->vec.x + size_max; *use_bigger_smaller_snap = true; return; } /* lower edge */ - if ((area->v4->editflag && area->v1->editflag)) { + if (area->v4->editflag && area->v1->editflag) { *smaller = area->v2->vec.y - size_max; *bigger = area->v2->vec.y - size_min; *use_bigger_smaller_snap = true; diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 5df65e596b9..79316361e53 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -150,7 +150,7 @@ static void brush_painter_2d_require_imbuf( { BrushPainterCache *cache = &tile->cache; - if ((cache->use_float != use_float)) { + if (cache->use_float != use_float) { if (cache->ibuf) { IMB_freeImBuf(cache->ibuf); } @@ -1178,8 +1178,8 @@ static ImBuf *paint_2d_lift_clone(ImBuf *ibuf, ImBuf *ibufb, const int *pos) static void paint_2d_convert_brushco(ImBuf *ibufb, const float pos[2], int ipos[2]) { - ipos[0] = (int)floorf((pos[0] - ibufb->x / 2)); - ipos[1] = (int)floorf((pos[1] - ibufb->y / 2)); + ipos[0] = (int)floorf(pos[0] - ibufb->x / 2); + ipos[1] = (int)floorf(pos[1] - ibufb->y / 2); } static void paint_2d_do_making_brush(ImagePaintState *s, diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 9abc3c5112e..c6eefb0b50e 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -2459,7 +2459,7 @@ static void wpaint_do_symmetrical_brush_actions( /* symm is a bit combination of XYZ - 1 is mirror * X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */ for (i = 1; i <= symm; i++) { - if ((symm & i && (symm != 5 || i != 3) && (symm != 6 || (!ELEM(i, 3, 5))))) { + if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (!ELEM(i, 3, 5)))) { cache->mirror_symmetry_pass = i; cache->radial_symmetry_pass = 0; SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc index a284d1608cb..707de6755b3 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc @@ -73,8 +73,7 @@ static bool vertex_paint_from_weight(Object *ob) using namespace blender; Mesh *me; - if (((me = BKE_mesh_from_object(ob)) == nullptr || - (ED_mesh_color_ensure(me, nullptr)) == false)) { + if ((me = BKE_mesh_from_object(ob)) == nullptr || (ED_mesh_color_ensure(me, nullptr)) == false) { return false; } 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 ac16631f115..22346434ed5 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c @@ -203,7 +203,7 @@ BLI_INLINE float wval_screen(float weight, float paintval, float fac) return weight; } mfac = 1.0f - fac; - temp = max_ff(1.0f - (((1.0f - weight) * (1.0f - paintval))), 0); + temp = max_ff(1.0f - ((1.0f - weight) * (1.0f - paintval)), 0); return mfac * weight + temp * fac; } BLI_INLINE float wval_hardlight(float weight, float paintval, float fac) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 688573d78a6..eb4cc9fd866 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3029,7 +3029,7 @@ void SCULPT_calc_brush_plane( int SCULPT_plane_trim(const StrokeCache *cache, const Brush *brush, const float val[3]) { return (!(brush->flag & BRUSH_PLANE_TRIM) || - ((dot_v3v3(val, val) <= cache->radius_squared * cache->plane_trim_squared))); + (dot_v3v3(val, val) <= cache->radius_squared * cache->plane_trim_squared)); } int SCULPT_plane_point_side(const float co[3], const float plane[4]) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 3f671fd44a1..f7fd910d6e9 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -112,10 +112,10 @@ static void clamp_to_filelist(int numfiles, FileSelection *sel) } /* clamp */ - if ((sel->first >= numfiles)) { + if (sel->first >= numfiles) { sel->first = numfiles - 1; } - if ((sel->last >= numfiles)) { + if (sel->last >= numfiles) { sel->last = numfiles - 1; } } diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 20c74f04319..2f3eaf87836 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -987,7 +987,7 @@ void filelist_setfilter_options(FileList *filelist, filelist->filter_data.filter_glob, filter_glob, sizeof(filelist->filter_data.filter_glob)); update = true; } - if ((BLI_strcmp_ignore_pad(filelist->filter_data.filter_search, filter_search, '*') != 0)) { + if (BLI_strcmp_ignore_pad(filelist->filter_data.filter_search, filter_search, '*') != 0) { BLI_strncpy_ensure_pad(filelist->filter_data.filter_search, filter_search, '*', diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 1434f204ee5..75c1e958e32 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -221,7 +221,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region) v2d->tot.xmax += 10.0f; } - if (((sipo->flag & SIPO_NODRAWCURSOR) == 0)) { + if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) { uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index fa0fdb01bdf..c1ac5b7e7ef 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -383,7 +383,7 @@ bool ED_image_slot_cycle(struct Image *image, int direction) image->render_slot = ((cur == 1) ? 0 : 1); } - if ((cur != image->render_slot)) { + if (cur != image->render_slot) { BKE_image_partial_update_mark_full_update(image); } return (cur != image->render_slot); diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc index 0aa35069c1e..fb744071a8e 100644 --- a/source/blender/editors/space_info/info_stats.cc +++ b/source/blender/editors/space_info/info_stats.cc @@ -375,7 +375,7 @@ static void stats_update(Depsgraph *depsgraph, else { /* Skip hidden objects in local view that are not in edit-mode, * an exception for edit-mode, in most other modes these would be considered hidden. */ - if ((v3d_local && !BKE_object_is_visible_in_viewport(v3d_local, ob_iter))) { + if (v3d_local && !BKE_object_is_visible_in_viewport(v3d_local, ob_iter)) { continue; } } @@ -394,7 +394,7 @@ static void stats_update(Depsgraph *depsgraph, } else { /* See comment for edit-mode. */ - if ((v3d_local && !BKE_object_is_visible_in_viewport(v3d_local, ob_iter))) { + if (v3d_local && !BKE_object_is_visible_in_viewport(v3d_local, ob_iter)) { continue; } } diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 15079448317..6f8677e8370 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -244,8 +244,8 @@ static void do_outliner_object_select_recursive(const Scene *scene, BKE_view_layer_synced_ensure(scene, view_layer); LISTBASE_FOREACH (Base *, base, BKE_view_layer_object_bases_get(view_layer)) { Object *ob = base->object; - if ((((base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) != 0) && - BKE_object_is_child_recursive(ob_parent, ob))) { + if (((base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) != 0) && + BKE_object_is_child_recursive(ob_parent, ob)) { ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT); } } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index dd6d58ee5a2..719332046b3 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -564,7 +564,7 @@ static const EnumPropertyItem *strip_new_sequencer_enum_itemf(bContext *C, else { Scene *scene = CTX_data_scene(C); Sequence *seq = SEQ_select_active_get(scene); - if ((seq && (seq->type == SEQ_TYPE_SCENE) && (seq->scene != NULL))) { + if (seq && (seq->type == SEQ_TYPE_SCENE) && (seq->scene != NULL)) { has_scene_or_no_context = true; } } diff --git a/source/blender/editors/space_sequencer/sequencer_channels_draw.c b/source/blender/editors/space_sequencer/sequencer_channels_draw.c index 81fc87598f8..8abd7e424d1 100644 --- a/source/blender/editors/space_sequencer/sequencer_channels_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_channels_draw.c @@ -78,7 +78,7 @@ static float icon_width_get(const SeqChannelDrawContext *context) static float widget_y_offset(const SeqChannelDrawContext *context) { - return (((context->channel_height / context->scale) - icon_width_get(context))) / 2; + return ((context->channel_height / context->scale) - icon_width_get(context)) / 2; } static float channel_index_y_min(const SeqChannelDrawContext *context, const int index) diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index af0aa093e40..a1dd9ce2ac2 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -615,7 +615,7 @@ static void vectorscope_put_cross(uchar r, uchar g, uchar b, char *tgt, int w, i rgb[2] = (float)b / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int)(yuv[2] * (h - 3) + 1) + (int)(yuv[1] * (w - 3) + 1)); if (r == 0 && g == 0 && b == 0) { r = 255; @@ -667,7 +667,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf) rgb[2] = (float)src1[2] / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int)(yuv[2] * (h - 3) + 1) + (int)(yuv[1] * (w - 3) + 1)); scope_put_pixel(wtable, (uchar *)p); } } @@ -713,7 +713,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int)((yuv[2] * (h - 3) + 1)) + (int)((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int)(yuv[2] * (h - 3) + 1) + (int)(yuv[1] * (w - 3) + 1)); scope_put_pixel(wtable, (uchar *)p); } } diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 4aaa3aeb2ff..fde8bc16f6b 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -973,7 +973,7 @@ static int sequencer_select_exec(bContext *C, wmOperator *op) bool changed = false; /* Deselect everything */ - if (deselect_all || (seq && ((extend == false && deselect == false && toggle == false)))) { + if (deselect_all || (seq && (extend == false && deselect == false && toggle == false))) { ED_sequencer_deselect_all(scene); changed = true; } diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c index a11b5663620..862ddc803e2 100644 --- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c +++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c @@ -374,7 +374,7 @@ static int sequencer_thumbnail_closest_guaranteed_frame_get(struct Scene *scene, /* Set of "guaranteed" thumbnails. */ const int frame_index = timeline_frame - SEQ_time_left_handle_frame_get(scene, seq); const int frame_step = SEQ_render_thumbnails_guaranteed_set_frame_step_get(scene, seq); - const int relative_base_frame = round_fl_to_int((frame_index / (float)frame_step)) * frame_step; + const int relative_base_frame = round_fl_to_int(frame_index / (float)frame_step) * frame_step; const int nearest_guaranted_absolute_frame = relative_base_frame + SEQ_time_left_handle_frame_get(scene, seq); return nearest_guaranted_absolute_frame; diff --git a/source/blender/editors/space_view3d/space_view3d.cc b/source/blender/editors/space_view3d/space_view3d.cc index 40504801f67..418330d1e70 100644 --- a/source/blender/editors/space_view3d/space_view3d.cc +++ b/source/blender/editors/space_view3d/space_view3d.cc @@ -641,7 +641,7 @@ static bool view3d_ima_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event static bool view3d_ima_bg_is_camera_view(bContext *C) { RegionView3D *rv3d = CTX_wm_region_view3d(C); - if ((rv3d && (rv3d->persp == RV3D_CAMOB))) { + if (rv3d && (rv3d->persp == RV3D_CAMOB)) { View3D *v3d = CTX_wm_view3d(C); if (v3d && v3d->camera && v3d->camera->type == OB_CAMERA) { return true; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 6001f701c00..23e06c895fc 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -300,7 +300,7 @@ static int render_border_exec(bContext *C, wmOperator *op) } /* drawing a border outside the camera view switches off border rendering */ - if ((border.xmin == border.xmax || border.ymin == border.ymax)) { + if (border.xmin == border.xmax || border.ymin == border.ymax) { if (rv3d->persp == RV3D_CAMOB) { scene->r.mode &= ~R_BORDER; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index 41af24977db..22ab6636c47 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -267,7 +267,7 @@ static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *g icon_offset_from_axis = icon_offset * 2.1f; break; case USER_MINI_AXIS_TYPE_MINIMAL: - icon_offset_from_axis = (UI_UNIT_X * 2.5) + ((U.rvisize * U.pixelsize * 2.0f)); + icon_offset_from_axis = (UI_UNIT_X * 2.5) + (U.rvisize * U.pixelsize * 2.0f); break; case USER_MINI_AXIS_TYPE_NONE: icon_offset_from_axis = icon_offset_mini * 0.75f; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c index d0f6ca4c922..73617c0670f 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c @@ -129,7 +129,7 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); BKE_view_layer_synced_ensure(scene, view_layer); - if (((gz_ele->bases)) == NULL || + if ((gz_ele->bases) == NULL || (gz_ele->bases[0] != BKE_view_layer_active_base_get(view_layer))) { MEM_SAFE_FREE(gz_ele->bases); gz_ele->bases = BKE_view_layer_array_from_bases_in_edit_mode( @@ -358,7 +358,7 @@ static int gizmo_preselect_edgering_test_select(bContext *C, wmGizmo *gz, const ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); BKE_view_layer_synced_ensure(scene, view_layer); - if (((gz_ring->bases)) == NULL || + if ((gz_ring->bases) == NULL || (gz_ring->bases[0] != BKE_view_layer_active_base_get(view_layer))) { MEM_SAFE_FREE(gz_ring->bases); gz_ring->bases = BKE_view_layer_array_from_bases_in_edit_mode( diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c index b27c65c42ef..25073d02a7f 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.c +++ b/source/blender/editors/space_view3d/view3d_navigate.c @@ -916,15 +916,15 @@ static int viewselected_exec(bContext *C, wmOperator *op) if (gps->editcurve != NULL) { for (int i = 0; i < gps->editcurve->tot_curve_points; i++) { BezTriple *bezt = &gps->editcurve->curve_points[i].bezt; - if ((bezt->f1 & SELECT)) { + if (bezt->f1 & SELECT) { minmax_v3v3_v3(min, max, bezt->vec[0]); ok = true; } - if ((bezt->f2 & SELECT)) { + if (bezt->f2 & SELECT) { minmax_v3v3_v3(min, max, bezt->vec[1]); ok = true; } - if ((bezt->f3 & SELECT)) { + if (bezt->f3 & SELECT) { minmax_v3v3_v3(min, max, bezt->vec[2]); ok = true; } diff --git a/source/blender/editors/space_view3d/view3d_navigate_ndof.c b/source/blender/editors/space_view3d/view3d_navigate_ndof.c index 88abf602c26..22b3a4b968e 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_ndof.c +++ b/source/blender/editors/space_view3d/view3d_navigate_ndof.c @@ -363,7 +363,7 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event) ED_view3d_smooth_view_force_finish(C, v3d, region); - if ((v3d->camera && (rv3d->persp == RV3D_CAMOB) && (v3d->flag2 & V3D_LOCK_CAMERA) == 0)) { + if (v3d->camera && (rv3d->persp == RV3D_CAMOB) && (v3d->flag2 & V3D_LOCK_CAMERA) == 0) { /* pass */ } else { diff --git a/source/blender/editors/space_view3d/view3d_placement.c b/source/blender/editors/space_view3d/view3d_placement.c index d3b82476d09..7588ad8d2c1 100644 --- a/source/blender/editors/space_view3d/view3d_placement.c +++ b/source/blender/editors/space_view3d/view3d_placement.c @@ -585,13 +585,13 @@ static void draw_primitive_view_impl(const struct bContext *C, } else if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CYLINDER) { draw_circle_in_quad(UNPACK4(bounds.vec), 32, color); - draw_circle_in_quad(UNPACK4((&bounds.vec[4])), 32, color); + draw_circle_in_quad(UNPACK4(&bounds.vec[4]), 32, color); } else if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CONE) { draw_circle_in_quad(UNPACK4(bounds.vec), 32, color); float center[3]; - mid_v3_v3v3v3v3(center, UNPACK4((&bounds.vec[4]))); + mid_v3_v3v3v3v3(center, UNPACK4(&bounds.vec[4])); float coords_a[4][3]; float coords_b[4][3]; diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index a0b3802076a..9a2512adc31 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -1527,7 +1527,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) changed = true; } - if ((oldbasact != basact)) { + if (oldbasact != basact) { ED_object_base_activate(C, basact); } diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index ddc99caeef5..090f1bf1e6c 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -94,7 +94,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_count, int *r_flag) int left = SEQ_time_left_handle_frame_get(scene, seq); int right = SEQ_time_right_handle_frame_get(scene, seq); - if (((seq->flag & SELECT) == 0 || SEQ_transform_is_locked(channels, seq))) { + if ((seq->flag & SELECT) == 0 || SEQ_transform_is_locked(channels, seq)) { *r_count = 0; *r_flag = 0; } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 03c53e1b3d2..301eac4536e 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -317,7 +317,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } /* initialize UV transform from */ - if (op && ((prop = RNA_struct_find_property(op->ptr, "correct_uv")))) { + if (op && (prop = RNA_struct_find_property(op->ptr, "correct_uv"))) { if (RNA_property_is_set(op->ptr, prop)) { if (RNA_property_boolean_get(op->ptr, prop)) { t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT_SLIDE; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 31d36fc4d92..a3effa32072 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -809,7 +809,7 @@ static void initSnappingMode(TransInfo *t) (bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled, bm_edge_is_snap_target, bm_face_is_snap_target, - POINTER_FROM_UINT((BM_ELEM_SELECT | BM_ELEM_HIDDEN))); + POINTER_FROM_UINT(BM_ELEM_SELECT | BM_ELEM_HIDDEN)); } else { /* Ignore hidden geometry in the general case. */ |