diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:35:53 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:35:53 +0100 |
commit | 84357741a6a6e6430f199b2c3f7498e0e97da9ad (patch) | |
tree | 23e8d66ede9506b94c76fb36910ca3c7dd15c74e /backend/avision.h | |
parent | 302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff) |
New upstream version 1.2.1upstream/1.2.1upstream
Diffstat (limited to 'backend/avision.h')
-rw-r--r-- | backend/avision.h | 25 |
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) |