Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-11-06 04:51:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-06 04:54:19 +0300
commitf11f7ce08e92463b8a7495ed60082546f228cb60 (patch)
treee48a9811ca300b5115837a12d633f0f1bc4da25b /source/blender/editors
parentd89fedf2667298042ed12a899fb2afe538a69901 (diff)
Cleanup: use ELEM macro (>2 args)
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_utils.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 30a73afa94e..df7fd3dee0e 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2295,7 +2295,7 @@ void uiItemFullR(uiLayout *layout,
ui_item_enum_expand(layout, block, ptr, prop, name, h, icon_only);
}
/* property with separate label */
- else if (type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) {
+ else if (ELEM(type, PROP_ENUM, PROP_STRING, PROP_POINTER)) {
but = ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag);
but = ui_but_add_search(but, ptr, prop, NULL, NULL);
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 1abde7cf714..958a0bc03cd 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -792,7 +792,7 @@ void UI_butstore_update(uiBlock *block)
/* warning, loop-in-loop, in practice we only store <10 buttons at a time,
* so this isn't going to be a problem, if that changes old-new mapping can be cached first */
LISTBASE_FOREACH (uiButStore *, bs_handle, &block->butstore) {
- BLI_assert((bs_handle->block == NULL) || (bs_handle->block == block) ||
+ BLI_assert(ELEM(bs_handle->block, NULL, block) ||
(block->oldblock && block->oldblock == bs_handle->block));
if (bs_handle->block == block->oldblock) {
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index d2b8c17160c..421a3653d8c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3922,7 +3922,7 @@ static void do_elastic_deform_brush_task_cb_ex(void *__restrict userdata,
if (brush->elastic_deform_type == BRUSH_ELASTIC_DEFORM_TWIST) {
int symm = ss->cache->mirror_symmetry_pass;
- if (symm == 1 || symm == 2 || symm == 4 || symm == 7) {
+ if (ELEM(symm, 1, 2, 4, 7)) {
dir = -dir;
}
}
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 1814846c76f..52a5ff609d8 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -1897,7 +1897,7 @@ static void txt_wrap_move_bol(SpaceText *st, ARegion *region, const bool sel)
end += max;
chop = 1;
}
- else if (ch == ' ' || ch == '-' || ch == '\0') {
+ else if (ELEM(ch, ' ', '-', '\0')) {
if (j >= oldc) {
*charp = BLI_str_utf8_offset_from_column((*linep)->line, start);
loop = 0;
@@ -3065,7 +3065,7 @@ static void text_cursor_set_to_pos_wrapped(
break;
}
}
- else if (ch == ' ' || ch == '-' || ch == '\0') {
+ else if (ELEM(ch, ' ', '-', '\0')) {
if (found) {
break;
}