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-09-19 09:01:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-19 09:28:17 +0300
commit14b2a35c8bfd6d77f6357f929ddd82845436725f (patch)
tree54746d6a3cf0da24b95d2a9761e6222656eb5249 /source/blender/editors
parent17a2820da8ad8ea23d336129f32e060e5746b047 (diff)
Cleanup: use parenthesis for if statements in macros
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c18
-rw-r--r--source/blender/editors/animation/anim_filter.c3
-rw-r--r--source/blender/editors/animation/keyframes_edit.c16
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h12
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
5 files changed, 34 insertions, 18 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
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index e6fdbf1ad17..f45321b6b20 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -670,11 +670,13 @@ struct GP_EditableStrokes_Iter {
for (bGPDstroke *gps = gpf_->strokes.first; gps; gps = gpsn_) { \
gpsn_ = gps->next; \
/* skip strokes that are invalid for current view */ \
- if (ED_gpencil_stroke_can_use(C, gps) == false) \
+ if (ED_gpencil_stroke_can_use(C, gps) == false) { \
continue; \
+ } \
/* check if the color is editable */ \
- if (ED_gpencil_stroke_color_use(obact_, gpl, gps) == false) \
+ if (ED_gpencil_stroke_color_use(obact_, gpl, gps) == false) { \
continue; \
+ } \
/* ... Do Stuff With Strokes ... */
#define GP_EDITABLE_STROKES_END(gpstroke_iter) \
@@ -717,11 +719,13 @@ struct GP_EditableStrokes_Iter {
/* loop over strokes */ \
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf_->strokes) { \
/* skip strokes that are invalid for current view */ \
- if (ED_gpencil_stroke_can_use(C, gps) == false) \
+ if (ED_gpencil_stroke_can_use(C, gps) == false) { \
continue; \
+ } \
/* check if the color is editable */ \
- if (ED_gpencil_stroke_color_use(obact_, gpl, gps) == false) \
+ if (ED_gpencil_stroke_color_use(obact_, gpl, gps) == false) { \
continue; \
+ } \
/* ... Do Stuff With Strokes ... */
#define GP_EVALUATED_STROKES_END(gpstroke_iter) \
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index cd78b61b8c5..19261bd3db6 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -10486,8 +10486,9 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
#define CASE_NUM_TO_DIR(n, d) \
case (EVT_ZEROKEY + n): \
case (EVT_PAD0 + n): { \
- if (num_dir == UI_RADIAL_NONE) \
+ if (num_dir == UI_RADIAL_NONE) { \
num_dir = d; \
+ } \
} \
(void)0