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:
authorJacques Lucke <jacques@blender.org>2020-09-09 16:43:09 +0300
committerJacques Lucke <jacques@blender.org>2020-09-09 16:43:27 +0300
commitddf4f2896878e3fd4a0f79d712a5e7b900b0cf7e (patch)
tree34d7b7b95eac92c2ab9bc596b1dd113fd2334381 /source/blender/blenkernel/intern/colortools.c
parent842f52d418aaccae45c8e400eb0a8bddef0dbb51 (diff)
Cleanup: reduce variable scope
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 09731c15c0a..77a29bf41b8 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -347,8 +347,7 @@ void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope
cuma->curve[1].y = 1;
break;
case CURVE_PRESET_MID9: {
- int i;
- for (i = 0; i < cuma->totpoint; i++) {
+ for (int i = 0; i < cuma->totpoint; i++) {
cuma->curve[i].x = i / ((float)cuma->totpoint - 1);
cuma->curve[i].y = 0.5;
}
@@ -421,8 +420,7 @@ void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope
const int num_points = cuma->totpoint * 2 - 1;
CurveMapPoint *new_points = MEM_mallocN(num_points * sizeof(CurveMapPoint),
"curve symmetric points");
- int i;
- for (i = 0; i < cuma->totpoint; i++) {
+ for (int i = 0; i < cuma->totpoint; i++) {
const int src_last_point = cuma->totpoint - i - 1;
const int dst_last_point = num_points - i - 1;
new_points[i] = cuma->curve[src_last_point];
@@ -969,12 +967,9 @@ void BKE_curvemapping_changed_all(CurveMapping *cumap)
/* table should be verified */
float BKE_curvemap_evaluateF(const CurveMapping *cumap, const CurveMap *cuma, float value)
{
- float fi;
- int i;
-
/* index in table */
- fi = (value - cuma->mintable) * cuma->range;
- i = (int)fi;
+ float fi = (value - cuma->mintable) * cuma->range;
+ int i = (int)fi;
/* fi is table float index and should check against table range i.e. [0.0 CM_TABLE] */
if (fi < 0.0f || fi > CM_TABLE) {