From 84357741a6a6e6430f199b2c3f7498e0e97da9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 12 Feb 2023 17:35:53 +0100 Subject: New upstream version 1.2.1 --- backend/avision.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'backend/avision.h') 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) -- cgit v1.2.3