From a77edab3209a99c7c8f8294d64d25c994cb67f44 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jul 2015 16:57:18 +1000 Subject: Cleanup: use bools --- source/blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 10 +++++----- source/blender/editors/transform/transform_conversions.c | 6 +++--- source/blender/editors/util/ed_transverts.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 75f5eb17b09..ca8a35e4ed9 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -902,7 +902,7 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode) { /* hidden items should be skipped if we only care about visible data, but we aren't interested in hidden stuff */ - short skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN); + const bool skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN); if (GS(owner_id->name) == ID_OB) { Object *ob = (Object *)owner_id; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 4d37fcc9276..745774577be 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -273,7 +273,7 @@ static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc) /* main call for drawing a single NLA-strip */ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) { - short nonSolo = ((adt && (adt->flag & ADT_NLA_SOLO_TRACK)) && (nlt->flag & NLATRACK_SOLO) == 0); + const bool non_solo = ((adt && (adt->flag & ADT_NLA_SOLO_TRACK)) && (nlt->flag & NLATRACK_SOLO) == 0); float color[3]; /* get color of strip */ @@ -282,7 +282,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri /* draw extrapolation info first (as backdrop) * - but this should only be drawn if track has some contribution */ - if ((strip->extendmode != NLASTRIP_EXTEND_NOTHING) && (nonSolo == 0)) { + if ((strip->extendmode != NLASTRIP_EXTEND_NOTHING) && (non_solo == 0)) { /* enable transparency... */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -337,7 +337,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri /* draw 'inside' of strip itself */ - if (nonSolo == 0) { + if (non_solo == 0) { /* strip is in normal track */ glColor3fv(color); UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ @@ -424,7 +424,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri /* add the relevant text to the cache of text-strings to draw in pixelspace */ static void nla_draw_strip_text(AnimData *adt, NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) { - short notSolo = ((adt && (adt->flag & ADT_NLA_SOLO_TRACK)) && (nlt->flag & NLATRACK_SOLO) == 0); + const bool non_solo = ((adt && (adt->flag & ADT_NLA_SOLO_TRACK)) && (nlt->flag & NLATRACK_SOLO) == 0); char str[256]; size_t str_len; char col[4]; @@ -448,7 +448,7 @@ static void nla_draw_strip_text(AnimData *adt, NlaTrack *nlt, NlaStrip *strip, i } /* text opacity depends on whether if there's a solo'd track, this isn't it */ - if (notSolo == 0) + if (non_solo == 0) col[3] = 255; else col[3] = 128; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c9e7e085a96..cae1fca9a79 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3290,7 +3290,7 @@ static void posttrans_mask_clean(Mask *mask) /* Called during special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). */ -static void posttrans_fcurve_clean(FCurve *fcu, const short use_handle) +static void posttrans_fcurve_clean(FCurve *fcu, const bool use_handle) { float *selcache; /* cache for frame numbers of selected frames (fcu->totvert*sizeof(float)) */ int len, index, i; /* number of frames in cache, item index */ @@ -4498,7 +4498,7 @@ void remake_graph_transdata(TransInfo *t, ListBase *anim_data) { SpaceIpo *sipo = (SpaceIpo *)t->sa->spacedata.first; bAnimListElem *ale; - const short use_handle = !(sipo->flag & SIPO_NOHANDLES); + const bool use_handle = (sipo->flag & SIPO_NOHANDLES) == 0; /* sort and reassign verts */ for (ale = anim_data->first; ale; ale = ale->next) { @@ -6151,7 +6151,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) else if (t->spacetype == SPACE_IPO) { SpaceIpo *sipo = (SpaceIpo *)t->sa->spacedata.first; bAnimContext ac; - const short use_handle = !(sipo->flag & SIPO_NOHANDLES); + const bool use_handle = (sipo->flag & SIPO_NOHANDLES) == 0; /* initialize relevant anim-context 'context' data */ if (ANIM_animdata_get_context(C, &ac) == 0) diff --git a/source/blender/editors/util/ed_transverts.c b/source/blender/editors/util/ed_transverts.c index c3eef94f4bb..b0970cdfd48 100644 --- a/source/blender/editors/util/ed_transverts.c +++ b/source/blender/editors/util/ed_transverts.c @@ -318,9 +318,9 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const for (ebo = arm->edbo->first; ebo; ebo = ebo->next) { if (ebo->layer & arm->layer) { - short tipsel = (ebo->flag & BONE_TIPSEL); - short rootsel = (ebo->flag & BONE_ROOTSEL); - short rootok = (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && (ebo->parent->flag & BONE_TIPSEL))); + const bool tipsel = (ebo->flag & BONE_TIPSEL) != 0; + const bool rootsel = (ebo->flag & BONE_ROOTSEL) != 0; + const bool rootok = (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && (ebo->parent->flag & BONE_TIPSEL))); if ((tipsel && rootsel) || (rootsel)) { /* Don't add the tip (unless mode & TM_ALL_JOINTS, for getting all joints), -- cgit v1.2.3