summaryrefslogtreecommitdiff
path: root/backend/avision.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
commite0d94cf4d39395df1e2c6bb4d967200298c13881 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /backend/avision.h
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
Update upstream source from tag 'upstream/1.2.1'
Update to upstream version '1.2.1' with Debian dir a9bb43f754a5c9a361b076af3635cc767b7e652e
Diffstat (limited to 'backend/avision.h')
-rw-r--r--backend/avision.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/backend/avision.h b/backend/avision.h
index aed6d9e..d2d84ef 100644
--- a/backend/avision.h
+++ b/backend/avision.h
@@ -502,7 +502,6 @@ typedef struct Avision_Scanner
/* Internal data for duplex scans */
char duplex_rear_fname [PATH_MAX];
- char duplex_offtmp_fname [PATH_MAX];
SANE_Bool duplex_rear_valid;
color_mode c_mode;
@@ -795,17 +794,17 @@ typedef struct acceleration_info
/* set/get SCSI highended (big-endian) variables. Declare them as an array
* of chars endianness-safe, int-size safe ... */
-#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
- var[1] = ((val) ) & 0xff
+#define set_double(var,val) var[0] = (uint8_t) (((val) >> 8) & 0xff); \
+ var[1] = (uint8_t) (((val) ) & 0xff)
-#define set_triple(var,val) var[0] = ((val) >> 16) & 0xff; \
- var[1] = ((val) >> 8 ) & 0xff; \
- var[2] = ((val) ) & 0xff
+#define set_triple(var,val) var[0] = (uint8_t) (((val) >> 16) & 0xff); \
+ var[1] = (uint8_t) (((val) >> 8 ) & 0xff); \
+ var[2] = (uint8_t) (((val) ) & 0xff)
-#define set_quad(var,val) var[0] = ((val) >> 24) & 0xff; \
- var[1] = ((val) >> 16) & 0xff; \
- var[2] = ((val) >> 8 ) & 0xff; \
- var[3] = ((val) ) & 0xff
+#define set_quad(var,val) var[0] = (uint8_t) (((val) >> 24) & 0xff); \
+ var[1] = (uint8_t) (((val) >> 16) & 0xff); \
+ var[2] = (uint8_t) (((val) >> 8 ) & 0xff); \
+ var[3] = (uint8_t) (((val) ) & 0xff)
#define get_double(var) ((*var << 8) + *(var + 1))
@@ -817,10 +816,10 @@ typedef struct acceleration_info
(*(var + 2) << 8) + *(var + 3))
/* set/get Avision lowended (little-endian) shading data */
-#define set_double_le(var,val) var[0] = ((val) ) & 0xff; \
- var[1] = ((val) >> 8) & 0xff
+#define set_double_le(var,val) var[0] = (uint8_t) (((val) ) & 0xff); \
+ var[1] = (uint8_t) (((val) >> 8) & 0xff)
-#define get_double_le(var) ((*(var + 1) << 8) + *var)
+#define get_double_le(var) ((uint16_t) ((*(var + 1) << 8) + *(var)))
#define BIT(n, p) ((n & (1 << p)) ? 1 : 0)