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/blenloader/intern/versioning_260.c | 5 +---- source/blender/blenloader/intern/versioning_cycles.c | 4 ++-- source/blender/blenloader/intern/versioning_legacy.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 6642749d907..46db5b40a69 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -2066,10 +2066,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (srl->freestyleConfig.mode == 0) { srl->freestyleConfig.mode = FREESTYLE_CONTROL_EDITOR_MODE; } - if (srl->freestyleConfig.raycasting_algorithm == - FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE || - srl->freestyleConfig.raycasting_algorithm == - FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL) { + if (ELEM(srl->freestyleConfig.raycasting_algorithm, FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE, FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL)) { srl->freestyleConfig.raycasting_algorithm = 0; /* deprecated */ srl->freestyleConfig.flags |= FREESTYLE_CULLING; } diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index 26329fca6fa..7b5cb8ed757 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -1197,7 +1197,7 @@ static void update_voronoi_node_square_distance(bNodeTree *ntree) NodeTexVoronoi *tex = (NodeTexVoronoi *)node->storage; bNodeSocket *sockDistance = nodeFindSocket(node, SOCK_OUT, "Distance"); if (tex->distance == SHD_VORONOI_EUCLIDEAN && - (tex->feature == SHD_VORONOI_F1 || tex->feature == SHD_VORONOI_F2) && + (ELEM(tex->feature, SHD_VORONOI_F1, SHD_VORONOI_F2)) && socket_is_used(sockDistance)) { bNode *multiplyNode = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); multiplyNode->custom1 = NODE_MATH_MULTIPLY; @@ -1237,7 +1237,7 @@ static void update_noise_and_wave_distortion(bNodeTree *ntree) bool need_update = false; LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { - if (node->type == SH_NODE_TEX_NOISE || node->type == SH_NODE_TEX_WAVE) { + if (ELEM(node->type, SH_NODE_TEX_NOISE, SH_NODE_TEX_WAVE)) { bNodeSocket *sockDistortion = nodeFindSocket(node, SOCK_IN, "Distortion"); float *distortion = cycles_node_socket_float_value(sockDistortion); diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 2659cc13bcc..9178ec97d3d 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1253,7 +1253,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) ed = sce->ed; if (ed) { SEQ_ALL_BEGIN (sce->ed, seq) { - if (seq->type == SEQ_TYPE_IMAGE || seq->type == SEQ_TYPE_MOVIE) { + if (ELEM(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE)) { seq->alpha_mode = SEQ_ALPHA_STRAIGHT; } } -- cgit v1.2.3