From 5b3e0b7fc7e64bd589fcf87ea908b6fdf01d3a38 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 3 Dec 2013 20:29:44 +0100 Subject: [PATCH] Some consts here and there --- render.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/render.c b/render.c index d98f03d..a5bee64 100644 --- a/render.c +++ b/render.c @@ -497,17 +497,17 @@ emit_completed_signal(void* data) static double colorumax(const double* h, double l, double l1, double l2) { - double u, uu, v, vv, lv; if (h[0] == 0 && h[1] == 0 && h[2] == 0) { return 0; } - lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */ - u = v = 1000000; + const double lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */ + double u = 1000000; + double v = u; for (int k = 0; k < 3; k++) { if (h[k] > 0) { - uu = fabs((1-l)/h[k]); - vv = fabs((1-lv)/h[k]); + const double uu = fabs((1-l)/h[k]); + const double vv = fabs((1-lv)/h[k]); if (uu < u) { u = uu; @@ -516,8 +516,8 @@ colorumax(const double* h, double l, double l1, double l2) v = vv; } } else if (h[k] < 0) { - uu = fabs(l/h[k]); - vv = fabs(lv/h[k]); + const double uu = fabs(l/h[k]); + const double vv = fabs(lv/h[k]); if (uu < u) { u = uu;