diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 23:39:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 23:39:14 +0400 |
commit | 63caaa2b12edf0e0a47764156416fac9d43d3664 (patch) | |
tree | 39d9455df141edc2f232240da34514b0468dcc28 /source/blender/editors/curve/editcurve.c | |
parent | 5928af11ef97d6d9318d3a06fe32f0d77fc48e9c (diff) |
Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 07614fe347a..def0d3cba50 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2307,11 +2307,12 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op)) BezTriple *bezt, *beztOrig; BPoint *bp, *bpOrig; float val, newval, offset; - int a, i, change = 0; + int a, i; + bool changed = false; for (nu = editnurb->first; nu; nu = nu->next) { if (nu->bezt) { - change = 0; + changed = false; beztOrig = MEM_dupallocN(nu->bezt); for (bezt = &nu->bezt[1], a = 1; a < nu->pntsu - 1; a++, bezt++) { if (bezt->f2 & SELECT) { @@ -2324,12 +2325,13 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op)) bezt->vec[0][i] += offset; bezt->vec[2][i] += offset; } - change = 1; + changed = true; } } MEM_freeN(beztOrig); - if (change) + if (changed) { BKE_nurb_handles_calc(nu); + } } else if (nu->bp) { bpOrig = MEM_dupallocN(nu->bp); @@ -3568,7 +3570,7 @@ static int set_spline_type_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); ListBase *editnurb = object_editcurve_get(obedit); Nurb *nu; - bool change = false; + bool changed = false; const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); const int type = RNA_enum_get(op->ptr, "type"); @@ -3582,11 +3584,11 @@ static int set_spline_type_exec(bContext *C, wmOperator *op) if (BKE_nurb_type_convert(nu, type, use_handles) == false) BKE_report(op->reports, RPT_ERROR, "No conversion possible"); else - change = true; + changed = true; } } - if (change) { + if (changed) { if (ED_curve_updateAnimPaths(obedit->data)) WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit); |