From aa3a4973a30ff668a62447e18ac41f6c916b4a8b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Nov 2020 12:30:59 +1100 Subject: Cleanup: use ELEM macro --- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_constraint.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/object/object_relations.c | 2 +- source/blender/editors/object/object_transform.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 36e780f7472..8973a74cd1d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2930,7 +2930,7 @@ static int object_convert_exec(bContext *C, wmOperator *op) /* Remove curves and meshes converted to Grease Pencil object. */ if (gpencilConverted) { FOREACH_SCENE_OBJECT_BEGIN (scene, ob_delete) { - if ((ob_delete->type == OB_CURVE) || (ob_delete->type == OB_MESH)) { + if (ELEM(ob_delete->type, OB_CURVE, OB_MESH)) { if (ob_delete->flag & OB_DONE) { ED_object_base_free_and_unlink(bmain, scene, ob_delete); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 0073aa830de..fa8531dfb48 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -2219,7 +2219,7 @@ static const EnumPropertyItem *object_constraint_add_itemf(bContext *UNUSED(C), int totitem = 0; while (item->identifier) { - if ((item->value != CONSTRAINT_TYPE_KINEMATIC) && (item->value != CONSTRAINT_TYPE_SPLINEIK)) { + if (!ELEM(item->value, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK)) { RNA_enum_item_add(&object_constraint_items, &totitem, item); } item++; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index df940d3fa25..70c3552e8da 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -761,7 +761,7 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_LATTICE, scene); } - else if (ob->type == OB_SURF || ob->type == OB_CURVE) { + else if (ELEM(ob->type, OB_SURF, OB_CURVE)) { ok = 1; ED_curve_editnurb_make(ob); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 46624a76999..29393e8a8d1 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -911,7 +911,7 @@ bool ED_object_parent_set(ReportList *reports, else if (partype == PAR_ARMATURE_NAME) { ED_gpencil_add_armature_weights(C, reports, ob, par, GP_PAR_ARMATURE_NAME); } - else if ((partype == PAR_ARMATURE_AUTO) || (partype == PAR_ARMATURE_ENVELOPE)) { + else if (ELEM(partype, PAR_ARMATURE_AUTO, PAR_ARMATURE_ENVELOPE)) { WM_cursor_wait(1); ED_gpencil_add_armature_weights(C, reports, ob, par, GP_PAR_ARMATURE_AUTO); WM_cursor_wait(0); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 7d853745ad6..76d0c162f29 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -565,7 +565,7 @@ static void append_sorted_object_parent_hierarchy(Object *root_object, Object **sorted_objects, int *object_index) { - if (object->parent != NULL && object->parent != root_object) { + if (!ELEM(object->parent, NULL, root_object)) { append_sorted_object_parent_hierarchy( root_object, object->parent, sorted_objects, object_index); } @@ -1374,7 +1374,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (centermode == ORIGIN_TO_CURSOR) { copy_v3_v3(gpcenter, cursor); } - if ((centermode == ORIGIN_TO_GEOMETRY) || (centermode == ORIGIN_TO_CURSOR)) { + if (ELEM(centermode, ORIGIN_TO_GEOMETRY, ORIGIN_TO_CURSOR)) { bGPDspoint *pt; float imat[3][3], bmat[3][3]; float offset_global[3]; -- cgit v1.2.3