summaryrefslogtreecommitdiff
path: root/backend/avision.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
commit778ebf8ee9cb22ea5727844333bcd5a6ee6bc0de (patch)
treea754e785b286ed82b45fe4e50b980714ad80e0a7 /backend/avision.h
parent7d8aac1f3634dc58785bec7acf097dd6bac8c394 (diff)
parent32cb765f681299af226ca0520993cbe47ba5ecd0 (diff)
Merge branch 'release/debian/1.2.1-1'debian/1.2.1-1
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)