mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 21:26:01 +01:00
Some consts here and there
This commit is contained in:
parent
60001b2ede
commit
5b3e0b7fc7
1 changed files with 7 additions and 7 deletions
14
render.c
14
render.c
|
@ -497,17 +497,17 @@ emit_completed_signal(void* data)
|
||||||
static double
|
static double
|
||||||
colorumax(const double* h, double l, double l1, double l2)
|
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) {
|
if (h[0] == 0 && h[1] == 0 && h[2] == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */
|
const double lv = (l - l1)/(l2 - l1); /* Remap l to the whole interval 0,1 */
|
||||||
u = v = 1000000;
|
double u = 1000000;
|
||||||
|
double v = u;
|
||||||
for (int k = 0; k < 3; k++) {
|
for (int k = 0; k < 3; k++) {
|
||||||
if (h[k] > 0) {
|
if (h[k] > 0) {
|
||||||
uu = fabs((1-l)/h[k]);
|
const double uu = fabs((1-l)/h[k]);
|
||||||
vv = fabs((1-lv)/h[k]);
|
const double vv = fabs((1-lv)/h[k]);
|
||||||
|
|
||||||
if (uu < u) {
|
if (uu < u) {
|
||||||
u = uu;
|
u = uu;
|
||||||
|
@ -516,8 +516,8 @@ colorumax(const double* h, double l, double l1, double l2)
|
||||||
v = vv;
|
v = vv;
|
||||||
}
|
}
|
||||||
} else if (h[k] < 0) {
|
} else if (h[k] < 0) {
|
||||||
uu = fabs(l/h[k]);
|
const double uu = fabs(l/h[k]);
|
||||||
vv = fabs(lv/h[k]);
|
const double vv = fabs(lv/h[k]);
|
||||||
|
|
||||||
if (uu < u) {
|
if (uu < u) {
|
||||||
u = uu;
|
u = uu;
|
||||||
|
|
Loading…
Reference in a new issue