diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-19 09:01:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-19 09:28:17 +0300 |
commit | 14b2a35c8bfd6d77f6357f929ddd82845436725f (patch) | |
tree | 54746d6a3cf0da24b95d2a9761e6222656eb5249 /source/blender/editors/animation | |
parent | 17a2820da8ad8ea23d336129f32e060e5746b047 (diff) |
Cleanup: use parenthesis for if statements in macros
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 18 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 3 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 16 |
3 files changed, 24 insertions, 13 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index b7aa150ea7a..cebf807d346 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4254,20 +4254,26 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChanne #define ACF_SETTING_SET(sval, sflag, smode) \ { \ if (negflag) { \ - if (smode == ACHANNEL_SETFLAG_INVERT) \ + if (smode == ACHANNEL_SETFLAG_INVERT) { \ (sval) ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) \ + } \ + else if (smode == ACHANNEL_SETFLAG_ADD) { \ (sval) &= ~(sflag); \ - else \ + } \ + else { \ (sval) |= (sflag); \ + } \ } \ else { \ - if (smode == ACHANNEL_SETFLAG_INVERT) \ + if (smode == ACHANNEL_SETFLAG_INVERT) { \ (sval) ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) \ + } \ + else if (smode == ACHANNEL_SETFLAG_ADD) { \ (sval) |= (sflag); \ - else \ + } \ + else { \ (sval) &= ~(sflag); \ + } \ } \ } \ (void)0 diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index a17f1950be0..9d450496f33 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -570,8 +570,9 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) // XXX: ale_statement stuff is really a hack for one special case. It shouldn't really be needed... #define ANIMCHANNEL_NEW_CHANNEL_FULL( \ channel_data, channel_type, owner_id, fcurve_owner_id, ale_statement) \ - if (filter_mode & ANIMFILTER_TMP_PEEK) \ + if (filter_mode & ANIMFILTER_TMP_PEEK) { \ return 1; \ + } \ { \ bAnimListElem *ale = make_new_animlistelem( \ channel_data, channel_type, (ID *)owner_id, fcurve_owner_id); \ diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 6f6b5232fa7..299aa1db4f5 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -515,19 +515,21 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) #define KEYFRAME_OK_CHECKS(check) \ { \ CHECK_TYPE(ok, short); \ - if (check(1)) \ + if (check(1)) { \ ok |= KEYFRAME_OK_KEY; \ -\ + } \ if (ked && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) { \ /* Only act on visible items, so check handle visibility state. */ \ const bool handles_visible = ((ked->iterflags & KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE) ? \ (BEZT_ISSEL_ANY(bezt)) : \ true); \ if (handles_visible) { \ - if (check(0)) \ + if (check(0)) { \ ok |= KEYFRAME_OK_H1; \ - if (check(2)) \ + } \ + if (check(2)) { \ ok |= KEYFRAME_OK_H2; \ + } \ } \ } \ } \ @@ -1054,10 +1056,12 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short mode) */ #define ENSURE_HANDLES_MATCH(bezt) \ if (bezt->h1 != bezt->h2) { \ - if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) { \ bezt->h1 = HD_FREE; \ - if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + } \ + if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) { \ bezt->h2 = HD_FREE; \ + } \ } \ (void)0 |