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/nodes/composite/nodes/node_composite_cryptomatte.c | 4 ++-- source/blender/nodes/shader/nodes/node_shader_normal_map.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c index ce0c1a91072..c8d2d993e75 100644 --- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c @@ -65,7 +65,7 @@ static void cryptomatte_add(NodeCryptomatte *n, float f) /* Find the next separator. */ char *token_end = strchr(n->matte_id + start, ','); - if (token_end == NULL || token_end == n->matte_id + start) { + if (ELEM(token_end, NULL, n->matte_id + start)) { token_end = n->matte_id + end; } /* Be aware that token_len still contains any trailing white space. */ @@ -144,7 +144,7 @@ static void cryptomatte_remove(NodeCryptomatte *n, float f) /* Find the next separator. */ char *token_end = strchr(n->matte_id + start + 1, ','); - if (token_end == NULL || token_end == n->matte_id + start) { + if (ELEM(token_end, NULL, n->matte_id + start)) { token_end = n->matte_id + end; } /* Be aware that token_len still contains any trailing white space. */ diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c b/source/blender/nodes/shader/nodes/node_shader_normal_map.c index 7dd2ee9a4ac..493acb06963 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c @@ -82,7 +82,7 @@ static int gpu_shader_normal_map(GPUMaterial *mat, } const char *color_to_normal_fnc_name = "color_to_normal_new_shading"; - if (nm->space == SHD_SPACE_BLENDER_OBJECT || nm->space == SHD_SPACE_BLENDER_WORLD) { + if (ELEM(nm->space, SHD_SPACE_BLENDER_OBJECT, SHD_SPACE_BLENDER_WORLD)) { color_to_normal_fnc_name = "color_to_blender_normal_new_shading"; } -- cgit v1.2.3