From aa2d84da37c909fa6b0ed03b54b0a3bc880f00a6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Sep 2012 00:00:21 +0000 Subject: style cleanup: also remove some redundant conversions int -> short -> int --- source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/blender.c | 9 +++- source/blender/blenkernel/intern/constraint.c | 4 +- source/blender/editors/gpencil/drawgpencil.c | 8 +-- source/blender/editors/gpencil/gpencil_paint.c | 9 ++-- source/blender/editors/interface/interface.c | 5 +- .../blender/editors/interface/interface_handlers.c | 4 +- source/blender/editors/interface/interface_icons.c | 2 +- source/blender/editors/interface/view2d.c | 6 +-- source/blender/editors/interface/view2d_ops.c | 12 ++--- source/blender/editors/mesh/editface.c | 4 +- source/blender/editors/object/object_constraint.c | 12 ++--- source/blender/editors/object/object_relations.c | 2 +- source/blender/editors/object/object_vgroup.c | 4 +- source/blender/editors/screen/screen_edit.c | 2 +- source/blender/editors/sculpt_paint/paint_vertex.c | 10 ++-- .../blender/editors/space_action/action_select.c | 8 +-- source/blender/editors/space_graph/graph_draw.c | 18 +++---- source/blender/editors/space_graph/graph_select.c | 2 +- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_logic/logic_window.c | 24 ++++++--- source/blender/editors/space_nla/nla_select.c | 8 +-- source/blender/editors/space_node/node_edit.c | 2 +- .../blender/editors/space_outliner/outliner_draw.c | 4 +- .../blender/editors/space_outliner/outliner_tree.c | 6 +-- .../editors/space_sequencer/sequencer_edit.c | 8 +-- source/blender/editors/space_view3d/drawarmature.c | 33 ++++++------ source/blender/editors/space_view3d/drawobject.c | 60 +++++++++++----------- source/blender/editors/space_view3d/view3d_edit.c | 12 ++--- .../blender/editors/space_view3d/view3d_header.c | 6 ++- .../blender/editors/space_view3d/view3d_select.c | 6 +-- source/blender/editors/space_view3d/view3d_view.c | 2 +- 32 files changed, 159 insertions(+), 137 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 6a8ddd8e00a..3e5dff74f3b 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -810,7 +810,7 @@ void framechange_poses_clear_unkeyed(void) /* TODO: proxies may/may not be correctly handled here... (this needs checking) */ for (ob = G.main->object.first; ob; ob = ob->id.next) { /* we only need to do this on objects with a pose */ - if ( (pose = ob->pose) ) { + if ((pose = ob->pose)) { for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->bone) pchan->bone->flag &= ~BONE_UNKEYED; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index d5c2baea6fb..04b135df798 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -513,8 +513,13 @@ void BKE_write_undo(bContext *C, const char *name) int nr /*, success */ /* UNUSED */; UndoElem *uel; - if ( (U.uiflag & USER_GLOBALUNDO) == 0) return; - if (U.undosteps == 0) return; + if ((U.uiflag & USER_GLOBALUNDO) == 0) { + return; + } + + if (U.undosteps == 0) { + return; + } /* remove all undos after (also when curundo == NULL) */ while (undobase.last != curundo) { diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 391891d3985..8d7f4e4117a 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -4292,8 +4292,8 @@ bConstraintTypeInfo *get_constraint_typeinfo(int type) } /* only return for valid types */ - if ( (type >= CONSTRAINT_TYPE_NULL) && - (type < NUM_CONSTRAINT_TYPES) ) + if ((type >= CONSTRAINT_TYPE_NULL) && + (type < NUM_CONSTRAINT_TYPES)) { /* there shouldn't be any segfaults here... */ return constraintsTypeInfo[type]; diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 7906d632f86..5a94d54f329 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -177,8 +177,8 @@ static void gp_draw_stroke_point(bGPDspoint *points, short thickness, short dfla /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok * - also mandatory in if Image Editor 'image-based' dot */ - if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) || - ((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE)) ) + if ((thickness < GP_DRAWTHICKNESS_SPECIAL) || + ((dflag & GP_DRAWDATA_IEDITHACK) && (sflag & GP_STROKE_2DSPACE))) { glBegin(GL_POINTS); glVertex2fv(co); @@ -253,8 +253,8 @@ static void gp_draw_stroke(bGPDspoint *points, int totpoints, short thickness_s, /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better * - 'smooth' opengl lines are also required if Image Editor 'image-based' stroke */ - if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) || - ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D)) ) + if ((thickness < GP_DRAWTHICKNESS_SPECIAL) || + ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D))) { bGPDspoint *pt; int i; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e4bfbea75b0..dfd2783fad6 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -778,7 +778,8 @@ static short gp_stroke_eraser_splitdel(bGPDframe *gpf, bGPDstroke *gps, int i) } /* eraser tool - check if part of stroke occurs within last segment drawn by eraser */ -static short gp_stroke_eraser_strokeinside(int mval[], int UNUSED(mvalo[]), short rad, short x0, short y0, short x1, short y1) +static short gp_stroke_eraser_strokeinside(const int mval[], const int UNUSED(mvalo[]), + int rad, int x0, int y0, int x1, int y1) { /* simple within-radius check for now */ if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1)) @@ -790,7 +791,9 @@ static short gp_stroke_eraser_strokeinside(int mval[], int UNUSED(mvalo[]), shor /* eraser tool - evaluation per stroke */ // TODO: this could really do with some optimization (KD-Tree/BVH?) -static void gp_stroke_eraser_dostroke(tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps) +static void gp_stroke_eraser_dostroke(tGPsdata *p, + const int mval[], const int mvalo[], + short rad, const rcti *rect, bGPDframe *gpf, bGPDstroke *gps) { bGPDspoint *pt1, *pt2; int x0 = 0, y0 = 0, x1 = 0, y1 = 0; @@ -827,7 +830,7 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p, int mval[], int mvalo[], shor /* do boundbox check first */ if (BLI_rcti_isect_pt(rect, x0, y0)) { /* only check if point is inside */ - if ( ((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) { + if (((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) { /* free stroke */ MEM_freeN(gps->points); BLI_freelinkN(&gpf->strokes, gps); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f97b9864539..4aece1ad8c8 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1242,8 +1242,7 @@ void ui_delete_linkline(uiLinkLine *line, uiBut *but) else { b = 0; for (a = 0; a < (*(link->totlink)); a++) { - - if ( (*(link->ppoin))[a] != line->to->poin) { + if ((*(link->ppoin))[a] != line->to->poin) { (*(link->ppoin))[b] = (*(link->ppoin))[a]; b++; } @@ -2468,7 +2467,7 @@ static void ui_block_do_align_but(uiBut *first, short nr) flag |= UI_BUT_ALIGN_TOP; } - if ( (flag & UI_BUT_ALIGN_TOP) == 0) { /* stil top row */ + if ((flag & UI_BUT_ALIGN_TOP) == 0) { /* stil top row */ if (prev) { if (next && buts_are_horiz(but, next)) flag = UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index dcd652a6590..b0f04792f90 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -755,7 +755,7 @@ static void ui_delete_active_linkline(uiBlock *block) b = 0; for (a = 0; a < (*(link->totlink)); a++) { - if ( (*(link->ppoin))[a] != line->to->poin) { + if ((*(link->ppoin))[a] != line->to->poin) { (*(link->ppoin))[b] = (*(link->ppoin))[a]; b++; } @@ -866,7 +866,7 @@ static void ui_add_link(bContext *C, uiBut *from, uiBut *to) void **oldppoin; int a; - if ( (line = ui_is_a_link(from, to)) ) { + if ((line = ui_is_a_link(from, to))) { line->flag |= UI_SELECT; ui_delete_active_linkline(from->block); return; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 1871f3c8336..e825ff7880d 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -620,7 +620,7 @@ static void init_iconfile_list(struct ListBase *list) if (restoredir && !chdir(olddir)) {} /* fix warning about checking return value */ for (i = 0; i < totfile; i++) { - if ( (dir[i].type & S_IFREG) ) { + if ((dir[i].type & S_IFREG)) { char *filename = dir[i].relname; if (BLI_testextensie(filename, ".png")) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index c3059b8d575..0f1d1a24dcb 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -544,7 +544,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) curheight = BLI_RCT_SIZE_Y(cur); /* width */ - if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_X | V2D_LIMITZOOM)) ) { + if ((curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_X | V2D_LIMITZOOM))) { /* if zoom doesn't have to be maintained, just clamp edges */ if (cur->xmin < tot->xmin) cur->xmin = tot->xmin; if (cur->xmax > tot->xmax) cur->xmax = tot->xmax; @@ -627,7 +627,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) } /* height */ - if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_Y | V2D_LIMITZOOM)) ) { + if ((curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM | V2D_LOCKZOOM_Y | V2D_LIMITZOOM))) { /* if zoom doesn't have to be maintained, just clamp edges */ if (cur->ymin < tot->ymin) cur->ymin = tot->ymin; if (cur->ymax > tot->ymax) cur->ymax = tot->ymax; @@ -1874,7 +1874,7 @@ void UI_view2d_listview_view_to_cell(View2D *v2d, short columnwidth, short rowhe const int y = (int)(floorf(fabsf(viewy) + 0.5f) - starty); /* sizes must not be negative */ - if ( (v2d == NULL) || ((columnwidth <= 0) && (rowheight <= 0)) ) { + if ((v2d == NULL) || ((columnwidth <= 0) && (rowheight <= 0))) { if (column) *column = 0; if (row) *row = 0; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 5b19bb2d3c9..99313edc289 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1719,8 +1719,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) * NOTE: see view2d.c for latest conditions, and keep this in sync with that */ if (ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) { - if ( ((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) == 0) || - ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) == 0) ) + if (((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) == 0) || + ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) == 0)) { /* switch to bar (i.e. no scaling gets handled) */ vsm->zone = SCROLLHANDLE_BAR; @@ -1729,8 +1729,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) /* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */ if (vsm->zone == SCROLLHANDLE_BAR) { - if ( ((vsm->scroller == 'h') && (v2d->keepofs & V2D_LOCKOFS_X)) || - ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y)) ) + if (((vsm->scroller == 'h') && (v2d->keepofs & V2D_LOCKOFS_X)) || + ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y))) { /* free customdata initialized */ scroller_activate_exit(C, op); @@ -1741,8 +1741,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* zone is also inappropriate if scroller is not visible... */ - if ( ((vsm->scroller == 'h') && (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_HORIZONTAL_FULLR))) || - ((vsm->scroller == 'v') && (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE | V2D_SCROLL_VERTICAL_FULLR))) ) + if (((vsm->scroller == 'h') && (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_HORIZONTAL_FULLR))) || + ((vsm->scroller == 'v') && (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE | V2D_SCROLL_VERTICAL_FULLR))) ) { /* free customdata initialized */ scroller_activate_exit(C, op); diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 4e30cff5fde..94e10b53b29 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -137,10 +137,10 @@ void paintface_hide(Object *ob, const int unselected) while (a--) { if ((mpoly->flag & ME_HIDE) == 0) { if (unselected) { - if ( (mpoly->flag & ME_FACE_SEL) == 0) mpoly->flag |= ME_HIDE; + if ((mpoly->flag & ME_FACE_SEL) == 0) mpoly->flag |= ME_HIDE; } else { - if ( (mpoly->flag & ME_FACE_SEL)) mpoly->flag |= ME_HIDE; + if ((mpoly->flag & ME_FACE_SEL)) mpoly->flag |= ME_HIDE; } } if (mpoly->flag & ME_HIDE) mpoly->flag &= ~ME_FACE_SEL; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 08ba6a1e682..1ef7c12b409 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1392,9 +1392,9 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o /* just use the first object we encounter (that isn't the active object) * and which fulfills the criteria for the object-target that we've got */ - if ( (ob != obact) && - ((!only_curve) || (ob->type == OB_CURVE)) && - ((!only_mesh) || (ob->type == OB_MESH)) ) + if ((ob != obact) && + ((!only_curve) || (ob->type == OB_CURVE)) && + ((!only_mesh) || (ob->type == OB_MESH))) { /* set target */ *tar_ob = ob; @@ -1478,15 +1478,15 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase if (type == CONSTRAINT_TYPE_NULL) { return OPERATOR_CANCELLED; } - if ( (type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints) ) { + if ((type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints)) { BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects"); return OPERATOR_CANCELLED; } - if ( (type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints)) ) { + if ((type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints))) { BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones"); return OPERATOR_CANCELLED; } - if ( (type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints)) ) { + if ((type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints))) { BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index d8c964ff2df..cafc7ce9300 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1518,7 +1518,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag) */ ob->id.newid = NULL; - if ( (base->flag & flag) == flag) { + if ((base->flag & flag) == flag) { if (ob->id.lib == NULL && ob->id.us > 1) { /* base gets copy of object */ obn = BKE_object_copy(ob); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index c8ba9240db3..b31d2b8b076 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1542,8 +1542,8 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v int *flip_map, flip_map_len; const int def_nr = ob->actdef - 1; - if ( (mirror_weights == 0 && flip_vgroups == 0) || - (BLI_findlink(&ob->defbase, def_nr) == NULL) ) + if ((mirror_weights == 0 && flip_vgroups == 0) || + (BLI_findlink(&ob->defbase, def_nr) == NULL)) { return; } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index adffb97c16f..3642cc0d8d4 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1471,7 +1471,7 @@ void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene) /* are there cameras in the views that are not in the scene? */ for (sc = CTX_data_main(C)->screen.first; sc; sc = sc->id.next) { - if ( (U.flag & USER_SCENEGLOBAL) || sc == screen) { + if ((U.flag & USER_SCENEGLOBAL) || sc == screen) { ScrArea *sa = sc->areabase.first; while (sa) { SpaceLink *sl = sa->spacedata.first; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index c52bae215ec..ba440e98290 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1639,9 +1639,9 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, dv_test.totweight = dv->totweight; /* do not multi-paint if a locked group is selected or the active group is locked * !lock_flags[dw->def_nr] helps if nothing is selected, but active group is locked */ - if ( (wpi->lock_flags == NULL) || - ((wpi->lock_flags[dw->def_nr] == FALSE) && /* def_nr range has to be checked for by caller */ - has_locked_group_selected(wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags) == FALSE)) + if ((wpi->lock_flags == NULL) || + ((wpi->lock_flags[dw->def_nr] == FALSE) && /* def_nr range has to be checked for by caller */ + has_locked_group_selected(wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags) == FALSE)) { if (wpi->do_multipaint && wpi->defbase_tot_sel > 1) { if (change && change != 1) { @@ -1787,8 +1787,8 @@ static void do_weight_paint_vertex( /* If there are no locks or multipaint, * then there is no need to run the more complicated checks */ - if ( (do_multipaint_totsel == FALSE) && - (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE)) + if ((do_multipaint_totsel == FALSE) && + (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE)) { dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip, FALSE); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index c9f765ac3db..9ab79d73e76 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -255,8 +255,8 @@ static void borderselect_action(bAnimContext *ac, rcti rect, short mode, short s } /* perform vertical suitability check (if applicable) */ - if ( (mode == ACTKEYS_BORDERSEL_FRAMERANGE) || - !((ymax < rectf.ymin) || (ymin > rectf.ymax)) ) + if ((mode == ACTKEYS_BORDERSEL_FRAMERANGE) || + !((ymax < rectf.ymin) || (ymin > rectf.ymax))) { /* loop over data selecting */ if (ale->type == ANIMTYPE_GPLAYER) @@ -802,8 +802,8 @@ static void actkeys_select_leftright(bAnimContext *ac, short leftright, short se TimeMarker *marker; for (marker = markers->first; marker; marker = marker->next) { - if ( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) || - ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) ) + if (((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) || + ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA))) { marker->flag |= SELECT; } diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index ad97b7853c4..e4bda15bc7d 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -235,7 +235,7 @@ static void draw_fcurve_vertices_handles(FCurve *fcu, SpaceIpo *sipo, View2D *v2 * if a Graph Editor option to only show handles of selected keys is on. */ if (!sel_handle_only || BEZSELECTED(bezt) ) { - if ( (!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ)) ) { + if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) { if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/ draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize); } @@ -378,8 +378,8 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu) } else { /* only draw first handle if previous segment was had handles, and selection is ok */ - if ( ((bezt->f1 & SELECT) == sel) && - ( (!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ)) ) ) + if (((bezt->f1 & SELECT) == sel) && + ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ)))) { fp = bezt->vec[0]; UI_GetThemeColor3ubv(basecol + bezt->h1, col); @@ -390,8 +390,8 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu) } /* only draw second handle if this segment is bezier, and selection is ok */ - if ( ((bezt->f3 & SELECT) == sel) && - (bezt->ipo == BEZT_IPO_BEZ) ) + if (((bezt->f3 & SELECT) == sel) && + (bezt->ipo == BEZT_IPO_BEZ)) { fp = bezt->vec[1]; UI_GetThemeColor3ubv(basecol + bezt->h2, col); @@ -846,11 +846,11 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid /* 1) draw curve line */ { /* set color/drawing style for curve itself */ - if ( ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || (fcu->flag & FCURVE_PROTECTED) ) { + if (((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || (fcu->flag & FCURVE_PROTECTED)) { /* protected curves (non editable) are drawn with dotted lines */ setlinestyle(2); } - if ( ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) || (fcu->flag & FCURVE_MUTED) ) { + if (((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) || (fcu->flag & FCURVE_MUTED)) { /* muted curves are drawn in a grayish hue */ // XXX should we have some variations? UI_ThemeColorShade(TH_HEADER, 50); @@ -878,7 +878,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid */ draw_fcurve_curve(ac, ale->id, fcu, &ar->v2d, grid); } - else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) { + else if (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert)) { /* just draw curve based on defined data (i.e. no modifiers) */ if (fcu->bezt) draw_fcurve_curve_bezts(ac, ale->id, fcu, &ar->v2d); @@ -908,7 +908,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid } } } - else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) { + else if (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert)) { /* apply unit mapping */ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, fcu, 0); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 32abad86828..633f2b72cf6 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -942,7 +942,7 @@ static void nearest_fcurve_vert_store(ListBase *matches, View2D *v2d, FCurve *fc /* if there is already a point for the F-Curve, check if this point is closer than that was */ if ((nvi) && (nvi->fcu == fcu)) { /* replace if we are closer, or if equal and that one wasn't selected but we are... */ - if ( (nvi->dist > dist) || ((nvi->sel == 0) && BEZSELECTED(bezt)) ) + if ((nvi->dist > dist) || ((nvi->sel == 0) && BEZSELECTED(bezt))) replace = 1; } /* add new if not replacing... */ diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 3eeae1f16de..8d9d1be61e5 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1160,7 +1160,7 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, /* check for empty path */ if (guess_path && simopts->filepath[0] == 0) { - if ( (G.ima[0] == '/') && (G.ima[1] == '/') && (G.ima[2] == '\0') ) { + if ((G.ima[0] == '/') && (G.ima[1] == '/') && (G.ima[2] == '\0')) { BLI_strncpy(simopts->filepath, "//untitled", FILE_MAX); } else { diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 12823de60d2..a042145309d 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -878,7 +878,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf } /* 4th case: select actuator when controller selected */ - if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { + if ((scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { cont= ob->controllers.first; while (cont) { for (a=0; atotlinks; a++) { @@ -921,7 +921,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf } while (ob) { - if ( (ob->scavisflag) && (ob != obact)) { + if ((ob->scavisflag) && (ob != obact)) { idar[nr]= (ID *)ob; nr++; } @@ -4539,7 +4539,9 @@ static void logic_buttons_new(bContext *C, ARegion *ar) ob= (Object *)idar[a]; /* only draw the controller common header if "use_visible" */ - if ( (ob->scavisflag & OB_VIS_CONT) == 0) continue; + if ( (ob->scavisflag & OB_VIS_CONT) == 0) { + continue; + } /* Drawing the Controller Header common to all Selected Objects */ @@ -4707,7 +4709,9 @@ static void logic_buttons_new(bContext *C, ARegion *ar) ob= (Object *)idar[a]; /* only draw the actuator common header if "use_visible" */ - if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue; + if ((ob->scavisflag & OB_VIS_ACT) == 0) { + continue; + } row = uiLayoutRow(layout, TRUE); uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); @@ -4834,7 +4838,9 @@ void logic_buttons(bContext *C, ARegion *ar) ob= (Object *)idar[a]; // uiClearButLock(); // uiSetButLock(BKE_object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - if ( (ob->scavisflag & OB_VIS_CONT) == 0) continue; + if ((ob->scavisflag & OB_VIS_CONT) == 0) { + continue; + } /* presume it is only objects for now */ uiBlockBeginAlign(block); @@ -4972,7 +4978,9 @@ void logic_buttons(bContext *C, ARegion *ar) // uiClearButLock(); // uiSetButLock(BKE_object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - if ( (ob->scavisflag & OB_VIS_SENS) == 0) continue; + if ((ob->scavisflag & OB_VIS_SENS) == 0) { + continue; + } /* presume it is only objects for now */ uiBlockBeginAlign(block); @@ -5052,7 +5060,9 @@ void logic_buttons(bContext *C, ARegion *ar) ob= (Object *)idar[a]; // uiClearButLock(); // uiSetButLock(BKE_object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue; + if ((ob->scavisflag & OB_VIS_ACT) == 0) { + continue; + } /* presume it is only objects for now */ uiBlockBeginAlign(block); diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index e7610210881..222c2414fcb 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -245,8 +245,8 @@ static void borderselect_nla_strips(bAnimContext *ac, rcti rect, short mode, sho ymin = ymax - NLACHANNEL_STEP(snla); /* perform vertical suitability check (if applicable) */ - if ( (mode == NLA_BORDERSEL_FRAMERANGE) || - !((ymax < rectf.ymin) || (ymin > rectf.ymax)) ) + if ((mode == NLA_BORDERSEL_FRAMERANGE) || + !((ymax < rectf.ymin) || (ymin > rectf.ymax))) { /* loop over data selecting (only if NLA-Track) */ if (ale->type == ANIMTYPE_NLATRACK) { @@ -255,8 +255,8 @@ static void borderselect_nla_strips(bAnimContext *ac, rcti rect, short mode, sho /* only select strips if they fall within the required ranges (if applicable) */ for (strip = nlt->strips.first; strip; strip = strip->next) { - if ( (mode == NLA_BORDERSEL_CHANNELS) || - BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax)) + if ((mode == NLA_BORDERSEL_CHANNELS) || + BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax)) { /* set selection */ ACHANNEL_SET_FLAG(strip, selectmode, NLASTRIP_FLAG_SELECT); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 90ad1452356..9e04bd36a1f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1459,7 +1459,7 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) if (toggle_flag == NODE_OPTIONS && (node->typeinfo->flag & NODE_OPTIONS) == 0) continue; - if ( (tot_eq && tot_neq) || tot_eq == 0) + if ((tot_eq && tot_neq) || tot_eq == 0) node->flag |= toggle_flag; else node->flag &= ~toggle_flag; diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 42fdd5173d4..21e06f00d8e 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1273,8 +1273,8 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene * we don't expand items when searching in the datablocks but we * still want to highlight any filter matches. */ - if ( (SEARCHING_OUTLINER(soops) || (soops->outlinevis == SO_DATABLOCKS && soops->search_string[0] != 0)) && - (tselem->flag & TSE_SEARCHMATCH)) + if ((SEARCHING_OUTLINER(soops) || (soops->outlinevis == SO_DATABLOCKS && soops->search_string[0] != 0)) && + (tselem->flag & TSE_SEARCHMATCH)) { char col[4]; UI_GetThemeColorType4ubv(TH_MATCH, SPACE_OUTLINER, col); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 63907f530eb..3e1ce1fea6e 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1216,8 +1216,8 @@ static int treesort_obtype_alpha(const void *v1, const void *v2) else { /* 2nd we check ob type */ if (x1->idcode == ID_OB && x2->idcode == ID_OB) { - if ( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1; - else if ( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1; + if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1; + else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1; else return 0; } else { @@ -1243,7 +1243,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb) tselem = TREESTORE(te); /* sorting rules; only object lists or deformgroups */ - if ( (tselem->type == TSE_DEFGROUP) || (tselem->type == 0 && te->idcode == ID_OB)) { + if ((tselem->type == TSE_DEFGROUP) || (tselem->type == 0 && te->idcode == ID_OB)) { /* count first */ for (te = lb->first; te; te = te->next) totelem++; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 5a40c2ce4e7..06b508cc488 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -381,8 +381,8 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[ while (seq) { if (seq->machine == (int)y) { /* check for both normal strips, and strips that have been flipped horizontally */ - if ( ((seq->startdisp < seq->enddisp) && (seq->startdisp <= x && seq->enddisp >= x)) || - ((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) ) + if (((seq->startdisp < seq->enddisp) && (seq->startdisp <= x && seq->enddisp >= x)) || + ((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) ) { if (BKE_sequence_tx_test(seq)) { @@ -2447,7 +2447,7 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child) if (ed == NULL) return NULL; for (seq = ed->seqbasep->first; seq; seq = seq->next) { - if ( (seq != child) && seq_is_parent(seq, child) ) { + if ((seq != child) && seq_is_parent(seq, child)) { parent = seq; break; } @@ -2563,7 +2563,7 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op)) if (se) { // prevent setting the render size if sequence values aren't initialized - if ( (se->orig_width > 0) && (se->orig_height > 0) ) { + if ((se->orig_width > 0) && (se->orig_height > 0)) { scene->r.xsch = se->orig_width; scene->r.ysch = se->orig_height; WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 4472ff280e9..ecce12b8cba 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -272,7 +272,7 @@ static short set_pchan_glColor(short colCode, int boneflag, short constflag) case PCHAN_COLOR_LINEBONE: { /* inner part in background color or constraint */ - if ( (constflag) && ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) ) { + if ((constflag) && ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS))) { if (constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0); else if (constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0); else if (constflag & PCHAN_HAS_SPLINEIK) glColor3ub(200, 255, 0); @@ -1540,7 +1540,7 @@ static void draw_pose_dofs(Object *ob) for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { bone = pchan->bone; - if ( (bone) && !(bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) { + if ((bone != NULL) && !(bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) { if (bone->flag & BONE_SELECTED) { if (bone->layer & arm->layer) { if (pchan->ikflag & (BONE_IK_XLIMIT | BONE_IK_ZLIMIT)) { @@ -1701,8 +1701,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] * NOTE: this is the only case with (NO_DEFORM == 0) flag, as this is for envelope influence drawing */ - if ( (bone->flag & (BONE_HIDDEN_P | BONE_NO_DEFORM | BONE_HIDDEN_PG)) == 0 && - ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) + if (((bone->flag & (BONE_HIDDEN_P | BONE_NO_DEFORM | BONE_HIDDEN_PG)) == 0) && + ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0)) { if (bone->flag & (BONE_SELECTED)) { if (bone->layer & arm->layer) @@ -1732,8 +1732,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, arm->layer_used |= bone->layer; /* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */ - if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 && - ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) + if (((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) && + ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0)) { if (bone->layer & arm->layer) { int use_custom = (pchan->custom) && !(arm->flag & ARM_NO_CUSTOM); @@ -1748,8 +1748,9 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* catch exception for bone with hidden parent */ flag = bone->flag; - if ( (bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) ) + if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG))) { flag &= ~BONE_CONNECTED; + } /* set temporary flag for drawing bone as active, but only if selected */ if (bone == arm->act_bone) @@ -1819,8 +1820,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, bone = pchan->bone; /* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */ - if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 && - ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) + if (((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) && + ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) { if (bone->layer & arm->layer) { if (pchan->custom) { @@ -1895,8 +1896,8 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, arm->layer_used |= bone->layer; /* 1) bone must be visible, 2) for OpenGL select-drawing cannot have unselectable [#27194] */ - if ( (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0 && - ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0) ) + if (((bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0) && + ((G.f & G_PICKSEL) == 0 || (bone->flag & BONE_UNSELECTABLE) == 0)) { if (bone->layer & arm->layer) { const short constflag = pchan->constflag; @@ -1904,7 +1905,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* Draw a line from our root to the parent's tip * - only if V3D_HIDE_HELPLINES is enabled... */ - if ( (do_dashed & 2) && ((bone->flag & BONE_CONNECTED) == 0) ) { + if ((do_dashed & 2) && ((bone->flag & BONE_CONNECTED) == 0)) { if (arm->flag & ARM_POSEMODE) { glLoadName(index & 0xFFFF); /* object tag, for bordersel optim */ UI_ThemeColor(TH_WIRE); @@ -2047,7 +2048,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, } /* Draw additional axes on the bone tail */ - if ( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ) { + if ((arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE)) { glPushMatrix(); copy_m4_m4(bmat, pchan->pose_mat); bone_matrix_translate_y(bmat, pchan->bone->length); @@ -2134,8 +2135,9 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt) /* catch exception for bone with hidden parent */ flag = eBone->flag; - if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent)) + if ((eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent)) { flag &= ~BONE_CONNECTED; + } /* set temporary flag for drawing bone as active, but only if selected */ if (eBone == arm->act_edbone) @@ -2176,8 +2178,9 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt) /* catch exception for bone with hidden parent */ flag = eBone->flag; - if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent)) + if ((eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent)) { flag &= ~BONE_CONNECTED; + } /* set temporary flag for drawing bone as active, but only if selected */ if (eBone == arm->act_edbone) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 9ebd2351142..90da3824870 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2888,7 +2888,7 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d, if (ts->selectmode == SCE_SELECT_FACE) { draw_dm_edges_sel(em, cageDM, wireCol, selCol, actCol, eed_act); } - else if ( (me->drawflag & ME_DRAWEDGES) || (ts->selectmode & SCE_SELECT_EDGE) ) { + else if ((me->drawflag & ME_DRAWEDGES) || (ts->selectmode & SCE_SELECT_EDGE)) { if (cageDM->drawMappedEdgesInterp && (ts->selectmode & SCE_SELECT_VERTEX)) { glShadeModel(GL_SMOOTH); draw_dm_edges_sel_interp(em, cageDM, wireCol, selCol); @@ -3317,8 +3317,8 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, draw_dm_vert_normals(em, scene, ob, cageDM); } - if ( (me->drawflag & (ME_DRAWEXTRA_EDGELEN | ME_DRAWEXTRA_FACEAREA | ME_DRAWEXTRA_FACEANG)) && - !(v3d->flag2 & V3D_RENDER_OVERRIDE)) + if ((me->drawflag & (ME_DRAWEXTRA_EDGELEN | ME_DRAWEXTRA_FACEAREA | ME_DRAWEXTRA_FACEANG)) && + !(v3d->flag2 & V3D_RENDER_OVERRIDE)) { draw_em_measure_stats(v3d, ob, em, &scene->unit); } @@ -3415,14 +3415,14 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D else if (dt == OB_WIRE || totface == 0) { draw_wire = OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */ } - else if ( ((is_obact && ob->mode & OB_MODE_TEXTURE_PAINT)) || - check_object_draw_texture(scene, v3d, dt)) + else if (((is_obact && ob->mode & OB_MODE_TEXTURE_PAINT)) || + check_object_draw_texture(scene, v3d, dt)) { - if ( (v3d->flag & V3D_SELECT_OUTLINE) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (base->flag & SELECT) && - !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) && - (draw_wire == OBDRAW_WIRE_OFF)) + if ((v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + (base->flag & SELECT) && + !(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) && + (draw_wire == OBDRAW_WIRE_OFF)) { draw_mesh_object_outline(v3d, ob, dm); } @@ -3460,11 +3460,11 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D const float spec[4] = {0.47f, 0.47f, 0.47f, 0.47f}; /* draw outline */ - if ( (v3d->flag & V3D_SELECT_OUTLINE) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (base->flag & SELECT) && - (draw_wire == OBDRAW_WIRE_OFF) && - (ob->sculpt == NULL)) + if ((v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + (base->flag & SELECT) && + (draw_wire == OBDRAW_WIRE_OFF) && + (ob->sculpt == NULL)) { draw_mesh_object_outline(v3d, ob, dm); } @@ -3492,11 +3492,11 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D else { Paint *p; - if ( (v3d->flag & V3D_SELECT_OUTLINE) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (base->flag & SELECT) && - (draw_wire == OBDRAW_WIRE_OFF) && - (ob->sculpt == NULL)) + if ((v3d->flag & V3D_SELECT_OUTLINE) && + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + (base->flag & SELECT) && + (draw_wire == OBDRAW_WIRE_OFF) && + (ob->sculpt == NULL)) { draw_mesh_object_outline(v3d, ob, dm); } @@ -4347,7 +4347,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv timestep = psys_get_timestep(&sim); - if ( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { + if ((base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP)) { float mat[4][4]; mult_m4_m4m4(mat, ob->obmat, psys->imat); glMultMatrixf(mat); @@ -4893,7 +4893,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pdd->ma_col = NULL; } - if ( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { + if ((base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP)) { glLoadMatrixf(rv3d->viewmat); } } @@ -5253,7 +5253,7 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles) a = nu->pntsu; while (a--) { if (bezt->hide == 0) { - if ( (bezt->f2 & SELECT) == sel) { + if ((bezt->f2 & SELECT) == sel) { fp = bezt->vec[0]; glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT - 1)]); @@ -5264,14 +5264,14 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles) glVertex3fv(fp + 3); glVertex3fv(fp + 6); } - else if ( (bezt->f1 & SELECT) == sel) { + else if ((bezt->f1 & SELECT) == sel) { fp = bezt->vec[0]; glColor3ubv(handle_cols[MIN2(bezt->h1, TH_HANDLE_COL_TOT - 1)]); glVertex3fv(fp); glVertex3fv(fp + 3); } - else if ( (bezt->f3 & SELECT) == sel) { + else if ((bezt->f3 & SELECT) == sel) { fp = bezt->vec[1]; glColor3ubv(handle_cols[MIN2(bezt->h2, TH_HANDLE_COL_TOT - 1)]); @@ -5506,7 +5506,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) for (a = nu->pntsu - 1; a > 0; a--, bp++) { if (bp->hide == 0 && bp1->hide == 0) { if (sel) { - if ( (bp->f1 & SELECT) && (bp1->f1 & SELECT) ) { + if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) { UI_ThemeColor(TH_NURB_SEL_ULINE); glBegin(GL_LINE_STRIP); @@ -5541,7 +5541,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) for (a = nu->pntsv - 1; a > 0; a--, bp += ofs) { if (bp->hide == 0 && bp1->hide == 0) { if (sel) { - if ( (bp->f1 & SELECT) && (bp1->f1 & SELECT) ) { + if ((bp->f1 & SELECT) && (bp1->f1 & SELECT)) { UI_ThemeColor(TH_NURB_SEL_VLINE); glBegin(GL_LINE_STRIP); @@ -6930,9 +6930,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short } /* draw edit particles last so that they can draw over child particles */ - if ( (warning_recursive == 0) && - (dflag & DRAW_PICKING) == 0 && - (!scene->obedit)) + if ((warning_recursive == 0) && + (dflag & DRAW_PICKING) == 0 && + (!scene->obedit)) { if (ob->mode & OB_MODE_PARTICLE_EDIT && is_obact) { diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 17f1081f5c4..7accdb0c0e4 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2733,12 +2733,12 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } /* convert border to 3d coordinates */ - if ( (!gluUnProject(cent[0], cent[1], depth_close, - mats.modelview, mats.projection, (GLint *)mats.viewport, - &p[0], &p[1], &p[2])) || - (!gluUnProject((double)rect.xmin, (double)rect.ymin, depth_close, - mats.modelview, mats.projection, (GLint *)mats.viewport, - &p_corner[0], &p_corner[1], &p_corner[2]))) + if ((!gluUnProject(cent[0], cent[1], depth_close, + mats.modelview, mats.projection, (GLint *)mats.viewport, + &p[0], &p[1], &p[2])) || + (!gluUnProject((double)rect.xmin, (double)rect.ymin, depth_close, + mats.modelview, mats.projection, (GLint *)mats.viewport, + &p_corner[0], &p_corner[1], &p_corner[2]))) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 465279ee6ed..fd43333acfe 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -370,7 +370,7 @@ static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) case B_SEL_EDGE: if (em) { if (shift == 0 || em->selectmode == 0) { - if ( (em->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX) { + if ((em->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX) { if (ctrl) EDBM_selectmode_convert(em, SCE_SELECT_VERTEX, SCE_SELECT_EDGE); } em->selectmode = SCE_SELECT_EDGE; @@ -384,7 +384,9 @@ static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) case B_SEL_FACE: if (em) { if (shift == 0 || em->selectmode == 0) { - if ( ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)) { + if (((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || + ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)) + { if (ctrl) EDBM_selectmode_convert(em, (ts->selectmode ^ SCE_SELECT_FACE), SCE_SELECT_FACE); } em->selectmode = SCE_SELECT_FACE; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index fa431e89d80..5712144caf1 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1527,10 +1527,10 @@ int edge_inside_circle(int centx, int centy, int rad, int x1, int y1, int x2, in int radsq = rad * rad; /* check points in circle itself */ - if ( (x1 - centx) * (x1 - centx) + (y1 - centy) * (y1 - centy) <= radsq) { + if ((x1 - centx) * (x1 - centx) + (y1 - centy) * (y1 - centy) <= radsq) { return TRUE; } - else if ( (x2 - centx) * (x2 - centx) + (y2 - centy) * (y2 - centy) <= radsq) { + else if ((x2 - centx) * (x2 - centx) + (y2 - centy) * (y2 - centy) <= radsq) { return TRUE; } else { @@ -2467,7 +2467,7 @@ static void armature_circle_select(ViewContext *vc, int select, const int mval[2 /* only if the endpoints didn't get selected, deal with the middle of the bone too */ /* XXX should we just do this always? */ - if ( (didpoint == 0) && edge_inside_circle(mval[0], mval[1], rad, sco1[0], sco1[1], sco2[0], sco2[1]) ) { + if ((didpoint == 0) && edge_inside_circle(mval[0], mval[1], rad, sco1[0], sco1[1], sco2[0], sco2[1])) { if (select) ebone->flag |= BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED; else diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 1d40ae280b7..c25bb80bfde 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1653,7 +1653,7 @@ static void game_set_commmandline_options(GameData *gm) SYS_SystemHandle syshandle; int test; - if ( (syshandle = SYS_GetSystem()) ) { + if ((syshandle = SYS_GetSystem())) { /* User defined settings */ test = (U.gameflags & USER_DISABLE_MIPMAP); GPU_set_mipmap(!test); -- cgit v1.2.3