diff options
10 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/mesh_fair.cc b/source/blender/blenkernel/intern/mesh_fair.cc index ac6dd96ed90..2a364b183b2 100644 --- a/source/blender/blenkernel/intern/mesh_fair.cc +++ b/source/blender/blenkernel/intern/mesh_fair.cc @@ -172,7 +172,7 @@ class FairingContext { } /* Early return, nothing to do. */ - if (num_affected_vertices == 0 || num_affected_vertices == totvert_) { + if (ELEM(num_affected_vertices, 0, totvert_)) { return; } diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index e6a6c65243e..d10dafa36ca 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -1706,7 +1706,7 @@ static bool gpencil_interpolate_reverse_poll(bContext *C) if (area == NULL) { return false; } - if ((area->spacetype != SPACE_VIEW3D) && (area->spacetype != SPACE_ACTION)) { + if (!ELEM(area->spacetype, SPACE_VIEW3D, SPACE_ACTION)) { return false; } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 14ab7fd9974..bed7683703f 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1340,7 +1340,7 @@ static void outliner_sort(ListBase *lb) tp->name = te->name; tp->idcode = te->idcode; - if ((tselem->type != TSE_SOME_ID) && tselem->type != TSE_DEFGROUP) { + if (!ELEM(tselem->type, TSE_SOME_ID, TSE_DEFGROUP)) { tp->idcode = 0; /* Don't sort this. */ } if (tselem->type == TSE_ID_BASE) { diff --git a/source/blender/editors/util/ed_draw.c b/source/blender/editors/util/ed_draw.c index d7b22b4f601..3b543cdf6ce 100644 --- a/source/blender/editors/util/ed_draw.c +++ b/source/blender/editors/util/ed_draw.c @@ -189,7 +189,7 @@ static void metadata_draw_imbuf(ImBuf *ibuf, const rctf *rect, int fontid, const ofs_y += vertical_offset; } } /* Strip */ - else if (i == 1 || i == 2) { + else if (ELEM(i, 1, 2)) { int len = BLI_snprintf_rlen(temp_str, MAX_METADATA_STR, "%s: ", meta_data_list[i + 1]); if (metadata_is_valid(ibuf, temp_str, i + 1, len)) { BLF_position(fontid, xmin, ymax - vertical_offset - ofs_y, 0.0f); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index d6e151fd262..080a3caa32f 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c @@ -209,8 +209,7 @@ static void updateDepsgraph(GpencilModifierData *md, } else { FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (ctx->scene->master_collection, ob, mode) { - if (ob->type == OB_MESH || ob->type == OB_MBALL || ob->type == OB_CURVE || - ob->type == OB_SURF || ob->type == OB_FONT) { + if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) { if (ob->lineart.usage != OBJECT_LRT_EXCLUDE) { DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_GEOMETRY, "Line Art Modifier"); DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_TRANSFORM, "Line Art Modifier"); diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 49e0d03c459..3778e60d813 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -1504,8 +1504,7 @@ static void lineart_geometry_object_load(Depsgraph *dg, return; } - if (ob->type == OB_MESH || ob->type == OB_MBALL || ob->type == OB_CURVE || ob->type == OB_SURF || - ob->type == OB_FONT) { + if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) { if (ob->type == OB_MESH) { use_mesh = DEG_get_evaluated_object(dg, ob)->data; @@ -1647,7 +1646,7 @@ static void lineart_geometry_object_load(Depsgraph *dg, if (usage == OBJECT_LRT_INTERSECTION_ONLY) { rt->flags |= LRT_TRIANGLE_INTERSECTION_ONLY; } - else if (usage == OBJECT_LRT_NO_INTERSECTION || usage == OBJECT_LRT_OCCLUSION_ONLY) { + else if (ELEM(usage, OBJECT_LRT_NO_INTERSECTION, OBJECT_LRT_OCCLUSION_ONLY)) { rt->flags |= LRT_TRIANGLE_NO_INTERSECTION; } @@ -1711,8 +1710,7 @@ static void lineart_geometry_object_load(Depsgraph *dg, LineartLineSegment *rls = lineart_mem_aquire(&rb->render_data_pool, sizeof(LineartLineSegment)); BLI_addtail(&la_e->segments, rls); - if (usage == OBJECT_LRT_INHERIT || usage == OBJECT_LRT_INCLUDE || - usage == OBJECT_LRT_NO_INTERSECTION) { + if (ELEM(usage, OBJECT_LRT_INHERIT, OBJECT_LRT_INCLUDE, OBJECT_LRT_NO_INTERSECTION)) { lineart_add_edge_to_list(rb, la_e); } diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c index 6b2facc16a2..fd37ad18b4c 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.c +++ b/source/blender/modifiers/intern/MOD_ui_common.c @@ -351,7 +351,7 @@ static void modifier_panel_header(const bContext *C, Panel *panel) } } /* Collision and Surface are always enabled, hide buttons. */ - if ((md->type != eModifierType_Collision) && (md->type != eModifierType_Surface)) { + if (!ELEM(md->type, eModifierType_Collision, eModifierType_Surface)) { if (mti->flags & eModifierTypeFlag_SupportsEditmode) { sub = uiLayoutRow(row, true); uiLayoutSetActive(sub, (md->mode & eModifierMode_Realtime)); diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 9684c21605a..b7a16b6c5ee 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -372,7 +372,7 @@ wmDragAsset *WM_drag_get_asset_data(const wmDrag *drag, int idcode) } wmDragAsset *asset_drag = drag->poin; - return (idcode == 0 || asset_drag->id_type == idcode) ? asset_drag : NULL; + return (ELEM(idcode, 0, asset_drag->id_type)) ? asset_drag : NULL; } static ID *wm_drag_asset_id_import(wmDragAsset *asset_drag) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 791aeeb39cd..627ec1d5722 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -580,7 +580,7 @@ void wm_event_do_notifiers(bContext *C) if ((note->category == NC_SPACE) && note->reference) { /* Filter out notifiers sent to other spaces. RNA sets the reference to the owning ID * though, the screen, so let notifiers through that reference the entire screen. */ - if ((note->reference != area->spacedata.first) && (note->reference != screen)) { + if (!ELEM(note->reference, area->spacedata.first, screen)) { continue; } } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index eb1da15807c..2e9fd1b1b16 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -812,7 +812,7 @@ wmWindow *WM_window_open(bContext *C, LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) { if (WM_window_is_temp_screen(win_iter)) { char *wintitle = GHOST_GetTitle(win_iter->ghostwin); - if (strcmp(title, wintitle) == 0) { + if (STREQ(title, wintitle)) { win = win_iter; } free(wintitle); |