diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-09 19:41:07 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-09 19:41:07 +0300 |
commit | 63916f5941b443dfc8566682bb75374e5abd553f (patch) | |
tree | fb0704701f1d4d9acbddf4a6fbc62c819d8d4c36 /source/blender/editors/animation/keyframing.c | |
parent | 0cff2c944f9c2cd3ac873fe826c4399fc2f32159 (diff) |
Cleanup: reduce variable scope
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 66d4882cf9d..fb4c0ae0758 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -618,22 +618,19 @@ enum { */ static short new_key_needed(FCurve *fcu, float cFrame, float nValue) { - BezTriple *bezt = NULL, *prev = NULL; - int totCount, i; - float valA = 0.0f, valB = 0.0f; - /* safety checking */ if (fcu == NULL) { return KEYNEEDED_JUSTADD; } - totCount = fcu->totvert; + int totCount = fcu->totvert; if (totCount == 0) { return KEYNEEDED_JUSTADD; } /* loop through checking if any are the same */ - bezt = fcu->bezt; - for (i = 0; i < totCount; i++) { + BezTriple *bezt = fcu->bezt; + BezTriple *prev = NULL; + for (int i = 0; i < totCount; i++) { float prevPosi = 0.0f, prevVal = 0.0f; float beztPosi = 0.0f, beztVal = 0.0f; @@ -712,8 +709,8 @@ static short new_key_needed(FCurve *fcu, float cFrame, float nValue) * keyframe is not equal to last keyframe. */ bezt = (fcu->bezt + (fcu->totvert - 1)); - valA = bezt->vec[1][1]; - + float valA = bezt->vec[1][1]; + float valB; if (prev) { valB = prev->vec[1][1]; } |