diff --git a/backend/hp3900_rts8822.c b/backend/hp3900_rts8822.c index c818b89c9..823abc23b 100644 --- a/backend/hp3900_rts8822.c +++ b/backend/hp3900_rts8822.c @@ -4856,8 +4856,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg, { /*d4df */ diff_max = color_dif[cnt]; - if (abs (color_dif[cnt] - color_dif[cnt - 1]) > - abs (color_dif[coord] - color_dif[coord - 1])) + if (fabs (color_dif[cnt] - color_dif[cnt - 1]) > + fabs (color_dif[coord] - color_dif[coord - 1])) coord = cnt; } @@ -4907,8 +4907,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg, if ((color_dif[cnt] >= 0) && (color_dif[cnt] > diff_max)) { diff_max = color_dif[cnt]; - if (abs (color_dif[cnt] - color_dif[cnt - 1]) > - abs (color_dif[coord] - color_dif[coord - 1])) + if (fabs (color_dif[cnt] - color_dif[cnt - 1]) > + fabs (color_dif[coord] - color_dif[coord - 1])) coord = cnt; } @@ -4954,8 +4954,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg, if ((color_dif[cnt] >= 0) && (color_dif[cnt] > diff_max)) { diff_max = color_dif[cnt]; - if (abs (color_dif[cnt] - color_dif[cnt - 1]) > - abs (color_dif[coord] - color_dif[coord - 1])) + if (fabs (color_dif[cnt] - color_dif[cnt - 1]) > + fabs (color_dif[coord] - color_dif[coord - 1])) coord = cnt; } diff --git a/backend/rts8891.c b/backend/rts8891.c index fa5d17a23..4921d31dc 100644 --- a/backend/rts8891.c +++ b/backend/rts8891.c @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -4778,7 +4779,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) global, ra, ga, ba); /* dichotomie ... */ - if (abs (ra - DARK_TARGET) < DARK_MARGIN) + if (fabs (ra - DARK_TARGET) < DARK_MARGIN) { /* offset is OK */ tro = ro; @@ -4800,7 +4801,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) } /* same for blue channel */ - if (abs (ba - DARK_TARGET) < DARK_MARGIN) + if (fabs (ba - DARK_TARGET) < DARK_MARGIN) { bbo = bo; tbo = bo; @@ -4821,7 +4822,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) } /* and for green channel */ - if (abs (ga - DARK_TARGET) < DARK_MARGIN) + if (fabs (ga - DARK_TARGET) < DARK_MARGIN) { tgo = go; bgo = go; @@ -5084,7 +5085,7 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light) global, ra, ga, ba); /* dichotomy again ... */ - if (abs (ra - RED_GAIN_TARGET) < GAIN_MARGIN) + if (fabs (ra - RED_GAIN_TARGET) < GAIN_MARGIN) { /* gain is OK, it is whitin the tolerance margin */ trg = rg; @@ -5125,7 +5126,7 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light) } /* same for blue channel */ - if (abs (ba - BLUE_GAIN_TARGET) < GAIN_MARGIN) + if (fabs (ba - BLUE_GAIN_TARGET) < GAIN_MARGIN) { bbg = bg; tbg = bg; @@ -5161,7 +5162,7 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light) } /* and for green channel */ - if (abs (ga - GREEN_GAIN_TARGET) < GAIN_MARGIN) + if (fabs (ga - GREEN_GAIN_TARGET) < GAIN_MARGIN) { tgg = gg; bgg = gg; @@ -5367,7 +5368,7 @@ offset_calibration (struct Rts8891_Device *dev, int mode, int light) global, ra, ga, ba); /* dichotomie ... */ - if (abs (ra - OFFSET_TARGET) < OFFSET_MARGIN) + if (fabs (ra - OFFSET_TARGET) < OFFSET_MARGIN) { /* offset is OK */ tro = ro; @@ -5389,7 +5390,7 @@ offset_calibration (struct Rts8891_Device *dev, int mode, int light) } /* same for blue channel */ - if (abs (ba - OFFSET_TARGET) < OFFSET_MARGIN) + if (fabs (ba - OFFSET_TARGET) < OFFSET_MARGIN) { bbo = bo; tbo = bo; @@ -5410,7 +5411,7 @@ offset_calibration (struct Rts8891_Device *dev, int mode, int light) } /* and for green channel */ - if (abs (ga - OFFSET_TARGET) < OFFSET_MARGIN) + if (fabs (ga - OFFSET_TARGET) < OFFSET_MARGIN) { tgo = go; bgo = go;