summaryrefslogtreecommitdiff
path: root/backend/rts8891.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:35:53 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:35:53 +0100
commit84357741a6a6e6430f199b2c3f7498e0e97da9ad (patch)
tree23e8d66ede9506b94c76fb36910ca3c7dd15c74e /backend/rts8891.c
parent302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff)
New upstream version 1.2.1upstream/1.2.1upstream
Diffstat (limited to 'backend/rts8891.c')
-rw-r--r--backend/rts8891.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/backend/rts8891.c b/backend/rts8891.c
index fa5d17a..2732871 100644
--- a/backend/rts8891.c
+++ b/backend/rts8891.c
@@ -76,6 +76,7 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
+#include <math.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -306,7 +307,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
SANE_Status status;
- authorize = authorize; /* get rid of compiler warning */
+ (void) authorize; /* get rid of compiler warning */
/* init ASIC libraries */
sanei_rts88xx_lib_init ();
@@ -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;