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>2012-03-26 02:35:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-26 02:35:18 +0400
commit6faeac9fe2867aca9c111e4f86f74912c115eddd (patch)
treef6422a603ed6546fa5251582d83151f8415e657b /source/blender/blenkernel
parentaede928bdc7902bb81ebb00b286dc5064cf54dd6 (diff)
style cleanup: add braces around checks - 'if ELEM() {...}', confuses some parsers that done expand macros.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/action.c7
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c24
-rw-r--r--source/blender/blenkernel/intern/curve.c6
-rw-r--r--source/blender/blenkernel/intern/displist.c3
-rw-r--r--source/blender/blenkernel/intern/fcurve.c12
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c18
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/key.c4
-rw-r--r--source/blender/blenkernel/intern/material.c6
-rw-r--r--source/blender/blenkernel/intern/nla.c56
-rw-r--r--source/blender/blenkernel/intern/object.c20
11 files changed, 84 insertions, 74 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index b78a11185cc..78668a5a2e4 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -464,10 +464,11 @@ bPoseChannel *get_active_posechannel (Object *ob)
{
bArmature *arm= (ob) ? ob->data : NULL;
bPoseChannel *pchan;
-
- if ELEM3(NULL, ob, ob->pose, arm)
+
+ if (ELEM3(NULL, ob, ob->pose, arm)) {
return NULL;
-
+ }
+
/* find active */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if ((pchan->bone) && (pchan->bone == arm->act_bone) && (pchan->bone->layer & arm->layer))
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index a9267be4cc4..fd3fb6815f0 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -397,7 +397,7 @@ void action_move_fcurves_by_basepath (bAction *srcAct, bAction *dstAct, const ch
FCurve *fcu, *fcn=NULL;
/* sanity checks */
- if ELEM3(NULL, srcAct, dstAct, basepath) {
+ if (ELEM3(NULL, srcAct, dstAct, basepath)) {
if (G.f & G_DEBUG) {
printf("ERROR: action_partition_fcurves_by_basepath(%p, %p, %p) has insufficient info to work with\n",
(void *)srcAct, (void *)dstAct, (void *)basepath);
@@ -478,7 +478,7 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
LinkData *ld;
/* sanity checks */
- if ELEM(NULL, srcID, dstID) {
+ if (ELEM(NULL, srcID, dstID)) {
if (G.f & G_DEBUG)
printf("ERROR: no source or destination ID to separate AnimData with\n");
return;
@@ -488,7 +488,7 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
srcAdt = BKE_animdata_from_id(srcID);
dstAdt = BKE_id_add_animdata(dstID);
- if ELEM(NULL, srcAdt, dstAdt) {
+ if (ELEM(NULL, srcAdt, dstAdt)) {
if (G.f & G_DEBUG)
printf("ERROR: no AnimData for this pair of ID's\n");
return;
@@ -903,7 +903,7 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[]
KS_Path *ksp;
/* sanity checks */
- if ELEM3(NULL, ks, rna_path, id)
+ if (ELEM3(NULL, ks, rna_path, id))
return NULL;
/* loop over paths in the current KeyingSet, finding the first one where all settings match
@@ -976,7 +976,7 @@ KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[],
KS_Path *ksp;
/* sanity checks */
- if ELEM(NULL, ks, rna_path) {
+ if (ELEM(NULL, ks, rna_path)) {
printf("ERROR: no Keying Set and/or RNA Path to add path with \n");
return NULL;
}
@@ -1028,7 +1028,7 @@ KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[],
void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp)
{
/* sanity check */
- if ELEM(NULL, ks, ksp)
+ if (ELEM(NULL, ks, ksp))
return;
/* free RNA-path info */
@@ -1338,7 +1338,7 @@ void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup
FCurve *fcu;
/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
- if ELEM(NULL, act, agrp) return;
+ if (ELEM(NULL, act, agrp)) return;
if ((remap) && (remap->target != act)) remap= NULL;
action_idcode_patch_check(ptr->id.data, act);
@@ -1710,14 +1710,14 @@ static void nlaeval_fmodifiers_join_stacks (ListBase *result, ListBase *list1, L
FModifier *fcm1, *fcm2;
/* if list1 is invalid... */
- if ELEM(NULL, list1, list1->first) {
+ if (ELEM(NULL, list1, list1->first)) {
if (list2 && list2->first) {
result->first= list2->first;
result->last= list2->last;
}
}
/* if list 2 is invalid... */
- else if ELEM(NULL, list2, list2->first) {
+ else if (ELEM(NULL, list2, list2->first)) {
result->first= list1->first;
result->last= list1->last;
}
@@ -1742,9 +1742,9 @@ static void nlaeval_fmodifiers_split_stacks (ListBase *list1, ListBase *list2)
FModifier *fcm1, *fcm2;
/* if list1/2 is invalid... just skip */
- if ELEM(NULL, list1, list2)
+ if (ELEM(NULL, list1, list2))
return;
- if ELEM(NULL, list1->first, list2->first)
+ if (ELEM(NULL, list1->first, list2->first))
return;
/* get endpoints */
@@ -2182,7 +2182,7 @@ void BKE_animsys_evaluate_animdata (Scene *scene, ID *id, AnimData *adt, float c
PointerRNA id_ptr;
/* sanity checks */
- if ELEM(NULL, id, adt)
+ if (ELEM(NULL, id, adt))
return;
/* get pointer to ID-block for RNA to use */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 7aae0d52fe7..9232fe8ec04 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1347,7 +1347,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
}
while (dl) {
- if ELEM(dl->type, DL_POLY, DL_SEGM) {
+ if (ELEM(dl->type, DL_POLY, DL_SEGM)) {
dlnew= MEM_mallocN(sizeof(DispList), "makebevelcurve1");
*dlnew= *dl;
dlnew->verts= MEM_mallocN(3*sizeof(float)*dl->parts*dl->nr, "makebevelcurve1");
@@ -2878,8 +2878,8 @@ void sethandlesNurb(ListBase *editnurb, short code)
if (bezt->f1 & SELECT) bezt->h1= code;
if (bezt->f3 & SELECT) bezt->h2= code;
if (bezt->h1!=bezt->h2) {
- if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE;
- if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE;
+ if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO)) bezt->h1 = HD_FREE;
+ if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO)) bezt->h2 = HD_FREE;
}
}
bezt++;
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 7a34df85bdc..692eadd6bd3 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -123,8 +123,9 @@ int displist_has_faces(ListBase *lb)
{
DispList *dl;
for (dl= lb->first; dl; dl= dl->next) {
- if ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)
+ if (ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
return 1;
+ }
}
return 0;
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 97e59df3353..5f1201ec378 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -156,7 +156,7 @@ void copy_fcurves (ListBase *dst, ListBase *src)
FCurve *dfcu, *sfcu;
/* sanity checks */
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
/* clear destination list first */
@@ -738,7 +738,7 @@ void fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampl
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
- if ELEM(NULL, fcu, sample_cb) {
+ if (ELEM(NULL, fcu, sample_cb)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;
}
@@ -834,7 +834,7 @@ void testhandles_fcurve (FCurve *fcu, const short use_handle)
unsigned int a;
/* only beztriples have handles (bpoints don't though) */
- if ELEM(NULL, fcu, fcu->bezt)
+ if (ELEM(NULL, fcu, fcu->bezt))
return;
/* loop over beztriples */
@@ -1001,7 +1001,7 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
float value= 0.0f;
/* sanity check */
- if ELEM(NULL, driver, dtar)
+ if (ELEM(NULL, driver, dtar))
return 0.0f;
id= dtar_id_ensure_proxy_from(dtar->id);
@@ -1075,7 +1075,7 @@ static bPoseChannel *dtar_get_pchan_ptr (ChannelDriver *driver, DriverTarget *dt
{
ID *id;
/* sanity check */
- if ELEM(NULL, driver, dtar)
+ if (ELEM(NULL, driver, dtar))
return NULL;
id= dtar_id_ensure_proxy_from(dtar->id);
@@ -1490,7 +1490,7 @@ void fcurve_free_driver(FCurve *fcu)
DriverVar *dvar, *dvarn;
/* sanity checks */
- if ELEM(NULL, fcu, fcu->driver)
+ if (ELEM(NULL, fcu, fcu->driver))
return;
driver= fcu->driver;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index bc587449853..693c036d124 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -590,7 +590,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
ofs= lastkey[0];
}
}
- if ELEM(0, side, mode)
+ if ((ELEM(0, side, mode)))
return evaltime;
/* find relative place within a cycle */
@@ -1000,7 +1000,7 @@ FModifier *add_fmodifier (ListBase *modifiers, int type)
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, fmi)
+ if (ELEM(NULL, modifiers, fmi))
return NULL;
/* special checks for whether modifier can be added */
@@ -1063,7 +1063,7 @@ void copy_fmodifiers (ListBase *dst, ListBase *src)
{
FModifier *fcm, *srcfcm;
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
dst->first= dst->last= NULL;
@@ -1134,7 +1134,7 @@ FModifier *find_active_fmodifier (ListBase *modifiers)
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return NULL;
/* loop over modifiers until 'active' one is found */
@@ -1153,7 +1153,7 @@ void set_active_fmodifier (ListBase *modifiers, FModifier *fcm)
FModifier *fm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return;
/* deactivate all, and set current one active */
@@ -1178,7 +1178,7 @@ short list_has_suitable_fmodifier (ListBase *modifiers, int mtype, short acttype
return (modifiers && modifiers->first);
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return 0;
/* find the first mdifier fitting these criteria */
@@ -1258,7 +1258,7 @@ float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue,
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->last)
+ if (ELEM(NULL, modifiers, modifiers->last))
return evaltime;
/* Starting from the end of the stack, calculate the time effects of various stacked modifiers
@@ -1307,7 +1307,7 @@ void evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue,
FModifier *fcm;
/* sanity checks */
- if ELEM(NULL, modifiers, modifiers->first)
+ if (ELEM(NULL, modifiers, modifiers->first))
return;
/* evaluate modifiers */
@@ -1345,7 +1345,7 @@ void fcurve_bake_modifiers (FCurve *fcu, int start, int end)
/* sanity checks */
// TODO: make these tests report errors using reports not printf's
- if ELEM(NULL, fcu, fcu->modifiers.first) {
+ if (ELEM(NULL, fcu, fcu->modifiers.first)) {
printf("Error: No F-Curve with F-Curve Modifiers to Bake\n");
return;
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 57a2dc41f74..c454acd7c81 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1518,7 +1518,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
ListBase drivers = {NULL, NULL};
/* sanity check */
- if ELEM(NULL, id, ipo)
+ if (ELEM(NULL, id, ipo))
return;
if (adt == NULL) {
printf("ERROR ipo_to_animdata(): adt invalid \n");
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 097e7a4eb5e..fe776bd5eae 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1466,7 +1466,7 @@ Key *ob_get_key(Object *ob)
Mesh *me= ob->data;
return me->key;
}
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
return cu->key;
}
@@ -1589,7 +1589,7 @@ char *key_get_curValue_rnaPath(Key *key, KeyBlock *kb)
PropertyRNA *prop;
/* sanity checks */
- if ELEM(NULL, key, kb)
+ if (ELEM(NULL, key, kb))
return NULL;
/* create the RNA pointer */
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index dd25092f7dd..f7351887b55 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -458,7 +458,7 @@ Material ***give_matarar(Object *ob)
me= ob->data;
return &(me->mat);
}
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
cu= ob->data;
return &(cu->mat);
}
@@ -479,7 +479,7 @@ short *give_totcolp(Object *ob)
me= ob->data;
return &(me->totcol);
}
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
+ else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
cu= ob->data;
return &(cu->totcol);
}
@@ -903,7 +903,7 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
ma->mapto |= mtex->mapto;
/* always get derivatives for these textures */
- if ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP) ma->texco |= TEXCO_OSA;
+ if (ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)) ma->texco |= TEXCO_OSA;
else if (mtex->texflag & (MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP)) ma->texco |= TEXCO_OSA;
if (ma->texco & (TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM|TEXCO_STRAND|TEXCO_STRESS)) needuv= 1;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index f67d3274b34..9c8bda97435 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -140,7 +140,7 @@ void free_nladata (ListBase *tracks)
NlaTrack *nlt, *nltn;
/* sanity checks */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return;
/* free tracks one by one */
@@ -221,7 +221,7 @@ void copy_nladata (ListBase *dst, ListBase *src)
NlaTrack *nlt, *nlt_d;
/* sanity checks */
- if ELEM(NULL, dst, src)
+ if (ELEM(NULL, dst, src))
return;
/* clear out the destination list first for precautions... */
@@ -319,7 +319,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, act)
+ if (ELEM(NULL, adt, act))
return NULL;
/* create a new NLA strip */
@@ -586,7 +586,7 @@ void BKE_nlastrips_sort_strips (ListBase *strips)
NlaStrip *strip, *sstrip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* we simply perform insertion sort on this list, since it is assumed that per track,
@@ -630,7 +630,7 @@ short BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip)
short not_added = 1;
/* sanity checks */
- if ELEM(NULL, strips, strip)
+ if (ELEM(NULL, strips, strip))
return 0;
/* check if any space to add */
@@ -668,7 +668,7 @@ void BKE_nlastrips_make_metas (ListBase *strips, short temp)
NlaStrip *strip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* group all continuous chains of selected strips into meta-strips */
@@ -719,7 +719,7 @@ void BKE_nlastrips_clear_metastrip (ListBase *strips, NlaStrip *strip)
NlaStrip *cs, *csn;
/* sanity check */
- if ELEM(NULL, strips, strip)
+ if (ELEM(NULL, strips, strip))
return;
/* move each one of the meta-strip's children before the meta-strip
@@ -744,7 +744,7 @@ void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp)
NlaStrip *strip, *stripn;
/* sanity checks */
- if ELEM(NULL, strips, strips->first)
+ if (ELEM(NULL, strips, strips->first))
return;
/* remove meta-strips fitting the criteria of the arguments */
@@ -769,7 +769,7 @@ void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp)
short BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip)
{
/* sanity checks */
- if ELEM(NULL, mstrip, strip)
+ if (ELEM(NULL, mstrip, strip))
return 0;
/* firstly, check if the meta-strip has space for this */
@@ -827,7 +827,7 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip)
* - strip must exist
* - strip must be a meta-strip with some contents
*/
- if ELEM(NULL, mstrip, mstrip->strips.first)
+ if (ELEM(NULL, mstrip, mstrip->strips.first))
return;
if (mstrip->type != NLASTRIP_TYPE_META)
return;
@@ -899,7 +899,7 @@ NlaTrack *BKE_nlatrack_find_active (ListBase *tracks)
NlaTrack *nlt;
/* sanity check */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return NULL;
/* try to find the first active track */
@@ -920,7 +920,7 @@ void BKE_nlatrack_solo_toggle (AnimData *adt, NlaTrack *nlt)
NlaTrack *nt;
/* sanity check */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* firstly, make sure 'solo' flag for all tracks is disabled */
@@ -952,7 +952,7 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a)
NlaTrack *nlt;
/* sanity check */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return;
/* deactive all the rest */
@@ -990,7 +990,7 @@ short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end)
void BKE_nlatrack_sort_strips (NlaTrack *nlt)
{
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return;
/* sort the strips with a more generic function */
@@ -1003,7 +1003,7 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt)
short BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip)
{
/* sanity checks */
- if ELEM(NULL, nlt, strip)
+ if (ELEM(NULL, nlt, strip))
return 0;
/* try to add the strip to the track using a more generic function */
@@ -1024,7 +1024,7 @@ short BKE_nlatrack_get_bounds (NlaTrack *nlt, float bounds[2])
return 0;
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return 0;
/* lower bound is first strip's start frame */
@@ -1047,7 +1047,7 @@ NlaStrip *BKE_nlastrip_find_active (NlaTrack *nlt)
NlaStrip *strip;
/* sanity check */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return NULL;
/* try to find the first active strip */
@@ -1146,7 +1146,7 @@ static short nlastrip_is_first (AnimData *adt, NlaStrip *strip)
NlaStrip *ns;
/* sanity checks */
- if ELEM(NULL, adt, strip)
+ if (ELEM(NULL, adt, strip))
return 0;
/* check if strip has any strips before it */
@@ -1176,7 +1176,7 @@ short BKE_nlatrack_has_animated_strips (NlaTrack *nlt)
NlaStrip *strip;
/* sanity checks */
- if ELEM(NULL, nlt, nlt->strips.first)
+ if (ELEM(NULL, nlt, nlt->strips.first))
return 0;
/* check each strip for F-Curves only (don't care about whether the flags are set) */
@@ -1195,7 +1195,7 @@ short BKE_nlatracks_have_animated_strips (ListBase *tracks)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, tracks, tracks->first)
+ if (ELEM(NULL, tracks, tracks->first))
return 0;
/* check each track, stopping on the first hit */
@@ -1279,7 +1279,7 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, strip)
+ if (ELEM(NULL, adt, strip))
return;
/* give strip a default name if none already */
@@ -1376,7 +1376,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
float *ns=NULL, *ne=NULL;
/* sanity checks */
- if ELEM(NULL, nls, nlt)
+ if (ELEM(NULL, nls, nlt))
return;
if ((nlt->prev == NULL) && (nlt->next == NULL))
return;
@@ -1422,7 +1422,7 @@ void BKE_nla_validate_state (AnimData *adt)
NlaTrack *nlt;
/* sanity checks */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* adjust blending values for auto-blending, and also do an initial pass to find the earliest strip */
@@ -1476,7 +1476,7 @@ void BKE_nla_action_pushdown (AnimData *adt)
/* sanity checks */
// TODO: need to report the error for this
- if ELEM(NULL, adt, adt->action)
+ if (ELEM(NULL, adt, adt->action))
return;
/* if the action is empty, we also shouldn't try to add to stack,
@@ -1524,7 +1524,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
NlaStrip *strip, *activeStrip=NULL;
/* verify that data is valid */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return 0;
/* if block is already in tweakmode, just leave, but we should report
@@ -1575,7 +1575,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
}
}
- if ELEM3(NULL, activeTrack, activeStrip, activeStrip->act) {
+ if (ELEM3(NULL, activeTrack, activeStrip, activeStrip->act)) {
if (G.f & G_DEBUG) {
printf("NLA tweakmode enter - neither active requirement found \n");
printf("\tactiveTrack = %p, activeStrip = %p \n", (void *)activeTrack, (void *)activeStrip);
@@ -1625,7 +1625,7 @@ void BKE_nla_tweakmode_exit (AnimData *adt)
NlaTrack *nlt;
/* verify that data is valid */
- if ELEM(NULL, adt, adt->nla_tracks.first)
+ if (ELEM(NULL, adt, adt->nla_tracks.first))
return;
/* hopefully the flag is correct - skip if not on */
@@ -1667,7 +1667,7 @@ static void UNUSED_FUNCTION(BKE_nla_bake) (Scene *scene, ID *UNUSED(id), AnimDat
* 1) Scene and AnimData must be provided
* 2) there must be tracks to merge...
*/
- if ELEM3(NULL, scene, adt, adt->nla_tracks.first)
+ if (ELEM3(NULL, scene, adt, adt->nla_tracks.first))
return;
/* if animdata currently has an action, 'push down' this onto the stack first */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 4a9b4978705..178c69af4d6 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -413,7 +413,7 @@ void unlink_object(Object *ob)
modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob);
- if ELEM(obt->type, OB_CURVE, OB_FONT) {
+ if (ELEM(obt->type, OB_CURVE, OB_FONT)) {
cu= obt->data;
if (cu->bevobj==ob) {
@@ -2950,11 +2950,19 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int
}
KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
-{
- if (ob->type==OB_MESH) return insert_meshkey(scene, ob, name, from_mix);
- else if ELEM(ob->type, OB_CURVE, OB_SURF)return insert_curvekey(scene, ob, name, from_mix);
- else if (ob->type==OB_LATTICE) return insert_lattkey(scene, ob, name, from_mix);
- else return NULL;
+{
+ switch (ob->type) {
+ case OB_MESH:
+ return insert_meshkey(scene, ob, name, from_mix);
+ case OB_CURVE:
+ case OB_SURF:
+ return insert_curvekey(scene, ob, name, from_mix);
+ case OB_LATTICE:
+ return insert_lattkey(scene, ob, name, from_mix);
+ default:
+ return NULL;
+ }
+
}
/* most important if this is modified it should _always_ return True, in certain