diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 02:35:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-26 02:35:18 +0400 |
commit | 6faeac9fe2867aca9c111e4f86f74912c115eddd (patch) | |
tree | f6422a603ed6546fa5251582d83151f8415e657b /source/blender/editors | |
parent | aede928bdc7902bb81ebb00b286dc5064cf54dd6 (diff) |
style cleanup: add braces around checks - 'if ELEM() {...}', confuses some parsers that done expand macros.
Diffstat (limited to 'source/blender/editors')
33 files changed, 65 insertions, 61 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index b2839db55cf..01ab36133fd 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2730,7 +2730,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float float y, ymid, ytext; /* sanity checks - don't draw anything */ - if ELEM(NULL, acf, ale) + if (ELEM(NULL, acf, ale)) return; /* get initial offset */ @@ -3158,7 +3158,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al short offset; /* sanity checks - don't draw anything */ - if ELEM3(NULL, acf, ale, block) + if (ELEM3(NULL, acf, ale, block)) return; /* get initial offset */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 169d6b94413..6f4d4c4a431 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -61,7 +61,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* sanity checks */ if (name == NULL) return icon; - else if ELEM3(NULL, id, fcu, fcu->rna_path) { + else if (ELEM3(NULL, id, fcu, fcu->rna_path)) { if (fcu == NULL) strcpy(name, "<invalid>"); else if (fcu->rna_path == NULL) diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 881de2904f7..9c4f96ebe6d 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -84,7 +84,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind FCurve *fcu; /* sanity checks */ - if ELEM(NULL, id, rna_path) + if (ELEM(NULL, id, rna_path)) return NULL; /* init animdata if none available yet */ diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 9b3e481d118..d19a137a6a8 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -784,7 +784,7 @@ short ANIM_fmodifiers_copy_to_buf (ListBase *modifiers, short active) short ok = 1; /* sanity checks */ - if ELEM(NULL, modifiers, modifiers->first) + if (ELEM(NULL, modifiers, modifiers->first)) return 0; /* copy the whole list, or just the active one? */ diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 1c0bb9beaa1..146aea401ec 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -189,7 +189,7 @@ static void nupdate_ak_gpframe (void *node, void *data) /* Add the given BezTriple to the given 'list' of Keyframes */ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt) { - if ELEM(NULL, keys, bezt) + if (ELEM(NULL, keys, bezt)) return; else BLI_dlrbTree_add(keys, compare_ak_bezt, nalloc_ak_bezt, nupdate_ak_bezt, bezt); @@ -198,7 +198,7 @@ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt) /* Add the given GPencil Frame to the given 'list' of Keyframes */ static void add_gpframe_to_keycolumns_list(DLRBT_Tree *keys, bGPDframe *gpf) { - if ELEM(NULL, keys, gpf) + if (ELEM(NULL, keys, gpf)) return; else BLI_dlrbTree_add(keys, compare_ak_gpframe, nalloc_ak_gpframe, nupdate_ak_gpframe, gpf); @@ -538,7 +538,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel glEnable(GL_LINE_SMOOTH); /* draw! */ - if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) { + if (ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH)) { /* interior - hardcoded colors (for selected and unselected only) */ switch (key_type) { case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */ @@ -574,7 +574,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel glCallList(displist2); } - if ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH) { + if (ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH)) { /* exterior - black frame */ glColor4f(0.0f, 0.0f, 0.0f, alpha); diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index c6aed3133e2..4e59216a39c 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -760,11 +760,13 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type) /* standard validation step for a few of these (implemented as macro for inlining without fn-call overhead): * "if the handles are not of the same type, set them to type free" */ -#define ENSURE_HANDLES_MATCH(bezt) \ - if (bezt->h1 != bezt->h2) { \ - if ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h1= HD_FREE; \ - if ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h2= HD_FREE; \ - } +#define ENSURE_HANDLES_MATCH(bezt) \ + if (bezt->h1 != bezt->h2) { \ + if (ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + bezt->h1= HD_FREE; \ + if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + bezt->h2= HD_FREE; \ + } /* Sets the selected bezier handles to type 'auto' */ static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt) diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 5d6d02bef63..831b8d21b01 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -145,7 +145,7 @@ void duplicate_fcurve_keys(FCurve *fcu) int i; /* this can only work when there is an F-Curve, and also when there are some BezTriples */ - if ELEM(NULL, fcu, fcu->bezt) + if (ELEM(NULL, fcu, fcu->bezt)) return; for (i=0; i < fcu->totvert; i++) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 71e70536d15..ba413fda00c 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -156,7 +156,7 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[], FCurve *fcu; /* sanity checks */ - if ELEM(NULL, act, rna_path) + if (ELEM(NULL, act, rna_path)) return NULL; /* try to find f-curve matching for this setting @@ -980,7 +980,7 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro int ret= 0; /* sanity checks */ - if ELEM(NULL, id, adt) { + if (ELEM(NULL, id, adt)) { BKE_report(reports, RPT_ERROR, "No ID-Block and/Or AnimData to delete keyframe from"); return 0; } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 4090fc1acaa..2211e6929a2 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3055,7 +3055,7 @@ static int armature_merge_exec (bContext *C, wmOperator *op) short type= RNA_enum_get(op->ptr, "type"); /* sanity checks */ - if ELEM(NULL, obedit, arm) + if (ELEM(NULL, obedit, arm)) return OPERATOR_CANCELLED; /* for now, there's only really one type of merging that's performed... */ @@ -4898,7 +4898,7 @@ static int pose_clear_transform_generic_exec(bContext *C, wmOperator *op, short autokey = 0; /* sanity checks */ - if ELEM(NULL, clear_func, default_ksName) { + if (ELEM(NULL, clear_func, default_ksName)) { BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform func or Keying Set Name"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 3d33930fa49..6768c884868 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -256,7 +256,7 @@ static void ED_pose_clear_paths(Object *ob) bPoseChannel *pchan; short skipped = 0; - if ELEM(NULL, ob, ob->pose) + if (ELEM(NULL, ob, ob->pose)) return; /* free the motionpath blocks, but also take note of whether we skipped some... */ @@ -289,7 +289,7 @@ static int pose_clear_paths_exec (bContext *C, wmOperator *UNUSED(op)) ob= object_pose_armature_get(CTX_data_active_object(C)); /* only continue if there's an object */ - if ELEM(NULL, ob, ob->pose) + if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; /* use the backend function for this */ @@ -1110,7 +1110,7 @@ static int pose_copy_exec (bContext *C, wmOperator *op) Object *ob= object_pose_armature_get(CTX_data_active_object(C)); /* sanity checking */ - if ELEM(NULL, ob, ob->pose) { + if (ELEM(NULL, ob, ob->pose)) { BKE_report(op->reports, RPT_ERROR, "No Pose to Copy"); return OPERATOR_CANCELLED; } @@ -1155,7 +1155,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op) KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOC_ROT_SCALE_ID); /* sanity checks */ - if ELEM(NULL, ob, ob->pose) + if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; if (g_posebuf == NULL) { diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index ced7dab91f4..d48cfaab63c 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -332,7 +332,7 @@ static int gp_actframe_delete_exec (bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data"); return OPERATOR_CANCELLED; } - if ELEM(NULL, gpl, gpf) { + if (ELEM(NULL, gpl, gpf)) { BKE_report(op->reports, RPT_ERROR, "No active frame to delete"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b21c059fcc1..3cd764d2eb3 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1313,7 +1313,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) * * Admittedly, this is a bit hacky, but it works much nicer from an ergonomic standpoint! */ - if ELEM(NULL, sima, sima->image) { + if (ELEM(NULL, sima, sima->image)) { /* make strokes be drawn in screen space */ p->gpd->sbuffer_sflag &= ~GP_STROKE_2DSPACE; p->gpd->flag &= ~GP_DATA_VIEWALIGN; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 21c3f4ca038..ce437fde69e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -344,8 +344,8 @@ static void ui_apply_autokey_undo(bContext *C, uiBut *but) const char *str= NULL; /* define which string to use for undo */ - if ELEM(but->type, LINK, INLINK) str= "Add button link"; - else if ELEM(but->type, MENU, ICONTEXTROW) str= but->drawstr; + if (ELEM(but->type, LINK, INLINK)) str = "Add button link"; + else if (ELEM(but->type, MENU, ICONTEXTROW)) str = but->drawstr; else if (but->drawstr[0]) str= but->drawstr; else str= but->tip; @@ -1121,7 +1121,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, } /* numeric value */ - if ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI) { + if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { if (but->poin==NULL && but->rnapoin.data==NULL); else if (mode=='c') { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 3baa672e42d..b7e2ba1c179 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -876,7 +876,7 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect height= UI_DPI_ICON_SIZE; /* calculate blend color */ - if ELEM4(but->type, TOG, ROW, TOGN, LISTROW) { + if (ELEM4(but->type, TOG, ROW, TOGN, LISTROW)) { if (but->flag & UI_SELECT); else if (but->flag & UI_ACTIVE); else alpha= 0.5f; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 9072db77b6f..792ea88baa7 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1776,8 +1776,10 @@ void UI_view2d_scrollers_free(View2DScrollers *scrollers) void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowheight, float startx, float starty, int column, int row, rctf *rect) { /* sanity checks */ - if ELEM(NULL, v2d, rect) + if (ELEM(NULL, v2d, rect)) { return; + } + if ((columnwidth <= 0) && (rowheight <= 0)) { rect->xmin = rect->xmax = 0.0f; rect->ymin = rect->ymax = 0.0f; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 09625e30eaf..03ded30fb59 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1215,7 +1215,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) done= 1; } - else if ELEM(ob->type, OB_SURF, OB_CURVE) { + else if (ELEM(ob->type, OB_SURF, OB_CURVE)) { cu= ob->data; for (nu=cu->nurb.first; nu; nu=nu->next) { diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 8200bbef2ee..1d502aeb55c 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -216,7 +216,7 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op, KeyingSet *ks; /* sanity checks */ - if ELEM(NULL, clear_func, default_ksName) { + if (ELEM(NULL, clear_func, default_ksName)) { BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform func or Keying Set Name"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 0aeeb0f71e2..260817d743f 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -232,7 +232,7 @@ static int material_slot_de_select(bContext *C, int select) EDBM_deselect_by_material(em, ob->actcol-1, select); } } - else if ELEM(ob->type, OB_CURVE, OB_SURF) { + else if (ELEM(ob->type, OB_CURVE, OB_SURF)) { ListBase *nurbs= curve_editnurbs((Curve*)ob->data); Nurb *nu; BPoint *bp; diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 59e4a1aaf04..a736fd01b2c 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -176,7 +176,7 @@ static void stats_object_edit(Object *obedit, SceneStats *stats) stats->totvert+=2; } } - else if ELEM(obedit->type, OB_CURVE, OB_SURF) { /* OB_FONT has no cu->editnurb */ + else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */ /* Curve Edit */ Curve *cu= obedit->data; Nurb *nu; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 0b8565b93a2..7ed49025814 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -121,7 +121,7 @@ static void nla_action_draw_keyframes (AnimData *adt, bAction *act, View2D *v2d, action_to_keylist(adt, act, &keys, NULL); BLI_dlrbTree_linkedlist_sync(&keys); - if ELEM(NULL, act, keys.first) + if (ELEM(NULL, act, keys.first)) return; /* draw a darkened region behind the strips diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d191f1d1d35..0c2dc7493e2 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -520,7 +520,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) NlaStrip *s1, *s2; /* get initial pair of strips */ - if ELEM(nlt->strips.first, NULL, nlt->strips.last) + if (ELEM(nlt->strips.first, NULL, nlt->strips.last)) continue; s1= nlt->strips.first; s2= s1->next; @@ -530,7 +530,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) NlaStrip *strip; /* check if both are selected */ - if ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT)) + if (ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT))) continue; /* check if there's space between the two */ if (IS_EQF(s1->end, s2->start)) diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index 19eebe4d320..dac185bf46e 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -98,7 +98,7 @@ static void active_node_panel(const bContext *C, Panel *pa) PointerRNA ptr; /* verify pointers, and create RNA pointer for the node */ - if ELEM(NULL, ntree, node) + if (ELEM(NULL, ntree, node)) return; //if (node->id) /* for group nodes */ // RNA_pointer_create(node->id, &RNA_Node, node, &ptr); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 45830eed223..c4fe337ba58 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1222,7 +1222,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S WM_operator_name_call(C, "OUTLINER_OT_animdata_operation", WM_OP_INVOKE_REGION_WIN, NULL); else if (datalevel == TSE_DRIVER_BASE) /* do nothing... no special ops needed yet */; - else if ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS) + else if (ELEM3(datalevel, TSE_R_LAYER_BASE, TSE_R_LAYER, TSE_R_PASS)) /*WM_operator_name_call(C, "OUTLINER_OT_renderdata_operation", WM_OP_INVOKE_REGION_WIN, NULL)*/; else WM_operator_name_call(C, "OUTLINER_OT_data_operation", WM_OP_INVOKE_REGION_WIN, NULL); diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 3eaf2b8100e..1c1f7a69865 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -143,7 +143,7 @@ static int time_view_all_exec (bContext *C, wmOperator *UNUSED(op)) View2D *v2d= (ar) ? &ar->v2d : NULL; float extra; - if ELEM(NULL, scene, ar) + if (ELEM(NULL, scene, ar)) return OPERATOR_CANCELLED; /* set extents of view to start/end frames (Preview Range too) */ diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index aae0348de20..fae271e5bee 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1875,7 +1875,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* wire draw over solid only in posemode */ if ((dt <= OB_WIRE) || (arm->flag & ARM_POSEMODE) || ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) { /* draw line check first. we do selection indices */ - if ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) { + if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) { if (arm->flag & ARM_POSEMODE) index= base->selcol; } @@ -2139,7 +2139,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt) /* if wire over solid, set offset */ index= -1; glLoadName(-1); - if ELEM(arm->drawtype, ARM_LINE, ARM_WIRE) { + if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) { if (G.f & G_PICKSEL) index= 0; } @@ -2203,7 +2203,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt) /* restore */ if (index!=-1) glLoadName(-1); - if ELEM(arm->drawtype,ARM_LINE,ARM_WIRE); + if (ELEM(arm->drawtype,ARM_LINE,ARM_WIRE)); else if (dt>OB_WIRE) bglPolygonOffset(rv3d->dist, 0.0f); /* finally names and axes */ @@ -2462,7 +2462,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) int cfrao, flago; /* pre conditions, get an action with sufficient frames */ - if ELEM(NULL, adt, adt->action) + if (ELEM(NULL, adt, adt->action)) return; calc_action_range(adt->action, &start, &end, 0); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e8e1083805a..00ce6897c2c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1365,7 +1365,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, glEnd(); } } - else if ELEM(la->type, LA_HEMI, LA_SUN) { + else if (ELEM(la->type, LA_HEMI, LA_SUN)) { /* draw the line from the circle along the dist */ glBegin(GL_LINE_STRIP); @@ -6123,7 +6123,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type) if (ob->type==OB_MESH) { bb= mesh_get_bb(ob); } - else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) { + else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { bb= ob->bb ? ob->bb : ( (Curve *)ob->data )->bb; } else if (ob->type==OB_MBALL) { @@ -6157,7 +6157,7 @@ static void drawtexspace(Object *ob) if (ob->type==OB_MESH) { mesh_get_texspace(ob->data, loc, NULL, size); } - else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) { + else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { Curve *cu= ob->data; copy_v3_v3(size, cu->size); copy_v3_v3(loc, cu->loc); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index fdaf34e2e3c..1d8395c0967 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -523,7 +523,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) if (obedit) { tottrans= 0; - if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) + if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)) make_trans_verts(obedit, bmat[0], bmat[1], 0); if (tottrans==0) return OPERATOR_CANCELLED; @@ -664,7 +664,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op)) if (obedit) { tottrans= 0; - if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) + if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)) make_trans_verts(obedit, bmat[0], bmat[1], 0); if (tottrans==0) return OPERATOR_CANCELLED; @@ -879,7 +879,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) if (obedit) { tottrans=0; - if ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) + if (ELEM6(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)) make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS|TM_SKIP_HANDLES); if (tottrans==0) return OPERATOR_CANCELLED; @@ -1063,7 +1063,7 @@ int minmax_verts(Object *obedit, float *min, float *max) int a; tottrans=0; - if ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE) + if (ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE)) make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS); if (tottrans==0) return 0; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 04b6a095117..68b7268596c 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1694,7 +1694,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int /* same as TFM_TIME_EXTEND, but we need the mode info for later * so that duplicate-culling will work properly */ - if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA) + if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) initTranslation(t); else initTimeTranslate(t); @@ -1706,7 +1706,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int * (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement) * depending on which editor this was called from */ - if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA) + if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) initTranslation(t); else initTimeTranslate(t); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 6669bfdb3ca..60ec08fcb5d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5927,7 +5927,7 @@ void createTransData(bContext *C, TransInfo *t) if (t->obedit->type == OB_MESH) { createTransEditVerts(C, t); } - else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { + else if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) { createTransCurveVerts(C, t); } else if (t->obedit->type==OB_LATTICE) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 8e22ccd943d..6dbab08ba7f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -269,7 +269,7 @@ static void animrecord_check_state (Scene *scene, ID *id, wmTimer *animtimer) ScreenAnimData *sad= (animtimer) ? animtimer->customdata : NULL; /* sanity checks */ - if ELEM3(NULL, scene, id, sad) + if (ELEM3(NULL, scene, id, sad)) return; /* check if we need a new strip if: @@ -673,7 +673,7 @@ static void recalcData_view3d(TransInfo *t) Base *base = t->scene->basact; if (t->obedit) { - if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { + if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) { Curve *cu= t->obedit->data; ListBase *nurbs= curve_editnurbs(cu); Nurb *nu= nurbs->first; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index eb1d8e1df5c..ece556f11ae 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -377,7 +377,7 @@ int calc_manipulator_stats(const bContext *C) } } } - else if ELEM(obedit->type, OB_CURVE, OB_SURF) { + else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { Curve *cu= obedit->data; float center[3]; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 092b9c27929..2a53a8e4ad2 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -712,7 +712,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } } } /* end editmesh */ - else if ELEM(obedit->type, OB_CURVE, OB_SURF) { + else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { Curve *cu= obedit->data; Nurb *nu; BezTriple *bezt; diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index e46fe19d306..40a95fc08ba 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -105,7 +105,7 @@ void ED_undo_push(bContext *C, const char *str) if (obedit->type==OB_MESH) undo_push_mesh(C, str); - else if ELEM(obedit->type, OB_CURVE, OB_SURF) + else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) undo_push_curve(C, str); else if (obedit->type==OB_FONT) undo_push_font(C, str); @@ -168,7 +168,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) ED_text_undo_step(C, step); } else if (obedit) { - if ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) { + if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) { if (undoname) undo_editmode_name(C, undoname); else @@ -260,7 +260,7 @@ int ED_undo_valid(const bContext *C, const char *undoname) return 1; } else if (obedit) { - if ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) { + if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) { return undo_editmode_valid(undoname); } } |