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:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-02-07 14:00:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-02-07 14:01:50 +0300
commit28cd16ec448f57b863f8be0a8f5d303d94bc1f1f (patch)
tree9a1f5ea9db62095ab281fa29accafa13ca5ca2c1 /source/blender/blenkernel/intern/tracking_region_tracker.c
parent0f7a90d4ad2c144b82679c24020e1338a3fc7cef (diff)
Cleanup: Tracking, reduce scope of variables
Mainly affects for() loops. The reason why loop parameter was declared outside of the loop roots back to the times when not all compilers supported C99.
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_region_tracker.c')
-rw-r--r--source/blender/blenkernel/intern/tracking_region_tracker.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.c b/source/blender/blenkernel/intern/tracking_region_tracker.c
index 1d6bb88c3f4..967642c03a8 100644
--- a/source/blender/blenkernel/intern/tracking_region_tracker.c
+++ b/source/blender/blenkernel/intern/tracking_region_tracker.c
@@ -50,9 +50,7 @@ static void float_rgba_to_gray(const float *rgba,
float weight_green,
float weight_blue)
{
- int i;
-
- for (i = 0; i < num_pixels; i++) {
+ for (int i = 0; i < num_pixels; i++) {
const float *pixel = rgba + 4 * i;
gray[i] = weight_red * pixel[0] + weight_green * pixel[1] + weight_blue * pixel[2];
@@ -66,9 +64,7 @@ static void uint8_rgba_to_float_gray(const unsigned char *rgba,
float weight_green,
float weight_blue)
{
- int i;
-
- for (i = 0; i < num_pixels; i++) {
+ for (int i = 0; i < num_pixels; i++) {
const unsigned char *pixel = rgba + i * 4;
gray[i] = (weight_red * pixel[0] + weight_green * pixel[1] + weight_blue * pixel[2]) / 255.0f;