From 6faeac9fe2867aca9c111e4f86f74912c115eddd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Mar 2012 22:35:18 +0000 Subject: style cleanup: add braces around checks - 'if ELEM() {...}', confuses some parsers that done expand macros. --- source/blender/editors/animation/anim_channels_defines.c | 4 ++-- source/blender/editors/animation/anim_ipo_utils.c | 2 +- source/blender/editors/animation/drivers.c | 2 +- source/blender/editors/animation/fmodifier_ui.c | 2 +- source/blender/editors/animation/keyframes_draw.c | 8 ++++---- source/blender/editors/animation/keyframes_edit.c | 12 +++++++----- source/blender/editors/animation/keyframes_general.c | 2 +- source/blender/editors/animation/keyframing.c | 4 ++-- 8 files changed, 19 insertions(+), 17 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index b2839db55cf..01ab36133fd 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2730,7 +2730,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float float y, ymid, ytext; /* sanity checks - don't draw anything */ - if ELEM(NULL, acf, ale) + if (ELEM(NULL, acf, ale)) return; /* get initial offset */ @@ -3158,7 +3158,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al short offset; /* sanity checks - don't draw anything */ - if ELEM3(NULL, acf, ale, block) + if (ELEM3(NULL, acf, ale, block)) return; /* get initial offset */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 169d6b94413..6f4d4c4a431 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -61,7 +61,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* sanity checks */ if (name == NULL) return icon; - else if ELEM3(NULL, id, fcu, fcu->rna_path) { + else if (ELEM3(NULL, id, fcu, fcu->rna_path)) { if (fcu == NULL) strcpy(name, ""); else if (fcu->rna_path == NULL) diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 881de2904f7..9c4f96ebe6d 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -84,7 +84,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind FCurve *fcu; /* sanity checks */ - if ELEM(NULL, id, rna_path) + if (ELEM(NULL, id, rna_path)) return NULL; /* init animdata if none available yet */ diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 9b3e481d118..d19a137a6a8 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -784,7 +784,7 @@ short ANIM_fmodifiers_copy_to_buf (ListBase *modifiers, short active) short ok = 1; /* sanity checks */ - if ELEM(NULL, modifiers, modifiers->first) + if (ELEM(NULL, modifiers, modifiers->first)) return 0; /* copy the whole list, or just the active one? */ diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 1c0bb9beaa1..146aea401ec 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -189,7 +189,7 @@ static void nupdate_ak_gpframe (void *node, void *data) /* Add the given BezTriple to the given 'list' of Keyframes */ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt) { - if ELEM(NULL, keys, bezt) + if (ELEM(NULL, keys, bezt)) return; else BLI_dlrbTree_add(keys, compare_ak_bezt, nalloc_ak_bezt, nupdate_ak_bezt, bezt); @@ -198,7 +198,7 @@ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt) /* Add the given GPencil Frame to the given 'list' of Keyframes */ static void add_gpframe_to_keycolumns_list(DLRBT_Tree *keys, bGPDframe *gpf) { - if ELEM(NULL, keys, gpf) + if (ELEM(NULL, keys, gpf)) return; else BLI_dlrbTree_add(keys, compare_ak_gpframe, nalloc_ak_gpframe, nupdate_ak_gpframe, gpf); @@ -538,7 +538,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel glEnable(GL_LINE_SMOOTH); /* draw! */ - if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) { + if (ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH)) { /* interior - hardcoded colors (for selected and unselected only) */ switch (key_type) { case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */ @@ -574,7 +574,7 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel glCallList(displist2); } - if ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH) { + if (ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH)) { /* exterior - black frame */ glColor4f(0.0f, 0.0f, 0.0f, alpha); diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index c6aed3133e2..4e59216a39c 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -760,11 +760,13 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type) /* standard validation step for a few of these (implemented as macro for inlining without fn-call overhead): * "if the handles are not of the same type, set them to type free" */ -#define ENSURE_HANDLES_MATCH(bezt) \ - if (bezt->h1 != bezt->h2) { \ - if ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h1= HD_FREE; \ - if ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM) bezt->h2= HD_FREE; \ - } +#define ENSURE_HANDLES_MATCH(bezt) \ + if (bezt->h1 != bezt->h2) { \ + if (ELEM3(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + bezt->h1= HD_FREE; \ + if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \ + bezt->h2= HD_FREE; \ + } /* Sets the selected bezier handles to type 'auto' */ static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt) diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 5d6d02bef63..831b8d21b01 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -145,7 +145,7 @@ void duplicate_fcurve_keys(FCurve *fcu) int i; /* this can only work when there is an F-Curve, and also when there are some BezTriples */ - if ELEM(NULL, fcu, fcu->bezt) + if (ELEM(NULL, fcu, fcu->bezt)) return; for (i=0; i < fcu->totvert; i++) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 71e70536d15..ba413fda00c 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -156,7 +156,7 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[], FCurve *fcu; /* sanity checks */ - if ELEM(NULL, act, rna_path) + if (ELEM(NULL, act, rna_path)) return NULL; /* try to find f-curve matching for this setting @@ -980,7 +980,7 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro int ret= 0; /* sanity checks */ - if ELEM(NULL, id, adt) { + if (ELEM(NULL, id, adt)) { BKE_report(reports, RPT_ERROR, "No ID-Block and/Or AnimData to delete keyframe from"); return 0; } -- cgit v1.2.3