Merge branch 'resolve-compiler-warnings' into 'master'

Resolve compiler warnings (including fixes for actual bugs)

See merge request sane-project/backends!701
escl-add-user-and-password
Ralph Little 2022-03-19 16:19:54 +00:00
commit ad08e768be
116 zmienionych plików z 631 dodań i 707 usunięć

Wyświetl plik

@ -236,8 +236,8 @@ wait_ready (int fd)
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
switch (result[2] & 0x0F)
{
@ -850,7 +850,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
@ -915,7 +915,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
Abaton_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);
@ -1399,7 +1399,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
status = sanei_scsi_cmd (s->fd, test_unit_ready,
sizeof (test_unit_ready), 0, 0);
if (status != SANE_STATUS_GOOD || status != SANE_STATUS_INVAL)
if (status != SANE_STATUS_GOOD && status != SANE_STATUS_INVAL)
return status;
return SANE_STATUS_CANCELLED;
}
@ -1472,8 +1472,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle; /* silence gcc */
non_blocking = non_blocking; /* silence gcc */
(void) handle; /* silence gcc */
(void) non_blocking; /* silence gcc */
DBG (FLOW_CONTROL, "sane_set_io_mode: Don't call me please. "
"Unimplemented function\n");
@ -1483,8 +1483,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
"Unimplemented function\n");

Wyświetl plik

@ -236,8 +236,8 @@ test_ready (int fd)
static SANE_Status
sense_handler (int scsi_fd, u_char *result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
if (result[0])
{
@ -253,7 +253,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
static SANE_Status
stop_scan (int fd)
{
fd = fd; /* silence gcc */
(void) fd; /* silence gcc */
/* XXX don't know how to stop the scanner. To be tested ! */
#if 0
@ -1280,7 +1280,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
@ -1335,7 +1335,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
AgfaFocus_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);

Wyświetl plik

@ -328,8 +328,8 @@ return SANE_STATUS_GOOD;
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
switch (result[2] & 0x0F)
{
@ -1866,7 +1866,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
@ -1930,7 +1930,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
Apple_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);
@ -2667,7 +2667,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
DBG (FLOW_CONTROL,"sane_set_io_mode: Entering.\n");
handle = handle; /* silence gcc */
(void) handle; /* silence gcc */
if (non_blocking)
{
@ -2682,8 +2682,8 @@ return SANE_STATUS_GOOD;
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
"Unimplemented function\n");

Wyświetl plik

@ -3474,7 +3474,7 @@ artec_sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int
SANE_Byte line_buf[ARTEC_MAX_READ_SIZE];
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
*len = 0;
@ -3674,7 +3674,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
static SANE_Byte temp_buf[ARTEC_MAX_READ_SIZE];
static int bytes_in_buf = 0;
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
DBG (9, "sane_read: bib = %d, ml = %d\n", bytes_in_buf, max_len);
if (bytes_in_buf != 0)

Wyświetl plik

@ -351,9 +351,6 @@ static void
finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
{
unsigned int i, j, cnt, c, div;
unsigned long max_r;
unsigned long max_g;
unsigned long max_b;
unsigned char *shading_buffer;
cnt = 0;
@ -379,18 +376,12 @@ finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
++cnt;
}
}
max_r = 0;
max_g = 0;
max_b = 0;
for (c = 0; c < (30720 * s->dev->epro_mult) - 5; c += 6) /*epro*/
{
i = (int) shading_buffer[c] + ((int) shading_buffer[c + 1] << 8);
max_r += i;
i = (int) shading_buffer[c + 2] + ((int) shading_buffer[c + 3] << 8);
max_g += i;
i = (int) shading_buffer[c + 4] + ((int) shading_buffer[c + 5] << 8);
max_b += i;
}
}
@ -1628,7 +1619,7 @@ artec48u_device_memory_read (Artec48U_Device * dev,
SANE_Status status;
XDBG ((8, "%s: dev=%p, addr=0x%x, size=0x%x, data=%p\n",
function_name, (void *) dev, addr, size, data));
function_name, (void *) dev, addr, size, (void *) data));
CHECK_DEV_ACTIVE (dev, function_name);
status = sanei_usb_control_msg (dev->fd, 0xc0, 0x01,

Wyświetl plik

@ -2158,8 +2158,8 @@ sense_handler (int fd, u_char* sense, void* arg)
uint8_t sense_key = sense[2] & 0xf;
uint8_t additional_sense = sense[7];
fd = fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) fd; /* silence gcc */
(void) arg; /* silence gcc */
DBG (3, "sense_handler:\n");
@ -3587,12 +3587,12 @@ get_and_parse_nvram (Avision_Scanner* s, char* str, int n)
i += snprintf (str+i, n-i, "\nSerial: %.24s",
nvram.serial);
if (nvram.born_year)
if (get_double(nvram.born_year))
i += snprintf (str+i, n-i, "\nManufacturing date: %d-%d-%d",
get_double(nvram.born_year),
get_double(nvram.born_month),
get_double(nvram.born_day));
if (nvram.first_scan_year)
if (get_double(nvram.first_scan_year))
i += snprintf (str+i, n-i, "\nFirst scan date: %d-%d-%d",
get_double(nvram.first_scan_year),
get_double(nvram.first_scan_month),
@ -8451,7 +8451,7 @@ sane_reload_devices (void)
SANE_Status
sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT();
@ -8500,7 +8500,7 @@ sane_get_devices (const SANE_Device*** device_list, SANE_Bool local_only)
Avision_Device* dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
DBG (3, "sane_get_devices:\n");

Wyświetl plik

@ -1979,7 +1979,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
SANE_Status status = SANE_STATUS_INVAL;
SANE_Char print_sense[(16 * 3) + 1];
scsi_fd = scsi_fd; /* get rid of compiler warning */
(void) scsi_fd; /* get rid of compiler warning */
ErrorCode = result[0] & 0x7F;
ValidData = (result[0] & 0x80) != 0;
sense = result[2] & 0x0f; /* Key */
@ -3145,7 +3145,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
char devnam[PATH_MAX] = "/dev/scanner";
FILE *fp;
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT();
DBG(3, "sane_init called\n");
@ -3233,7 +3233,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local)
int i;
DBG(3, "sane_get_devices called\n");
local = local; /* get rid of compiler warning */
(void) local; /* get rid of compiler warning */
if (devlist)
free (devlist);
devlist = malloc ((num_devices + 1) * sizeof (devlist[0]));
@ -3806,7 +3806,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
return SANE_STATUS_GOOD;
#else
handle = handle; /* get rid of compiler warning */
(void) handle; /* get rid of compiler warning */
return (non_blocking == 1) ? SANE_STATUS_UNSUPPORTED : SANE_STATUS_GOOD;
#endif
}
@ -3828,7 +3828,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
return SANE_STATUS_GOOD;
#else
handle = handle; fd = fd; /* get rid of compiler warning */
(void) handle; (void) fd; /* get rid of compiler warning */
return SANE_STATUS_UNSUPPORTED;
#endif
}

Wyświetl plik

@ -817,13 +817,12 @@ attach (const char *devnam, CANON_Device ** devp)
dev->sane.name = strdup (devnam);
dev->sane.vendor = "CANON";
if ((str = calloc (16 + 1, 1)) == NULL)
if ((str = strndup ((char *) ibuf + 16, 16)) == NULL)
{
sanei_scsi_close (fd);
fd = -1;
return (SANE_STATUS_NO_MEM);
}
strncpy (str, (char *) (ibuf + 16), 16);
dev->sane.model = str;
/* Register the fixed properties of the scanner below:

Wyświetl plik

@ -1546,7 +1546,7 @@ CANON_open_device (CANON_Handle * scan, const char *dev)
static const char *
CANON_get_device_name (CANON_Handle * scanner)
{
scanner = scanner; /* Eliminate warning about unused parameters */
(void) scanner; /* Eliminate warning about unused parameters */
return "Canoscan FB630U";
}

Wyświetl plik

@ -133,9 +133,9 @@ static SANE_Status
optionNumOptionsCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
if (action != SANE_ACTION_GET_VALUE)
return SANE_STATUS_INVAL;
@ -168,8 +168,8 @@ static SANE_Status
optionCalibrateCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle;
option = option; /* Eliminate warning about unused parameters */
(void) handle;
(void) option; /* Eliminate warning about unused parameters */
switch (action)
{
@ -221,7 +221,7 @@ optionResolutionCallback (SANE_Option * option, SANE_Handle handle,
SANE_Status status;
SANE_Word autoValue = 75;
handle = handle; /* Eliminate warning about unused parameters */
(void) handle; /* Eliminate warning about unused parameters */
switch (action)
{
@ -268,8 +268,8 @@ static SANE_Status
optionGrayscaleCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle;
option = option; /* Eliminate warning about unused parameters */
(void) handle;
(void) option; /* Eliminate warning about unused parameters */
switch (action)
{
@ -315,9 +315,9 @@ static SANE_Status
optionAGainCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
switch (action)
{
@ -357,9 +357,9 @@ static SANE_Status
optionGammaCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
switch (action)
{
@ -418,9 +418,9 @@ static SANE_Status
optionTopLeftXCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
value = value; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) value; /* Eliminate warning about unused parameters */
switch (action)
{
@ -462,8 +462,8 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -506,8 +506,8 @@ optionBotRightXCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -550,8 +550,8 @@ optionBotRightYCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -912,7 +912,7 @@ sane_close (SANE_Handle handle)
const SANE_Option_Descriptor *
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
{
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3, "sane_get_option_descriptor: option = %d\n", option);
if (option < 0 || option >= NELEMS (so))
@ -924,7 +924,7 @@ SANE_Status
sane_control_option (SANE_Handle handle, SANE_Int option,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3,
"sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n",
@ -945,7 +945,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
SANE_UNFIX (optionBotRightYValue -
optionTopLeftYValue) / MM_IN_INCH * optionResolutionValue;
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3, "sane_get_parameters\n");
parms.depth = 8;
@ -1035,7 +1035,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -131,9 +131,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, (char*)in + 0x08)
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, (char*)in + 0x10)
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, (char*)in + 0x20)
/* the VPD response */
#define get_IN_page_length(in) in[0x04]

Wyświetl plik

@ -494,7 +494,7 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -547,7 +547,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");
@ -7233,7 +7233,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg)
DBG (5, "sense_handler: start\n");
/* kill compiler warning */
fd = fd;
(void) fd;
/* copy the rs return data into the scanner struct
so that the caller can use it if he wants
@ -7494,8 +7494,8 @@ do_scsi_cmd(struct scanner *s, int runRS, int timeout,
int ret;
/*shut up compiler*/
runRS=runRS;
timeout=timeout;
(void) runRS;
(void) timeout;
DBG(10, "do_scsi_cmd: start\n");

Wyświetl plik

@ -956,7 +956,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -178,8 +178,8 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode)
usleep(100000);
}
} while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2",
0x03, 0x1f, 100000) == 0));
} while ((i < max_cycles) && expect(port, "Scanner wakeup reply 2",
0x03, 0x1f, 100000));
/* Block just after chessboarding
Reply 1 (S3 and S4 on, S5 and S7 off) */

Wyświetl plik

@ -271,7 +271,7 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -323,7 +323,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");

Wyświetl plik

@ -1853,8 +1853,8 @@ hexdump (int level, char *comment, unsigned char *p, int l)
static SANE_Status
sense_handler (int scsi_fd, unsigned char * result, void *arg)
{
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] != 0x70)
{
@ -2155,7 +2155,7 @@ attach_one (const char *devName)
static void
sigterm_handler (int signal)
{
signal = signal;
(void) signal;
sanei_scsi_req_flush_all (); /* flush SCSI queue */
_exit (SANE_STATUS_GOOD);
}
@ -2360,7 +2360,7 @@ static int RGBIfix16(Coolscan_t * scanner,
unsigned short *opr,*opg,*opb,*opi;
int x;
scanner = scanner; lutr = lutr; lutg = lutg; lutb = lutb; luti = luti;
(void) scanner; (void) lutr; (void) lutg; (void) lutb; (void) luti;
for(x=0;x<size;x++)
{
@ -2459,7 +2459,7 @@ static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat,
int ii;
int x;
lutg = lutg; lutb = lutb;
(void) lutg; (void) lutb;
/* calculate regression between r and ir */
cc.sum=0;
@ -3237,7 +3237,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize;
(void) authorize;
DBG_INIT ();
sanei_thread_init ();
@ -3297,7 +3297,7 @@ sane_get_devices (const SANE_Device *** device_list,
Coolscan_t *dev;
int i;
local_only = local_only;
(void) local_only;
DBG (10, "sane_get_devices\n");

Wyświetl plik

@ -344,7 +344,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG (10, "sane_init() called.\n");
DBG (1, "coolscan2 backend, version %i.%i.%i initializing.\n", CS2_VERSION_MAJOR, CS2_VERSION_MINOR, CS2_REVISION);
authorize = authorize; /* to shut up compiler */
(void) authorize; /* to shut up compiler */
if (version_code)
*version_code =
@ -378,7 +378,7 @@ sane_get_devices (const SANE_Device *** list, SANE_Bool local_only)
char line[PATH_MAX], *p;
FILE *config;
local_only = local_only; /* to shut up compiler */
(void) local_only; /* to shut up compiler */
DBG (10, "sane_get_devices() called.\n");
@ -468,7 +468,10 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS2_N_OPTIONS; i_option++)
{
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option)
{
@ -1738,8 +1741,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
DBG (10, "sane_get_select_fd() called.\n");
fd = fd; /* to shut up compiler */
s = s; /* to shut up compiler */
(void) fd; /* to shut up compiler */
(void) s; /* to shut up compiler */
return SANE_STATUS_UNSUPPORTED;
}
@ -2003,7 +2006,7 @@ cs2_scsi_sense_handler (int fd, u_char * sense_buffer, void *arg)
{
cs2_t *s = (cs2_t *) arg;
fd = fd; /* to shut up compiler */
(void) fd; /* to shut up compiler */
/* sort this out ! XXXXXXXXX */

Wyświetl plik

@ -314,7 +314,7 @@ sane_init(SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG(1, "coolscan3 backend, version %i.%i.%i initializing.\n",
CS3_VERSION_MAJOR, CS3_VERSION_MINOR, CS3_REVISION);
authorize = authorize; /* to shut up compiler */
(void) authorize; /* to shut up compiler */
if (version_code)
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
@ -346,7 +346,7 @@ sane_get_devices(const SANE_Device *** list, SANE_Bool local_only)
char line[PATH_MAX], *p;
FILE *config;
local_only = local_only; /* to shut up compiler */
(void) local_only; /* to shut up compiler */
DBG(10, "%s\n", __func__);
@ -424,7 +424,10 @@ sane_open(SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS3_N_OPTIONS; i_option++) {
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option) {
case CS3_OPTION_NUM:
@ -1746,8 +1749,8 @@ sane_get_select_fd(SANE_Handle h, SANE_Int * fd)
DBG(10, "%s\n", __func__);
fd = fd; /* to shut up compiler */
s = s; /* to shut up compiler */
(void) fd; /* to shut up compiler */
(void) s; /* to shut up compiler */
return SANE_STATUS_UNSUPPORTED;
}
@ -2026,7 +2029,7 @@ cs3_scsi_sense_handler(int fd, u_char * sense_buffer, void *arg)
{
cs3_t *s = (cs3_t *) arg;
fd = fd; /* to shut up compiler */
(void) fd; /* to shut up compiler */
/* sort this out ! XXX */

Wyświetl plik

@ -925,7 +925,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
int line, column;
int r_min = SMAX, g_min = SMAX, b_min = SMAX;
int r_max = 0, g_max = 0, b_max = 0;
int r_sum = 0, g_sum = 0, b_sum = 0;
float sqr_saturation = sqrt (saturation);
for (line = TOP_MARGIN; line < HEIGHT - BOTTOM_MARGIN; line++)
{
@ -1008,9 +1007,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
g_max = g;
if (b_max < b)
b_max = b;
r_sum += r;
g_sum += g;
b_sum += b;
BIDIM_ARRAY (red, column, line, columns) = r;
BIDIM_ARRAY (green, column, line, columns) = g;
BIDIM_ARRAY (blue, column, line, columns) = b;
@ -1153,7 +1149,6 @@ output_rgb (const short red[],
{
int r_min = 255, g_min = 255, b_min = 255;
int r_max = 0, g_max = 0, b_max = 0;
int r_sum = 0, g_sum = 0, b_sum = 0;
int column, line;
unsigned char *gamma_table = make_gamma_table (high_i - low_i);
@ -1202,19 +1197,9 @@ output_rgb (const short red[],
g_max = g;
if (b_max < b)
b_max = b;
r_sum += r;
g_sum += g;
b_sum += b;
}
}
free (gamma_table);
/*
{
fprintf (stderr, "%s: output_rgb: r: min = %d, max = %d, ave = %d\n", __progname, r_min, r_max, r_sum / NET_PIXELS);
fprintf (stderr, "%s: output_rgb: g: min = %d, max = %d, ave = %d\n", __progname, g_min, g_max, g_sum / NET_PIXELS);
fprintf (stderr, "%s: output_rgb: b: min = %d, max = %d, ave = %d\n", __progname, b_min, b_max, b_sum / NET_PIXELS);
}
*/
return 0;
}

Wyświetl plik

@ -946,7 +946,7 @@ HexDump (int debugLevel, const unsigned char *buf, size_t bufSize)
{
if (!(i % 16))
sprintf (lineBuf, "%p: ", (buf + i));
sprintf (lineBuf, "%p: ", (void *) &buf[i]);
sprintf (itemBuf, "%02x ", (const unsigned int) buf[i]);
@ -1199,7 +1199,7 @@ ProcessFindResponse (unsigned char *pData, size_t size)
DBG (10, "ProcessFindResponse: processing %lu bytes, pData=%p\n",
(unsigned long)size, pData);
(unsigned long) size, (void *) pData);
/* check we have a complete packet */
if (!MessageIsComplete (pData, size))
@ -1355,7 +1355,7 @@ ProcessUdpResponse (unsigned char *pData, size_t size,
HexDump (15, pData, size);
DBG (10, "ProcessUdpResponse: processing %lu bytes, pData=%p\n",
(unsigned long)size, pData);
(unsigned long) size, (void *) pData);
/* check we have a complete packet */
if (!MessageIsComplete (pData, size))
@ -1486,7 +1486,7 @@ ProcessTcpResponse (struct ScannerState *pState, struct ComBuf *pTcpBuf)
int bProcessImage = 0;
DBG (10, "ProcessTcpResponse: processing %lu bytes, pData=%p\n",
(unsigned long)pTcpBuf->m_used, pData);
(unsigned long) pTcpBuf->m_used, (void *) pData);
HexDump (15, pData, pTcpBuf->m_used);
/* if message not complete then wait for more to arrive */
@ -1799,7 +1799,7 @@ ProcessPageData (struct ScannerState *pState)
struct PageInfo pageInfo;
JSAMPLE *pJpegLine = NULL;
uint32 *pTiffRgba = NULL;
uint32_t *pTiffRgba = NULL;
unsigned char *pOut;
char tiffErrBuf[1024];

Wyświetl plik

@ -1068,7 +1068,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
char *full_name;
int i, num_devs;
size_t len;
#define ASSERT_SPACE(n) \
#define ASSERT_SPACE(n) do \
{ \
if (devlist_len + (n) > devlist_size) \
{ \
@ -1080,7 +1080,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
if (!devlist) \
return SANE_STATUS_NO_MEM; \
} \
}
} while (0)
DBG (3, "sane_get_devices\n");
@ -1365,7 +1365,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length,
struct meta_scanner *s = handle;
DBG (3, "sane_read(handle=%p,data=%p,maxlen=%d,lenp=%p)\n",
handle, data, max_length, (void *) length);
handle, (void *) data, max_length, (void *) length);
return (*(op_read_t)s->be->op[OP_READ]) (s->handle, data, max_length, length);
}

Wyświetl plik

@ -812,7 +812,7 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize;
(void) authorize;
DBG_INIT();
if (version_code) {
@ -891,7 +891,7 @@ sane_get_devices(SANE_Device const ***device_list, SANE_Bool local_only)
DMC_Device *dev;
int i = 0;
local_only = local_only;
(void) local_only;
if (devlist) free(devlist);
devlist = malloc((NumDevices+1) * sizeof(devlist[0]));
@ -1392,8 +1392,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle;
non_blocking = non_blocking;
(void) handle;
(void) non_blocking;
return SANE_STATUS_UNSUPPORTED;
}
@ -1401,8 +1401,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
{
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -271,7 +271,7 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -323,7 +323,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");

Wyświetl plik

@ -2653,7 +2653,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
/* sanei_authorization(devicename, STRINGIFY(BACKEND_NAME), auth_callback); */
@ -2753,7 +2753,7 @@ sane_get_devices (const SANE_Device * **device_list, SANE_Bool local_only)
DBG (5, "sane_get_devices()\n");
local_only = local_only; /* just to get rid of the compiler warning */
(void) local_only; /* just to get rid of the compiler warning */
if (devlist)
{
@ -6383,8 +6383,8 @@ SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
/* get rid of compiler warning */
handle = handle;
non_blocking = non_blocking;
(void) handle;
(void) non_blocking;
return SANE_STATUS_UNSUPPORTED;
}
@ -6399,8 +6399,8 @@ SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
/* get rid of compiler warnings */
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -2297,21 +2297,6 @@ sane_start(SANE_Handle handle)
return status;
}
static inline int
get_color(int status)
{
switch ((status >> 2) & 0x03) {
case 1:
return 1;
case 2:
return 0;
case 3:
return 2;
default:
return 0; /* required to make the compiler happy */
}
}
/* this moves data from our buffers to SANE */
SANE_Status
@ -2348,7 +2333,7 @@ sane_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length,
/* XXX if FS G and STATUS_IOERR, use e2_check_extended_status */
DBG(18, "moving data %p %p, %d (%d lines)\n",
s->ptr, s->end,
(void *) s->ptr, (void *) s->end,
max_length, max_length / s->params.bytes_per_line);
e2_copy_image_data(s, data, max_length, length);

Wyświetl plik

@ -70,7 +70,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
ssize_t read = 0;
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
if ((size_t) wanted > s->netlen) {
*status = SANE_STATUS_IO_ERROR;
@ -84,7 +84,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
s->netlen -= read;
if (s->netlen == 0) {
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -179,7 +179,7 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
if (reply_len) {
if (s->netbuf) {
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
__func__, s->netbuf, (u_long) s->netlen);
__func__, (void *) s->netbuf, (u_long) s->netlen);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -192,11 +192,11 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
}
s->netlen = reply_len;
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
(u_long) s->netlen, s->netbuf);
(u_long) s->netlen, (void *) s->netbuf);
}
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
memset(h1, 0x00, 12);
memset(h2, 0x00, 8);

Wyświetl plik

@ -27,8 +27,8 @@ sanei_epson2_scsi_sense_handler(int scsi_fd,
unsigned char *result, void *arg)
{
/* to get rid of warnings */
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] && result[0] != 0x70) {
DBG(2, "%s: sense code = 0x%02x\n",

Wyświetl plik

@ -32,8 +32,8 @@ SANE_Status
sanei_epson_scsi_sense_handler (int scsi_fd, u_char * result, void *arg)
{
/* to get rid of warnings */
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] && result[0] != 0x70)
{

Wyświetl plik

@ -784,7 +784,7 @@ static SANE_Status stat_cb(void *userdata, char *token, int len)
{
char *value = token + 3;
userdata = userdata;
(void) userdata;
if (DBG_LEVEL >= 11) {
debug_token(DBG_LEVEL, __func__, token, len);
@ -816,7 +816,7 @@ static SANE_Status resa_cb(void *userdata, char *token, int len)
{
/* epsonds_scanner *s = (epsonds_scanner *)userdata; */
userdata = userdata;
(void) userdata;
if (DBG_LEVEL >= 11) {
debug_token(DBG_LEVEL, __func__, token, len);
@ -838,7 +838,7 @@ static SANE_Status para_cb(void *userdata, char *token, int len)
debug_token(DBG_LEVEL, __func__, token, len);
}
userdata = userdata;
(void) userdata;
if (strncmp("par", token, 3) == 0) {
if (strncmp("FAIL", token + 3, 4) == 0) {

Wyświetl plik

@ -79,7 +79,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
ssize_t read = 0;
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
if ((size_t) wanted > s->netlen) {
*status = SANE_STATUS_IO_ERROR;
@ -93,7 +93,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
s->netlen -= read;
if (s->netlen == 0) {
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -195,7 +195,7 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
if (reply_len) {
if (s->netbuf) {
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
__func__, s->netbuf, (u_long) s->netlen);
__func__, (void *) s->netbuf, (u_long) s->netlen);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -208,11 +208,11 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
}
s->netlen = reply_len;
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
(u_long) s->netlen, s->netbuf);
(u_long) s->netlen, (void *) s->netbuf);
}
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
memset(h1, 0x00, 12);
memset(h2, 0x00, 8);
@ -513,7 +513,7 @@ fail:
if (simple_poll)
avahi_simple_poll_free(simple_poll);
DBG(10, "epsonds_searchDevices fin\n");
DBG(10, "epsonds_searchDevices fin\n");
return result;
}

Wyświetl plik

@ -1629,10 +1629,7 @@ device_detect(const char *name, int type, SANE_Status *status)
{//Convert to user friendly model name
free(s->hw->model);
char* deviceName = (char*)malloc(strlen(map->deviceID) + 1);
memset(deviceName, 0, strlen(map->deviceID) + 1);
strncpy(deviceName, map->deviceID, strlen(map->deviceID));
s->hw->model = deviceName;
s->hw->model = strdup(map->deviceID);
s->hw->sane.model = s->hw->model;
}
{// set lutid

Wyświetl plik

@ -26,6 +26,8 @@
#include "escl.h"
#include "../include/_stdint.h"
#include "../include/sane/sanei.h"
#include <stdio.h>
@ -53,11 +55,11 @@ SANE_Status
get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
{
TIFF* tif = NULL;
uint32 w = 0;
uint32 h = 0;
uint32_t w = 0;
uint32_t h = 0;
unsigned char *surface = NULL; /* image data*/
int components = 4;
uint32 npixels = 0;
uint32_t npixels = 0;
SANE_Status status = SANE_STATUS_GOOD;
lseek(fileno(scanner->tmp), 0, SEEK_SET);
@ -71,7 +73,7 @@ get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
npixels = w * h;
surface = (unsigned char*) malloc(npixels * sizeof (uint32));
surface = (unsigned char*) malloc(npixels * sizeof (uint32_t));
if (surface != NULL)
{
DBG( 1, "Escl Tiff : raster Memory allocation problem.\n");
@ -79,7 +81,7 @@ get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
goto close_tiff;
}
if (!TIFFReadRGBAImage(tif, w, h, (uint32 *)surface, 0))
if (!TIFFReadRGBAImage(tif, w, h, (uint32_t *)surface, 0))
{
DBG( 1, "Escl Tiff : Problem reading image data.\n");
status = SANE_STATUS_INVAL;

Wyświetl plik

@ -140,9 +140,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, (char *)in + 0x08)
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, (char *)in + 0x10)
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, (char *)in + 0x20)
#define get_IN_color_offset(in) getnbyte (in+0x2A, 2) /* offset between colors */
/* these only in some scanners */

Wyświetl plik

@ -764,7 +764,7 @@ static struct fujitsu *fujitsu_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -819,7 +819,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");
@ -9270,7 +9270,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg)
DBG (5, "sense_handler: start\n");
/* kill compiler warning */
fd = fd;
(void) fd;
/* copy the rs return data into the scanner struct
so that the caller can use it if he wants */
@ -9605,8 +9605,8 @@ do_scsi_cmd(struct fujitsu *s, int runRS, int shortTime,
int ret;
/*shut up compiler*/
runRS=runRS;
shortTime=shortTime;
(void) runRS;
(void) shortTime;
DBG(10, "do_scsi_cmd: start\n");

Wyświetl plik

@ -59,7 +59,7 @@ struct Pixel;
struct RawPixel;
// low.h
struct UsbDeviceEntry;
class UsbDeviceEntry;
// motor.h
struct Genesys_Motor;

Wyświetl plik

@ -2847,7 +2847,8 @@ static void compute_averaged_planar(Genesys_Device * dev, const Genesys_Sensor&
avgpixels = 15;
/* LiDE80 packs shading data */
if (dev->model->sensor_id != SensorId::CIS_CANON_LIDE_80) {
if (dev->model->sensor_id != SensorId::CIS_CANON_LIDE_80)
{
factor=1;
fill=avgpixels;
}
@ -4883,28 +4884,28 @@ static void init_options(Genesys_Scanner* s)
s->opt[OPT_POWER_SW].cap = SANE_CAP_INACTIVE;
/* extra button */
s->opt[OPT_EXTRA_SW].name = "extra";
s->opt[OPT_EXTRA_SW].title = SANE_I18N("Extra button");
s->opt[OPT_EXTRA_SW].desc = SANE_I18N("Extra button");
s->opt[OPT_EXTRA_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_EXTRA_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_EXTRA_SW) {
s->opt[OPT_EXTRA_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
} else {
s->opt[OPT_EXTRA_SW].cap = SANE_CAP_INACTIVE;
}
s->opt[OPT_EXTRA_SW].name = "extra";
s->opt[OPT_EXTRA_SW].title = SANE_I18N("Extra button");
s->opt[OPT_EXTRA_SW].desc = SANE_I18N("Extra button");
s->opt[OPT_EXTRA_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_EXTRA_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_EXTRA_SW)
s->opt[OPT_EXTRA_SW].cap =
SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_EXTRA_SW].cap = SANE_CAP_INACTIVE;
// transparency/scan_film button
s->opt[OPT_TRANSP_SW].name = "transparency";
s->opt[OPT_TRANSP_SW].title = SANE_I18N ("Transparency button");
s->opt[OPT_TRANSP_SW].desc = SANE_I18N ("Transparency button");
s->opt[OPT_TRANSP_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_TRANSP_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_TRANSP_SW) {
s->opt[OPT_TRANSP_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
} else {
s->opt[OPT_TRANSP_SW].cap = SANE_CAP_INACTIVE;
}
/* transparency/scan_film button */
s->opt[OPT_TRANSP_SW].name = "transparency";
s->opt[OPT_TRANSP_SW].title = SANE_I18N ("Transparency button");
s->opt[OPT_TRANSP_SW].desc = SANE_I18N ("Transparency button");
s->opt[OPT_TRANSP_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_TRANSP_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_TRANSP_SW)
s->opt[OPT_TRANSP_SW].cap =
SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_TRANSP_SW].cap = SANE_CAP_INACTIVE;
/* calibration needed */
s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration";

Wyświetl plik

@ -360,8 +360,8 @@ void sanei_genesys_read_data_from_scanner(Genesys_Device* dev, std::uint8_t* dat
{
DBG_HELPER_ARGS(dbg, "size = %zu bytes", size);
if (size & 1)
DBG(DBG_info, "WARNING %s: odd number of bytes\n", __func__);
if (size & 1)
DBG(DBG_info, "WARNING %s: odd number of bytes\n", __func__);
wait_until_has_valid_words(dev);

Wyświetl plik

@ -425,7 +425,7 @@ gt68xx_device_memory_write (GT68xx_Device * dev,
SANE_Status status;
DBG (8,
"gt68xx_device_memory_write: dev=%p, addr=0x%x, size=0x%x, data=%p\n",
(void *) dev, addr, size, data);
(void *) dev, addr, size, (void *) data);
CHECK_DEV_ACTIVE (dev, "gt68xx_device_memory_write");
status =
sanei_usb_control_msg (dev->fd, 0x40,
@ -448,7 +448,7 @@ gt68xx_device_memory_read (GT68xx_Device * dev,
SANE_Status status;
DBG (8,
"gt68xx_device_memory_read: dev=%p, addr=0x%x, size=0x%x, data=%p\n",
(void *) dev, addr, size, data);
(void *) dev, addr, size, (void *) data);
CHECK_DEV_ACTIVE (dev, "gt68xx_device_memory_read");
status =
sanei_usb_control_msg (dev->fd, 0xc0,

Wyświetl plik

@ -581,13 +581,9 @@ hp_get_dev (const char *devname, HpDevice* devp)
DBG(3, "hp_get_dev: New device %s, connect-%s, scsi-request=%lu\n",
devname, connect, (unsigned long)info->config.use_scsi_request);
if (!ptr)
{
status = sanei_hp_device_new (&new, devname);
if ( status != SANE_STATUS_GOOD )
return status;
}
status = sanei_hp_device_new (&new, devname);
if (status != SANE_STATUS_GOOD)
return status;
if (devp)
*devp = new;

Wyświetl plik

@ -265,7 +265,7 @@ static const SANE_Device **devlist = 0;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init\n");
@ -1117,7 +1117,7 @@ init_options (struct hp3500_data *scanner)
static void
do_reset (struct hp3500_data *scanner)
{
scanner = scanner; /* kill warning */
(void) scanner; /* kill warning */
}
static void
@ -1530,8 +1530,6 @@ rt_get_available_bytes (void)
static int
rt_get_data (int bytes, void *data)
{
int total = 0;
while (bytes)
{
int bytesnow = bytes;
@ -1542,7 +1540,6 @@ rt_get_data (int bytes, void *data)
(RTCMD_READBYTES, 0, bytesnow, 0, 0, bytesnow, data) < 0
|| rt_execute_commands () < 0)
return -1;
total += bytesnow;
bytes -= bytesnow;
data = (char *) data + bytesnow;
}
@ -2774,7 +2771,7 @@ rts8801_doscan (unsigned width,
int result = 0;
unsigned rows_supplied = 0;
calib_info = calib_info; /* Kill warning */
(void) calib_info; /* Kill warning */
if (cancelled_scan)
return -1;
rt_start_moving ();
@ -3784,7 +3781,7 @@ writefunc (struct hp3500_write_info *winfo, int bytes, char *data)
static void
sigtermHandler (int signal)
{
signal = signal; /* get rid of compiler warning */
(void) signal; /* get rid of compiler warning */
cancelled_scan = 1;
}
#endif

Wyświetl plik

@ -1523,19 +1523,16 @@ static SANE_Int hp3800_checkstable(SANE_Int lamp, struct st_checkstable *check)
SANE_Int rst = ERROR;
if (reg != NULL)
{
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
for (a = 0; a < count; a++)
for (a = 0; a < count; a++)
{
if (reg[a].lamp == lamp)
{
if (reg[a].lamp == lamp)
{
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
}
@ -1560,19 +1557,16 @@ static SANE_Int hp3970_checkstable(SANE_Int lamp, struct st_checkstable *check)
SANE_Int rst = ERROR;
if (reg != NULL)
{
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
for (a = 0; a < count; a++)
for (a = 0; a < count; a++)
{
if (reg[a].lamp == lamp)
{
if (reg[a].lamp == lamp)
{
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
}
@ -1597,19 +1591,16 @@ static SANE_Int hp4370_checkstable(SANE_Int lamp, struct st_checkstable *check)
SANE_Int rst = ERROR;
if (reg != NULL)
{
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
for (a = 0; a < count; a++)
for (a = 0; a < count; a++)
{
if (reg[a].lamp == lamp)
{
if (reg[a].lamp == lamp)
{
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
}
@ -1634,19 +1625,16 @@ static SANE_Int ua4900_checkstable(SANE_Int lamp, struct st_checkstable *check)
SANE_Int rst = ERROR;
if (reg != NULL)
{
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
SANE_Int a;
SANE_Int count = sizeof(reg) / sizeof(struct st_reg);
for (a = 0; a < count; a++)
for (a = 0; a < count; a++)
{
if (reg[a].lamp == lamp)
{
if (reg[a].lamp == lamp)
{
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
memcpy(check, &reg[a].values, sizeof(struct st_checkstable));
rst = OK;
break;
}
}
@ -2719,7 +2707,7 @@ static SANE_Int bq5550_scanmodes(SANE_Int usb, SANE_Int sm, struct st_scanmode *
SANE_Int rst = ERROR;
/* silence compiler */
usb = usb;
(void) usb;
if (mymode != NULL)
{

Wyświetl plik

@ -600,15 +600,15 @@ dbg_tiff_save (char *sFile, SANE_Int width, SANE_Int height, SANE_Int depth,
}
#else
/* silent gcc */
sFile = sFile;
width = width;
height = height;
depth = depth;
colortype = colortype;
res_x = res_x;
res_y = res_y;
buffer = buffer;
size = size;
(void) sFile;
(void) width;
(void) height;
(void) depth;
(void) colortype;
(void) res_x;
(void) res_y;
(void) buffer;
(void) size;
DBG (DBG_ERR, "- dbg_tiff_save: tiffio not supported\n");
#endif

Wyświetl plik

@ -4856,8 +4856,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg,
{
/*d4df */
diff_max = color_dif[cnt];
if (abs (color_dif[cnt] - color_dif[cnt - 1]) >
abs (color_dif[coord] - color_dif[coord - 1]))
if (fabs (color_dif[cnt] - color_dif[cnt - 1]) >
fabs (color_dif[coord] - color_dif[coord - 1]))
coord = cnt;
}
@ -4907,8 +4907,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg,
if ((color_dif[cnt] >= 0) && (color_dif[cnt] > diff_max))
{
diff_max = color_dif[cnt];
if (abs (color_dif[cnt] - color_dif[cnt - 1]) >
abs (color_dif[coord] - color_dif[coord - 1]))
if (fabs (color_dif[cnt] - color_dif[cnt - 1]) >
fabs (color_dif[coord] - color_dif[coord - 1]))
coord = cnt;
}
@ -4954,8 +4954,8 @@ Refs_Analyze_Pattern (struct st_scanparams *scancfg,
if ((color_dif[cnt] >= 0) && (color_dif[cnt] > diff_max))
{
diff_max = color_dif[cnt];
if (abs (color_dif[cnt] - color_dif[cnt - 1]) >
abs (color_dif[coord] - color_dif[coord - 1]))
if (fabs (color_dif[cnt] - color_dif[cnt - 1]) >
fabs (color_dif[coord] - color_dif[coord - 1]))
coord = cnt;
}
@ -7703,7 +7703,7 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2,
"+ Scan_Read_BufferA(buffer_size=%i, arg2, *pBuffer, *bytes_transferred):\n",
buffer_size);
arg2 = arg2; /* silence gcc */
(void) arg2; /* silence gcc */
*bytes_transferred = 0;
if (pBuffer != NULL)
@ -11364,7 +11364,7 @@ Calib_CreateBuffers (struct st_device *dev, struct st_calibration *buffer,
SANE_Int ebp, ret, channel;
ret = ERROR;
dev = dev;
(void) dev;
buffer->shadinglength = scan.coord.width;
ebp = 0x14;
@ -12602,9 +12602,9 @@ Calib_BWShading (struct st_calibration_config *calibcfg,
/*falta codigo */
/*silence gcc */
calibcfg = calibcfg;
myCalib = myCalib;
gainmode = gainmode;
(void) calibcfg;
(void) myCalib;
(void) gainmode;
return OK;
}
@ -13624,7 +13624,7 @@ Calibration (struct st_device *dev, SANE_Byte * Regs,
DBG (DBG_FNC, "> Calibration\n");
dbg_ScanParams (scancfg);
value = value; /*silence gcc */
(void) value; /*silence gcc */
memcpy (&calibdata->Regs, Regs, sizeof (SANE_Byte) * RT_BUFFER_LEN);

Wyświetl plik

@ -380,7 +380,7 @@ bknd_colormodes (TScanner * scanner, SANE_Int model)
{ SANE_VALUE_SCAN_MODE_COLOR, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_LINEART, 0 };
/* silence gcc */
model = model;
(void) model;
colormode = (SANE_String_Const *) malloc (sizeof (mycolormode));
if (colormode != NULL)
@ -460,7 +460,7 @@ bknd_depths (TScanner * scanner, SANE_Int model)
SANE_Int mydepth[] = { 2, 8, 16 }; /*{3, 8, 12, 16}; */
/* silence gcc */
model = model;
(void) model;
depth = (SANE_Int *) malloc (sizeof (mydepth));
if (depth != NULL)
@ -1760,7 +1760,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG (DBG_FNC, "> sane_init\n");
/* silence gcc */
authorize = authorize;
(void) authorize;
/* Initialize usb */
sanei_usb_init ();
@ -1816,7 +1816,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
{
SANE_Status rst = SANE_STATUS_GOOD;
local_only = local_only;
(void) local_only;
if (_pSaneDevList)
free (_pSaneDevList);
@ -2654,7 +2654,7 @@ sane_cancel (SANE_Handle h)
DBG (DBG_FNC, "> sane_cancel\n");
/* silence gcc */
h = h;
(void) h;
device->status->cancel = TRUE;
}
@ -2665,8 +2665,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
DBG (DBG_FNC, "> sane_set_io_mode\n");
/* silence gcc */
handle = handle;
non_blocking = non_blocking;
(void) handle;
(void) non_blocking;
return SANE_STATUS_UNSUPPORTED;
}
@ -2677,8 +2677,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
DBG (DBG_FNC, "> sane_get_select_fd\n");
/* silence gcc */
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -512,7 +512,7 @@ read_available_data (HP4200_Scanner * s, SANE_Byte * buffer,
buffer += really_read;
to_read -= really_read;
#ifdef DEBUG
fprintf (stderr, "read %d bytes\n", really_read);
fprintf (stderr, "read %zu bytes\n", really_read);
#endif
}
return SANE_STATUS_GOOD;
@ -941,7 +941,6 @@ compute_dpd (HP4200_Scanner * s, int step_size, int line_end)
static SANE_Status
read_required_bytes (HP4200_Scanner * s, int required, SANE_Byte * buffer)
{
int read_count = 0;
unsigned char scankb1;
unsigned char scankb2;
size_t to_read;
@ -987,7 +986,6 @@ read_required_bytes (HP4200_Scanner * s, int required, SANE_Byte * buffer)
buffer += really_read;
required -= really_read;
to_read -= really_read;
read_count += really_read;
}
}
@ -2369,7 +2367,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
char dev_name[PATH_MAX];
FILE *fp;
authorize = authorize; /* keep gcc quiet */
(void) authorize; /* keep gcc quiet */
DBG_INIT ();
@ -2939,7 +2937,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
HP4200_Scanner *dev = handle;
SANE_Status status;
non_blocking = non_blocking; /* silence gcc */
(void) non_blocking; /* silence gcc */
if (dev->scanning == SANE_FALSE)
{
@ -2965,8 +2963,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
{
static char me[] = "sane_get_select_fd";
h = h; /* keep gcc quiet */
fd = fd; /* keep gcc quiet */
(void) h; /* keep gcc quiet */
(void) fd; /* keep gcc quiet */
DBG (DBG_proc, "%s\n", me);
return SANE_STATUS_UNSUPPORTED;

Wyświetl plik

@ -483,7 +483,7 @@ void
CircBufferInit (int iHandle, TDataPipe * p, int iBytesPerLine,
int bpp, int iMisAlignment, int blksize, int iTransferSize)
{
iHandle = iHandle; /* to avoid compilation warning */
(void) iHandle; /* to avoid compilation warning */
p->buffersize = max (BUFFER_SIZE, 3 * blksize);
if (p->buffer)
@ -746,7 +746,7 @@ HP5400_SANE_STATIC
int
hp5400_test_scan_response (struct ScanResponse *resp, struct ScanRequest *req)
{
req = req; /* to avoid compilation warning */
(void) req; /* to avoid compilation warning */
HP5400_DBG (DBG_MSG, "Scan response:\n");
HP5400_DBG (DBG_MSG, " transfersize=%d htonl-> %d\n", resp->transfersize,
htonl (resp->transfersize));
@ -828,7 +828,7 @@ DoScan (int iHandle, struct ScanRequest *req, const char *filename, int code,
/* int bpp, planes; */
int i;
code = code; /*to avoid compilation warning*/
(void) code; /*to avoid compilation warning*/
if (res == NULL)
res = &res_temp;
@ -1011,7 +1011,7 @@ hp5400_scan (int iHandle, TScanParams * params, THWParams * pHWParams,
struct ScanResponse res;
int result;
pHWParams = pHWParams; /*to avoid compilation warning*/
(void) pHWParams; /*to avoid compilation warning*/
HP5400_DBG (DBG_MSG, "\n");
HP5400_DBG (DBG_MSG, "Scanning :\n");

Wyświetl plik

@ -611,7 +611,7 @@ sane_init (SANE_Int * piVersion, SANE_Auth_Callback pfnAuth)
int nline = 0;
/* prevent compiler from complaining about unused parameters */
pfnAuth = pfnAuth;
(void) pfnAuth;
strcpy(usb_devfile, "/dev/usb/scanner0");
_pFirstSaneDev = 0;
@ -712,7 +712,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
HP5400_DBG (DBG_MSG, "sane_get_devices\n");
local_only = local_only;
(void) local_only;
if (_pSaneDevList)
{
@ -1333,7 +1333,7 @@ sane_set_io_mode (SANE_Handle h, SANE_Bool m)
HP5400_DBG (DBG_MSG, "sane_set_io_mode %s\n", m ? "non-blocking" : "blocking");
/* prevent compiler from complaining about unused parameters */
h = h;
(void) h;
if (m)
{
@ -1349,8 +1349,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
HP5400_DBG (DBG_MSG, "sane_select_fd\n");
/* prevent compiler from complaining about unused parameters */
h = h;
fd = fd;
(void) h;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -796,8 +796,9 @@ hp5590_bulk_read (SANE_Int dn,
DBG (DBG_err,
"%s: USB-in-USB: attempted to access over the end of buffer "
"(in_ptr: %p, end_ptr: %p, ptr: %p, buffer size: %u\n",
__func__, bulk_read_state->buffer_in_ptr,
bulk_read_state->buffer_end_ptr, bulk_read_state->buffer,
__func__, (void *) bulk_read_state->buffer_in_ptr,
(void *) bulk_read_state->buffer_end_ptr,
(void *) bulk_read_state->buffer,
bulk_read_state->buffer_size);
return SANE_STATUS_NO_MEM;
}

Wyświetl plik

@ -3125,7 +3125,7 @@ sane_start (SANE_Handle handle) /* begin scanning */
sane_strstatus (status));
return (status);
}
if ((s->data.adf_status & 0x00) == 0x01)
if ((s->data.adf_status & 0x01) == 0x01)
{
DBG (DBG_warning, "sane_start: No document on ADF\n");
return (SANE_STATUS_NO_DOCS);
@ -3322,8 +3322,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
*fd = s->fd;
return SANE_STATUS_GOOD;
#else
handle = handle;
fd = fd; /* get rid of compiler warning */
(void) handle;
(void) fd; /* get rid of compiler warning */
DBG (DBG_proc, "<< sane_get_select_fd\n");
return SANE_STATUS_UNSUPPORTED;
#endif

Wyświetl plik

@ -568,7 +568,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
continue; /* ignore empty lines */
/* skip white space: */
for (lp = line; isspace(*lp); ++lp);
for (lp = line; isspace(*lp); ++lp)
;
strcpy (devnam, lp);
}
fclose (fp);

Wyświetl plik

@ -133,10 +133,14 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define get_I_cmdque(in) getbitfield(in + 7, 1, 1)
#define get_I_sftre(in) getbitfield(in + 7, 0, 1)
#define get_I_vendor(in, buf) strncpy(buf,(char *)in + 0x08, 0x08)
#define get_I_product(in, buf) strncpy(buf,(char *)in + 0x10, 0x10)
#define get_I_version(in, buf) strncpy(buf,(char *)in + 0x20, 0x04)
#define get_I_build(in, buf) strncpy(buf,(char *)in + 0x24, 0x02)
#define get_I_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, (char *)in + 0x08)
#define get_I_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, (char *)in + 0x10)
#define get_I_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, (char *)in + 0x20)
#define get_I_build(in, buf) snprintf(buf, 0x02 + 1, "%.*s", \
0x02, (char *)in + 0x24)
#define get_I_mf_disable(in) getbitfield(in + 38, 7, 1)
#define get_I_checkdigit(in) getbitfield(in + 38, 6, 1)

Wyświetl plik

@ -175,7 +175,7 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -225,7 +225,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");
@ -2550,7 +2550,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg)
DBG (5, "sense_handler: start\n");
/* kill compiler warning */
fd = fd;
(void) fd;
/* save for later */
s->rs_info = get_RS_information (sensed_data);
@ -2754,8 +2754,8 @@ do_cmd(struct scanner *s, int runRS, int shortTime,
SANE_Status ret = SANE_STATUS_GOOD;
/*shut up compiler*/
runRS=runRS;
shortTime=shortTime;
(void) runRS;
(void) shortTime;
DBG(10, "do_cmd: start\n");

Wyświetl plik

@ -716,7 +716,6 @@ That is probably if the scanner disconnected the network connection
/* pollreply is -ve */
DBG(1, "net poll error\n");
*status = SANE_STATUS_IO_ERROR;
return read;
}
else if((fds[0].revents & POLLIN) && !(fds[0].revents & (POLLERR | POLLHUP | POLLNVAL))) {
while (read < wanted) {
@ -733,12 +732,11 @@ That is probably if the scanner disconnected the network connection
*status = SANE_STATUS_IO_ERROR;
DBG(32, "net read %lu bytes:%x,%x,%x,%x,%x,%x,%x,%x\n",(unsigned long)read,buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7]);
return read;
}
else
DBG(1, "Unknown problem with poll\n");
return read;
return read;
}
@ -2046,7 +2044,7 @@ open_scanner(KodakAio_Scanner *s)
unsigned int model = 0;
if (!split_scanner_name (s->hw->sane.name, IP, &model))
return SANE_STATUS_INVAL;
DBG(10, "split_scanner_name OK model=0x%x\n",model);
DBG(10, "split_scanner_name OK model=0x%x\n",model);
/* normal with IP */
status = sanei_tcp_open(IP, 9101, &s->fd); /* (host,port,file pointer) */

Wyświetl plik

@ -442,15 +442,15 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle h, SANE_Bool m)
{
h=h;
m=m;
(void) h;
(void) m;
return SANE_STATUS_UNSUPPORTED;
}
SANE_Status
sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
{
h=h;
fd=fd;
(void) h;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -673,11 +673,6 @@ mm2scanner_units (unsigned mm)
{
return mm * 12000 / 254;
}
static inline unsigned
scanner_units2mm (unsigned u)
{
return u * 254 / 12000;
}
void
kvs20xx_init_window (struct scanner *s, struct window *wnd, int wnd_id)

Wyświetl plik

@ -118,11 +118,6 @@ static inline void buf_set_st(struct buf *b, SANE_Status st)
pthread_mutex_unlock(&b->mu);
}
static inline void buf_cancel(struct buf *b)
{
buf_set_st(b, SANE_STATUS_CANCELLED);
}
static inline void push_buf(struct buf *b, SANE_Int sz)
{
pthread_mutex_lock(&b->mu);

Wyświetl plik

@ -29,11 +29,6 @@ mm2scanner_units (unsigned mm)
{
return (mm * 12000 / 254.0 + .5);
}
static inline unsigned
scanner_units2mm (unsigned u)
{
return (u * 254.0 / 12000 + .5);
}
struct restriction
{
unsigned ux, uy, ux_pix, uy_pix;

Wyświetl plik

@ -4994,14 +4994,14 @@ sanei_lexmark_low_read_scan_data (SANE_Byte * data, SANE_Int size,
DBG (2, " Filled a buffer from the scanner\n");
DBG (2, " bytes_remaining: %lu\n", (u_long) dev->bytes_remaining);
DBG (2, " bytes_in_buffer: %lu\n", (u_long) dev->bytes_in_buffer);
DBG (2, " read_pointer: %p\n", dev->read_pointer);
DBG (2, " read_pointer: %p\n", (void *) dev->read_pointer);
}
}
DBG (5, "READ BUFFER INFO: \n");
DBG (5, " write ptr: %p\n", dev->read_buffer->writeptr);
DBG (5, " read ptr: %p\n", dev->read_buffer->readptr);
DBG (5, " max write ptr: %p\n", dev->read_buffer->max_writeptr);
DBG (5, " write ptr: %p\n", (void *) dev->read_buffer->writeptr);
DBG (5, " read ptr: %p\n", (void *) dev->read_buffer->readptr);
DBG (5, " max write ptr: %p\n", (void *) dev->read_buffer->max_writeptr);
DBG (5, " buffer size: %lu\n", (u_long) dev->read_buffer->size);
DBG (5, " line size: %lu\n", (u_long) dev->read_buffer->linesize);
DBG (5, " empty: %d\n", dev->read_buffer->empty);
@ -5059,9 +5059,9 @@ sanei_lexmark_low_read_scan_data (SANE_Byte * data, SANE_Int size,
}
DBG (5, "READ BUFFER INFO: \n");
DBG (5, " write ptr: %p\n", dev->read_buffer->writeptr);
DBG (5, " read ptr: %p\n", dev->read_buffer->readptr);
DBG (5, " max write ptr: %p\n", dev->read_buffer->max_writeptr);
DBG (5, " write ptr: %p\n", (void *) dev->read_buffer->writeptr);
DBG (5, " read ptr: %p\n", (void *) dev->read_buffer->readptr);
DBG (5, " max write ptr: %p\n", (void *) dev->read_buffer->max_writeptr);
DBG (5, " buffer size: %lu\n", (u_long) dev->read_buffer->size);
DBG (5, " line size: %lu\n", (u_long) dev->read_buffer->linesize);
DBG (5, " empty: %d\n", dev->read_buffer->empty);
@ -5074,7 +5074,7 @@ sanei_lexmark_low_read_scan_data (SANE_Byte * data, SANE_Int size,
DBG (2, " Copying lines from buffer to data\n");
DBG (2, " bytes_remaining: %lu\n", (u_long) dev->bytes_remaining);
DBG (2, " bytes_in_buffer: %lu\n", (u_long) dev->bytes_in_buffer);
DBG (2, " read_pointer: %p\n", dev->read_buffer->readptr);
DBG (2, " read_pointer: %p\n", (void *) dev->read_buffer->readptr);
DBG (2, " bytes_read %lu\n", (u_long) bytes_read);
/* if no more bytes to xfer and read buffer empty we're at the end */
@ -5252,12 +5252,12 @@ read_buffer_bytes_available (Read_Buffer * rb)
if (rb->empty)
return rb->size;
else if ((size_t) abs (rb->writeptr - rb->readptr) < rb->linesize)
return 0; /* ptrs are less than one line apart */
else if (rb->writeptr < rb->readptr)
return (rb->readptr - rb->writeptr - rb->linesize);
return (size_t)(rb->readptr - rb->writeptr) < rb->linesize ? 0 :
(size_t)(rb->readptr - rb->writeptr) - rb->linesize;
else
return (rb->size + rb->readptr - rb->writeptr - rb->linesize);
return (size_t)(rb->writeptr - rb->readptr) < rb->linesize ? 0 :
rb->size - (size_t)(rb->writeptr - rb->readptr) - rb->linesize;
}
SANE_Status

Wyświetl plik

@ -161,7 +161,7 @@ ma1509_cmd (Ma1509_Scanner * s, const SANE_Byte * cmd, SANE_Byte * data,
#define MA1509_READ_LIMIT (1024 * 256)
DBG (5, "ma1509_cmd: fd=%d, cmd=%p, data=%p, data_size=%ld\n",
s->fd, cmd, data, (long int) (data_size ? *data_size : 0));
s->fd, (void *) cmd, (void *) data, (long int) (data_size ? *data_size : 0));
DBG (5, "ma1509_cmd: cmd = %02x %02x %02x %02x %02x %02x %02x %02x \n",
cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7]);

Wyświetl plik

@ -3001,7 +3001,7 @@ sane_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length,
}
DBG(18, "moving data %p %p, %d (%d lines)\n",
s->ptr, s->end,
(void *) s->ptr, (void *) s->end,
max_length, max_length / s->params.bytes_per_line);
mc_copy_image_data(s, data, max_length, length);

Wyświetl plik

@ -1502,14 +1502,10 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result)
};
#endif
DBG(15, "parse_inquiry...\n");
strncpy(mi->vendor_id, (char *)&result[8], 8);
strncpy(mi->model_name, (char *)&result[16], 16);
strncpy(mi->revision_num, (char *)&result[32], 4);
strncpy(mi->vendor_string, (char *)&result[36], 20);
mi->vendor_id[8] = 0;
mi->model_name[16] = 0;
mi->revision_num[4] = 0;
mi->vendor_string[20] = 0;
snprintf(mi->vendor_id, 8 + 1, "%.*s", 8, (char *)&result[8]);
snprintf(mi->model_name, 16 + 1, "%.*s", 16, (char *)&result[16]);
snprintf(mi->revision_num, 4 + 1, "%.*s", 4, (char *)&result[32]);
snprintf(mi->vendor_string, 20 + 1, "%.*s", 20, (char *)&result[36]);
mi->device_type = (SANE_Byte)(result[0] & 0x1f);
mi->SCSI_firmware_ver_major = (SANE_Byte)((result[1] & 0xf0) >> 4);
@ -1925,7 +1921,7 @@ static SANE_Status
dump_suspect_inquiry(unsigned char *result)
{
int i;
char vendor_id[64], model_name[64], revision_num[16];
char vendor_id[9], model_name[17], revision_num[5];
SANE_Byte device_type, model_code;
SANE_Byte SCSI_firmware_ver_major, SCSI_firmware_ver_minor;
SANE_Byte scanner_firmware_ver_major, scanner_firmware_ver_minor;
@ -1947,12 +1943,9 @@ dump_suspect_inquiry(unsigned char *result)
}
fprintf(stderr, "\n\n");
#endif
strncpy(vendor_id, (char *)&result[8], 8);
strncpy(model_name, (char *)&result[16], 16);
strncpy(revision_num, (char *)&result[32], 4);
vendor_id[8] = 0;
model_name[16] = 0;
revision_num[5] = 0;
snprintf(vendor_id, 8 + 1, "%.*s", 8, (char *)&result[8]);
snprintf(model_name, 16 + 1, "%.*s", 16, (char *)&result[16]);
snprintf(revision_num, 4 + 1, "%.*s", 4, (char *)&result[32]);
device_type = (SANE_Byte)(result[0] & 0x1f);
SCSI_firmware_ver_major = (SANE_Byte)((result[1] & 0xf0) >> 4);
SCSI_firmware_ver_minor = (SANE_Byte)(result[1] & 0x0f);
@ -2356,7 +2349,8 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s)
input = calloc(STRIPS * 3 * linewidth, sizeof(input[0]));
combuff = calloc(linewidth + 6, sizeof(combuff[0]));
if ((input == NULL) || (combuff == NULL)) {
DBG(23, "do_real_cal: bad calloc %p %p\n", input, combuff);
DBG(23, "do_real_cal: bad calloc %p %p\n",
(void *) input, (void *) combuff);
free(input);
free(combuff);
return SANE_STATUS_NO_MEM;
@ -2370,7 +2364,7 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s)
ntoget = (nleft > nmax) ? nmax : nleft;
buffsize = ntoget * 3 * linewidth;
DBG(23, "...nleft %d toget %d size %lu spot %d input+spot %p\n",
nleft, ntoget, (u_long) buffsize, spot, input+spot);
nleft, ntoget, (u_long) buffsize, spot, (void *) (input+spot));
if ((statusA = read_scan_data(s, ntoget, input+spot, &buffsize))
!= SANE_STATUS_GOOD) {
DBG(23, "...read scan failed\n");
@ -3060,7 +3054,7 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize;
(void) authorize;
DBG_INIT();
DBG(1, "sane_init: MICROTEK says hello! (v%d.%d.%d)\n",
MICROTEK_MAJOR, MICROTEK_MINOR, MICROTEK_PATCH);
@ -3111,7 +3105,7 @@ sane_get_devices(const SANE_Device ***device_list,
Microtek_Device *dev;
int i;
local_only = local_only;
(void) local_only;
DBG(10, "sane_get_devices\n");
/* we keep an internal copy */
if (devlist)
@ -4166,7 +4160,7 @@ SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
DBG(10, "sane_set_io_mode...\n");
handle = handle;
(void) handle;
if (non_blocking)
return SANE_STATUS_UNSUPPORTED;
else
@ -4182,6 +4176,6 @@ SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
DBG(10, "sane_get_select_fd...\n");
handle = handle, fd = fd;
(void) handle, (void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -195,7 +195,7 @@ sane_exit (void)
if ( md_first_dev->shading_table_w )
{
DBG(100, "free md_first_dev->shading_table_w at %p\n",
md_first_dev->shading_table_w);
(void *) md_first_dev->shading_table_w);
free((void *) md_first_dev->shading_table_w);
md_first_dev->shading_table_w = NULL;
}
@ -203,7 +203,7 @@ sane_exit (void)
if ( md_first_dev->shading_table_d )
{
DBG(100, "free md_first_dev->shading_table_d at %p\n",
md_first_dev->shading_table_d);
(void *) md_first_dev->shading_table_d);
free((void *) md_first_dev->shading_table_d);
md_first_dev->shading_table_d = NULL;
}
@ -599,7 +599,8 @@ sane_read(SANE_Handle handle, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *len )
ssize_t nread;
DBG(30, "sane_read: handle=%p, buf=%p, maxlen=%d\n", handle, buf, maxlen);
DBG(30, "sane_read: handle=%p, buf=%p, maxlen=%d\n",
handle, (void *) buf, maxlen);
*len = 0;
@ -742,7 +743,7 @@ add_device_list(SANE_String_Const dev_name, Microtek2_Device **mdev)
md->opts = md_options;
++md_num_devices;
*mdev = md;
DBG(100, "free hdev at %p\n", hdev);
DBG(100, "free hdev at %p\n", (void *) hdev);
free(hdev);
return SANE_STATUS_GOOD;
@ -1360,53 +1361,56 @@ cleanup_scanner(Microtek2_Scanner *ms)
/* free buffers */
if ( ms->buf.src_buffer[0] )
{
DBG(100, "free ms->buf.src_buffer[0] at %p\n", ms->buf.src_buffer[0]);
DBG(100, "free ms->buf.src_buffer[0] at %p\n",
(void *) ms->buf.src_buffer[0]);
free((void *) ms->buf.src_buffer[0]);
ms->buf.src_buffer[0] = NULL;
ms->buf.src_buf = NULL;
}
if ( ms->buf.src_buffer[1] )
{
DBG(100, "free ms->buf.src_buffer[1] at %p\n", ms->buf.src_buffer[1]);
DBG(100, "free ms->buf.src_buffer[1] at %p\n",
(void *) ms->buf.src_buffer[1]);
free((void *) ms->buf.src_buffer[1]);
ms->buf.src_buffer[1] = NULL;
ms->buf.src_buf = NULL;
}
if ( ms->buf.src_buf )
{
DBG(100, "free ms->buf.src_buf at %p\n", ms->buf.src_buf);
DBG(100, "free ms->buf.src_buf at %p\n", (void *) ms->buf.src_buf);
free((void *) ms->buf.src_buf);
ms->buf.src_buf = NULL;
}
if ( ms->temporary_buffer )
{
DBG(100, "free ms->temporary_buffer at %p\n", ms->temporary_buffer);
DBG(100, "free ms->temporary_buffer at %p\n",
(void *) ms->temporary_buffer);
free((void *) ms->temporary_buffer);
ms->temporary_buffer = NULL;
}
if ( ms->gamma_table )
{
DBG(100, "free ms->gamma_table at %p\n", ms->gamma_table);
DBG(100, "free ms->gamma_table at %p\n", (void *) ms->gamma_table);
free((void *) ms->gamma_table);
ms->gamma_table = NULL;
}
if ( ms->control_bytes )
{
DBG(100, "free ms->control_bytes at %p\n", ms->control_bytes);
DBG(100, "free ms->control_bytes at %p\n", (void *) ms->control_bytes);
free((void *) ms->control_bytes);
ms->control_bytes = NULL;
}
if ( ms->condensed_shading_w )
{
DBG(100, "free ms->condensed_shading_w at %p\n",
ms->condensed_shading_w);
(void *) ms->condensed_shading_w);
free((void *) ms->condensed_shading_w);
ms->condensed_shading_w = NULL;
}
if ( ms->condensed_shading_d )
{
DBG(100, "free ms->condensed_shading_d at %p\n",
ms->condensed_shading_d);
(void *) ms->condensed_shading_d);
free((void *) ms->condensed_shading_d);
ms->condensed_shading_d = NULL;
}
@ -3901,8 +3905,8 @@ get_scan_parameters(Microtek2_Scanner *ms)
if ( y2_dots >= mi->geo_height )
y2_dots = mi->geo_height - 1;
ms->width_dots = x2_dots - ms->x1_dots;
if ( md->model_flags && MD_OFFSET_2 ) /* this firmware has problems with */
if ( ( ms->width_dots % 2 ) == 1 ) /* odd pixel numbers */
if ( md->model_flags & MD_OFFSET_2 ) /* this firmware has problems with */
if ( ( ms->width_dots % 2 ) == 1 ) /* odd pixel numbers */
ms->width_dots -= 1;
if ( ms->width_dots < 10 )
ms->width_dots = 10;
@ -4201,7 +4205,8 @@ scsi_send_gamma(Microtek2_Scanner *ms)
DBG(30, "scsi_send_gamma: pos=%p, size=%d, word=%d, color=%d\n",
ms->gamma_table, ms->lut_size_bytes, ms->word, ms->current_color);
(void *) ms->gamma_table, ms->lut_size_bytes, ms->word,
ms->current_color);
if ( ( 3 * ms->lut_size_bytes ) <= 0xffff ) /*send Gamma with one command*/
{
@ -4465,7 +4470,7 @@ scsi_read_control_bits(Microtek2_Scanner *ms)
int count_1s;
DBG(30, "scsi_read_control_bits: ms=%p, fd=%d\n", (void *) ms, ms->sfd);
DBG(30, "ms->control_bytes = %p\n", ms->control_bytes);
DBG(30, "ms->control_bytes = %p\n", (void *) ms->control_bytes);
RCB_SET_CMD(cmd);
RCB_SET_LENGTH(cmd, ms->n_control_bytes);
@ -4520,7 +4525,7 @@ scsi_set_window(Microtek2_Scanner *ms, int n) { /* n windows, not yet */
size = SW_CMD_L + SW_HEADER_L + n * SW_BODY_L;
setwindow = (uint8_t *) malloc(size);
DBG(100, "scsi_set_window: setwindow= %p, malloc'd %d Bytes\n",
setwindow, size);
(void *) setwindow, size);
if ( setwindow == NULL )
{
DBG(1, "scsi_set_window: malloc for setwindow failed\n");
@ -4592,7 +4597,7 @@ scsi_set_window(Microtek2_Scanner *ms, int n) { /* n windows, not yet */
if ( status != SANE_STATUS_GOOD )
DBG(1, "scsi_set_window: '%s'\n", sane_strstatus(status));
DBG(100, "scsi_set_window: free setwindow at %p\n", setwindow);
DBG(100, "scsi_set_window: free setwindow at %p\n", (void *) setwindow);
free((void *) setwindow);
return status;
}
@ -4665,7 +4670,8 @@ scsi_read_image(Microtek2_Scanner *ms, uint8_t *buffer, int bytes_per_pixel)
uint8_t tmp;
DBG(30, "scsi_read_image: ms=%p, buffer=%p\n", (void *) ms, buffer);
DBG(30, "scsi_read_image: ms=%p, buffer=%p\n",
(void *) ms, (void *) buffer);
ENDIAN_TYPE(endiantype)
RI_SET_CMD(cmd);
@ -4790,7 +4796,7 @@ scsi_read_shading(Microtek2_Scanner *ms, uint8_t *buffer, uint32_t length)
size_t size;
DBG(30, "scsi_read_shading: pos=%p, size=%d, word=%d, color=%d, dark=%d\n",
buffer, length, ms->word, ms->current_color, ms->dark);
(void *) buffer, length, ms->word, ms->current_color, ms->dark);
size = length;
@ -4807,7 +4813,8 @@ scsi_read_shading(Microtek2_Scanner *ms, uint8_t *buffer, uint32_t length)
DBG(100, "scsi_read_shading: sfd=%d, cmd=%p, sizeofcmd=%lu,"
"dest=%p, destsize=%lu\n",
ms->sfd, cmd, (u_long) sizeof(cmd), buffer, (u_long) size);
ms->sfd, (void *) cmd, (u_long) sizeof(cmd), (void *) buffer,
(u_long) size);
status = sanei_scsi_cmd(ms->sfd, cmd, sizeof(cmd), buffer, &size);
if ( status != SANE_STATUS_GOOD )
@ -4837,12 +4844,11 @@ scsi_send_shading(Microtek2_Scanner *ms,
DBG(30, "scsi_send_shading: pos=%p, size=%d, word=%d, color=%d, dark=%d\n",
shading_data, length, ms->word, ms->current_color,
dark);
(void *) shading_data, length, ms->word, ms->current_color, dark);
cmd = (uint8_t *) malloc(SSI_CMD_L + length);
DBG(100, "scsi_send_shading: cmd=%p, malloc'd %d bytes\n",
cmd, SSI_CMD_L + length);
(void *) cmd, SSI_CMD_L + length);
if ( cmd == NULL )
{
DBG(1, "scsi_send_shading: Couldn't get buffer for shading table\n");
@ -4868,7 +4874,7 @@ scsi_send_shading(Microtek2_Scanner *ms,
if ( status != SANE_STATUS_GOOD )
DBG(1, "scsi_send_shading: '%s'\n", sane_strstatus(status));
DBG(100, "free cmd at %p\n", cmd);
DBG(100, "free cmd at %p\n", (void *) cmd);
free((void *) cmd);
return status;
@ -5070,7 +5076,8 @@ scsi_sense_handler (int fd, u_char *sense, void *arg)
uint8_t ascq;
DBG(30, "scsi_sense_handler: fd=%d, sense=%p arg=%p\n",fd, sense, arg);
DBG(30, "scsi_sense_handler: fd=%d, sense=%p arg=%p\n",
fd, (void *) sense, arg);
dump_area(sense, RQS_LENGTH(sense), "SenseBuffer");
@ -5264,7 +5271,7 @@ sane_start(SANE_Handle handle)
if (ms->control_bytes) free((void *)ms->control_bytes);
ms->control_bytes = (uint8_t *) malloc(ms->n_control_bytes);
DBG(100, "sane_start: ms->control_bytes=%p, malloc'd %lu bytes\n",
ms->control_bytes, (u_long) ms->n_control_bytes);
(void *) ms->control_bytes, (u_long) ms->n_control_bytes);
if ( ms->control_bytes == NULL )
{
DBG(1, "sane_start: malloc() for control bits failed\n");
@ -5373,7 +5380,7 @@ sane_start(SANE_Handle handle)
ms->gamma_table = (uint8_t *) malloc(3 * ms->lut_size_bytes );
DBG(100, "sane_start: ms->gamma_table=%p, malloc'd %d bytes\n",
ms->gamma_table, 3 * ms->lut_size_bytes);
(void *) ms->gamma_table, 3 * ms->lut_size_bytes);
if ( ms->gamma_table == NULL )
{
DBG(1, "sane_start: malloc for gammatable failed\n");
@ -5559,7 +5566,7 @@ prepare_buffers(Microtek2_Scanner *ms)
ms->buf.src_buffer[i] = (uint8_t *) malloc(ms->src_buffer_size
+ extra_buf_size);
DBG(100, "prepare_buffers: ms->buf.src_buffer[%d]=%p,"
"malloc'd %d bytes\n", i, ms->buf.src_buffer[i],
"malloc'd %d bytes\n", i, (void *) ms->buf.src_buffer[i],
ms->src_buffer_size + extra_buf_size);
if ( ms->buf.src_buffer[i] == NULL )
{
@ -5579,7 +5586,7 @@ prepare_buffers(Microtek2_Scanner *ms)
free((void *) ms->buf.src_buf);
ms->buf.src_buf = malloc(ms->src_buffer_size);
DBG(100, "sane_start: ms->buf.src_buf=%p, malloc'd %d bytes\n",
ms->buf.src_buf, ms->src_buffer_size);
(void *) ms->buf.src_buf, ms->src_buffer_size);
if ( ms->buf.src_buf == NULL )
{
DBG(1, "sane_start: malloc for scan buffer failed\n");
@ -5602,7 +5609,7 @@ prepare_buffers(Microtek2_Scanner *ms)
{
ms->temporary_buffer = (uint8_t *) malloc(ms->remaining_bytes);
DBG(100, "sane_start: ms->temporary_buffer=%p, malloc'd %d bytes\n",
ms->temporary_buffer, ms->remaining_bytes);
(void *) ms->temporary_buffer, ms->remaining_bytes);
if ( ms->temporary_buffer == NULL )
{
DBG(1, "sane_start: malloc() for temporary buffer failed\n");
@ -5918,7 +5925,8 @@ condense_shading(Microtek2_Scanner *ms)
}
ms->condensed_shading_w = (uint8_t *)malloc(cond_length);
DBG(100, "condense_shading: ms->condensed_shading_w=%p,"
"malloc'd %d bytes\n", ms->condensed_shading_w, cond_length);
"malloc'd %d bytes\n",
(void *) ms->condensed_shading_w, cond_length);
if ( ms->condensed_shading_w == NULL )
{
DBG(1, "condense_shading: malloc for white table failed\n");
@ -5938,7 +5946,8 @@ condense_shading(Microtek2_Scanner *ms)
}
ms->condensed_shading_d = (uint8_t *)malloc(cond_length);
DBG(100, "condense_shading: ms->condensed_shading_d=%p,"
" malloc'd %d bytes\n", ms->condensed_shading_d, cond_length);
" malloc'd %d bytes\n",
(void *) ms->condensed_shading_d, cond_length);
if ( ms->condensed_shading_d == NULL )
{
DBG(1, "condense_shading: malloc for dark table failed\n");
@ -6100,7 +6109,8 @@ read_shading_image(Microtek2_Scanner *ms)
ms->shading_image = malloc(ms->bpl * ms->src_remaining_lines);
DBG(100, "read shading image: ms->shading_image=%p,"
" malloc'd %d bytes\n",
ms->shading_image, ms->bpl * ms->src_remaining_lines);
(void *) ms->shading_image,
ms->bpl * ms->src_remaining_lines);
if ( ms->shading_image == NULL )
{
DBG(1, "read_shading_image: malloc for buffer failed\n");
@ -6166,7 +6176,7 @@ read_shading_image(Microtek2_Scanner *ms)
}
DBG(100, "free memory for ms->shading_image at %p\n",
ms->shading_image);
(void *) ms->shading_image);
free((void *) ms->shading_image);
ms->shading_image = NULL;
}
@ -6241,7 +6251,7 @@ read_shading_image(Microtek2_Scanner *ms)
ms->shading_image = malloc(ms->bpl * ms->src_remaining_lines);
DBG(100, "read shading image: ms->shading_image=%p, malloc'd %d bytes\n",
ms->shading_image, ms->bpl * ms->src_remaining_lines);
(void *) ms->shading_image, ms->bpl * ms->src_remaining_lines);
if ( ms->shading_image == NULL )
{
DBG(1, "read_shading_image: malloc for buffer failed\n");
@ -6328,7 +6338,7 @@ read_shading_image(Microtek2_Scanner *ms)
return status;
DBG(100, "free memory for ms->shading_image at %p\n",
ms->shading_image);
(void *) ms->shading_image);
free((void *) ms->shading_image);
ms->shading_image = NULL;
@ -6360,7 +6370,7 @@ prepare_shading_data(Microtek2_Scanner *ms, uint32_t lines, uint8_t **data)
#endif
DBG(30, "prepare_shading_data: ms=%p, lines=%d, *data=%p\n",
(void *) ms, lines, *data);
(void *) ms, lines, (void *) *data);
md = ms->dev;
mi = &md->info[md->scan_source];
@ -6373,7 +6383,7 @@ prepare_shading_data(Microtek2_Scanner *ms, uint32_t lines, uint8_t **data)
{
*data = (uint8_t *) malloc(length);
DBG(100, "prepare_shading_data: malloc'd %d bytes at %p\n",
length, *data);
length, (void *) *data);
if ( *data == NULL )
{
DBG(1, "prepare_shading_data: malloc for shading table failed\n");
@ -6597,7 +6607,7 @@ read_cx_shading_image(Microtek2_Scanner *ms)
}
ms->shading_image = malloc(shading_bytes);
DBG(100, "read_cx_shading: ms->shading_image=%p, malloc'd %d bytes\n",
ms->shading_image, shading_bytes);
(void *) ms->shading_image, shading_bytes);
if ( ms->shading_image == NULL )
{
DBG(1, "read_cx_shading: malloc for cx_shading buffer failed\n");
@ -6642,7 +6652,7 @@ read_cx_shading_image(Microtek2_Scanner *ms)
if ( ms->shading_image )
{
DBG(100, "free memory for ms->shading_image at %p\n",
ms->shading_image);
(void *) ms->shading_image);
free((void *) ms->shading_image);
ms->shading_image = NULL;
}
@ -6694,7 +6704,7 @@ calc_cx_shading_line(Microtek2_Scanner *ms)
free( (void *)md->shading_table_w );
md->shading_table_w = (uint8_t *) malloc(shading_line_bytes);
DBG(100, "calc_cx_shading: md->shading_table_w=%p, malloc'd %d bytes\n",
md->shading_table_w, shading_line_bytes);
(void *) md->shading_table_w, shading_line_bytes);
if ( md->shading_table_w == NULL )
{
DBG(100, "calc_cx_shading: malloc for white shadingtable failed\n");
@ -6711,7 +6721,7 @@ calc_cx_shading_line(Microtek2_Scanner *ms)
free( (void *)md->shading_table_d);
md->shading_table_d = (uint8_t *) malloc(shading_line_bytes);
DBG(100, "calc_cx_shading: md->shading_table_d=%p, malloc'd %d bytes\n",
md->shading_table_d, shading_line_bytes);
(void *) md->shading_table_d, shading_line_bytes);
if ( md->shading_table_d == NULL )
{
@ -6729,8 +6739,9 @@ calc_cx_shading_line(Microtek2_Scanner *ms)
"shading_line_bytes=%d\n"
"shading_line_pixels=%d\n"
"shading_table_pointer=%p\n",
(void *) ms, md->shading_table_w, md->shading_table_d,
shading_line_bytes, shading_line_pixels, shading_table_pointer);
(void *) ms, (void *) md->shading_table_w,
(void *) md->shading_table_d, shading_line_bytes,
shading_line_pixels, (void *) shading_table_pointer);
/* calculating the median pixel values over the shading lines */
/* and write them to the shading table */
@ -6862,7 +6873,7 @@ calculate_gamma(Microtek2_Scanner *ms, uint8_t *pos, int color, char *mode)
DBG(30, "calculate_gamma: ms=%p, pos=%p, color=%d, mode=%s\n",
(void *) ms, pos, color, mode);
(void *) ms, (void *) pos, color, mode);
md = ms->dev;
mi = &md->info[md->scan_source];
@ -6980,7 +6991,7 @@ shading_function(Microtek2_Scanner *ms, uint8_t *data)
int i;
DBG(40, "shading_function: ms=%p, data=%p\n", (void *) ms, data);
DBG(40, "shading_function: ms=%p, data=%p\n", (void *) ms, (void *) data);
md = ms->dev;
mi = &md->info[md->scan_source];
@ -7174,8 +7185,9 @@ reader_process(void *data)
ms->transfer_length = ms->src_lines_to_read * ms->bpl;
DBG(30, "reader_process: transferlength=%d, lines=%d, linelength=%d, "
"real_bpl=%d, srcbuf=%p\n", ms->transfer_length,
ms->src_lines_to_read, ms->bpl, ms->real_bpl, ms->buf.src_buf);
"real_bpl=%d, srcbuf=%p\n",
ms->transfer_length, ms->src_lines_to_read, ms->bpl,
ms->real_bpl, (void *) ms->buf.src_buf);
sigprocmask (SIG_BLOCK, &sigterm_set, 0);
status = scsi_read_image(ms, ms->buf.src_buf, (ms->depth > 8) ? 2 : 1);
@ -7333,7 +7345,7 @@ chunky_copy_pixels(Microtek2_Scanner *ms, uint8_t *from)
int color;
DBG(30, "chunky_copy_pixels: from=%p, pixels=%d, fp=%p, depth=%d\n",
from, ms->ppl, (void *) ms->fp, ms->depth);
(void *) from, ms->ppl, (void *) ms->fp, ms->depth);
md = ms->dev;
if ( ms->depth > 8 )
@ -7512,7 +7524,7 @@ segreg_proc_data(Microtek2_Scanner *ms)
}
DBG(30, "segreg_proc_data: src_buf=%p, free_lines=%d\n",
ms->buf.src_buf, ms->buf.free_lines);
(void *) ms->buf.src_buf, ms->buf.free_lines);
return SANE_STATUS_GOOD;
}
@ -7881,7 +7893,7 @@ wordchunky_copy_pixels(uint8_t *from, uint32_t pixels, int depth, FILE *fp)
int color;
DBG(30, "wordchunky_copy_pixels: from=%p, pixels=%d, depth=%d\n",
from, pixels, depth);
(void *) from, pixels, depth);
if ( depth > 8 )
{
@ -7993,7 +8005,7 @@ gray_copy_pixels(Microtek2_Scanner *ms,
float s_w, s_d, shading_factor = 0;
DBG(30, "gray_copy_pixels: pixels=%d, from=%p, fp=%p, depth=%d\n",
ms->ppl, from, (void *) ms->fp, ms->depth);
ms->ppl, (void *) from, (void *) ms->fp, ms->depth);
md = ms->dev;
step = right_to_left == 1 ? -1 : 1;
@ -8228,7 +8240,7 @@ lineartfake_copy_pixels(Microtek2_Scanner *ms,
DBG(30, "lineartfake_copy_pixels: from=%p,pixels=%d,threshold=%d,file=%p\n",
from, pixels, threshold, (void *) fp);
(void *) from, pixels, threshold, (void *) fp);
md = ms->dev;
bit = 0;
dest = 0;
@ -8302,7 +8314,7 @@ auto_adjust_proc_data(Microtek2_Scanner *ms, uint8_t **temp_current)
DBG(30, "auto_adjust_proc_data: ms=%p, temp_current=%p\n",
(void *) ms, *temp_current);
(void *) ms, (void *) *temp_current);
md = ms->dev;
mi = &md->info[md->scan_source];

Wyświetl plik

@ -827,7 +827,7 @@ typedef struct Microtek2_Info {
SANE_Byte nlens;
SANE_Byte nwindows;
SANE_Byte shtrnsferequ;
#define MI_WHITE_SHADING_ONLY(x) ((x) & 0x20) == 0
#define MI_WHITE_SHADING_ONLY(x) (((x) & 0x20) == 0)
#define MI_HAS_SCNBTTN SANE_TRUE
SANE_Bool scnbuttn;
#define MI_HAS_PIPOBUF SANE_TRUE

Wyświetl plik

@ -4656,7 +4656,7 @@ output_data (Mustek_Scanner * s, FILE * fp,
SANE_Int y, num_lines;
DBG (5, "output_data: data=%p, lpb=%d, bpl=%d, extra=%p\n",
data, lines_per_buffer, bpl, extra);
(void *) data, lines_per_buffer, bpl, (void *) extra);
/* convert to pixel-interleaved format: */
if ((s->mode & MUSTEK_MODE_COLOR)

Wyświetl plik

@ -2092,7 +2092,7 @@ SetMotorCurrent (PAsic chip, unsigned short dwMotorSpeed,
STATUS status = STATUS_GOOD;
DBG (DBG_ASIC, "SetMotorCurrent:Enter\n");
chip = chip;
(void) chip;
if (dwMotorSpeed < 2000)
{
@ -3901,12 +3901,12 @@ Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
BytePerPixel = 2;
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2;
}
else if ((bScanBits == 8))
else if (bScanBits == 8)
{
BytePerPixel = 1;
chip->dwBytesCountPerRow = (unsigned int) (wWidth);
}
else if ((bScanBits < 8))
else if (bScanBits < 8)
{
BytePerPixel = 1;
chip->dwBytesCountPerRow = (unsigned int) (wWidth);
@ -4596,7 +4596,7 @@ static STATUS
Asic_SetMotorType (PAsic chip, SANE_Bool isMotorMove, SANE_Bool isUniformSpeed)
{
STATUS status = STATUS_GOOD;
isUniformSpeed = isUniformSpeed;
(void) isUniformSpeed;
DBG (DBG_ASIC, "Asic_SetMotorType:Enter\n");
if (isMotorMove)
@ -4680,7 +4680,7 @@ Asic_CarriageHome (PAsic chip, SANE_Bool isTA)
{
STATUS status = STATUS_GOOD;
SANE_Bool LampHome, TAHome;
isTA = isTA;
(void) isTA;
DBG (DBG_ASIC, "Asic_CarriageHome:Enter\n");
@ -4705,7 +4705,7 @@ Asic_SetShadingTable (PAsic chip, unsigned short * lpWhiteShading,
double dbXRatioAdderDouble;
unsigned int wShadingTableSize;
wX = wX;
(void) wX;
DBG (DBG_ASIC, "Asic_SetShadingTable:Enter\n");
if (chip->firmwarestate < FS_OPENED)
@ -4807,7 +4807,7 @@ Asic_WaitCarriageHome (PAsic chip, SANE_Bool isTA)
SANE_Bool LampHome, TAHome;
int i;
isTA = isTA;
(void) isTA;
DBG (DBG_ASIC, "Asic_WaitCarriageHome:Enter\n");
@ -4926,13 +4926,13 @@ Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
BytePerPixel = 2;
chip->dwBytesCountPerRow = (unsigned int) (wWidth) * 2;
}
else if ((bScanBits == 8))
else if (bScanBits == 8)
{
wPerLineNeedBufferSize = wWidth;
BytePerPixel = 1;
chip->dwBytesCountPerRow = (unsigned int) (wWidth);
}
else if ((bScanBits < 8))
else if (bScanBits < 8)
{
wPerLineNeedBufferSize = wWidth >> 3;
BytePerPixel = 1;

Wyświetl plik

@ -2132,7 +2132,7 @@ MustScanner_GetMono16BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short wLinePos = 0;
unsigned short i;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono16BitLine: call in\n");
@ -2228,7 +2228,7 @@ MustScanner_GetMono16BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert
unsigned short i;
SANE_Byte * lpTemp = lpLine;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono16BitLine1200DPI: call in\n");
TotalXferLines = 0;
@ -2407,7 +2407,7 @@ MustScanner_GetMono8BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short i;
unsigned short wLinePos = 0;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono8BitLine: call in\n");
TotalXferLines = 0;
@ -2502,7 +2502,7 @@ MustScanner_GetMono8BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short i;
SANE_Byte bNextPixel = 0;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono8BitLine1200DPI: call in\n");
TotalXferLines = 0;
@ -2660,7 +2660,7 @@ MustScanner_GetMono1BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short wLinePos;
unsigned short i;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono1BitLine: call in\n");
@ -2752,7 +2752,7 @@ MustScanner_GetMono1BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert,
unsigned short wLinePosOdd;
unsigned short wLinePosEven;
isOrderInvert = isOrderInvert;
(void) isOrderInvert;
DBG (DBG_FUNC, "MustScanner_GetMono1BitLine1200DPI: call in\n");
@ -2919,7 +2919,7 @@ MustScanner_CalculateMaxMin (SANE_Byte * pBuffer, unsigned short * lpMaxValue,
unsigned short *wSecData = NULL, *wDarkSecData = NULL;
int i, j;
wResolution = wResolution;
(void) wResolution;
wSecData = (unsigned short *) malloc (sizeof (unsigned short) * g_nSecNum);
if (wSecData == NULL)
@ -3001,7 +3001,7 @@ MustScanner_ReadDataFromScanner (void * dummy)
unsigned short wScanLinesThisBlock;
unsigned short wBufferLines = g_wLineDistance * 2 + g_wPixelDistance;
dummy = dummy;
(void) dummy;
DBG (DBG_FUNC,
"MustScanner_ReadDataFromScanner: call in, and in new thread\n");

Wyświetl plik

@ -362,7 +362,7 @@ Reflective_SetupScan (COLORMODE ColorMode,
unsigned short YDpi,
SANE_Bool isInvert, unsigned short X, unsigned short Y, unsigned short Width, unsigned short Height)
{
isInvert = isInvert;
(void) isInvert;
DBG (DBG_FUNC, "Reflective_SetupScan: Call in\n");
if (g_bOpened)
{

Wyświetl plik

@ -305,7 +305,7 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short
SANE_Bool hasTA;
unsigned short wTAShadingMinus = 0;
isInvert = isInvert;
(void) isInvert;
DBG (DBG_FUNC, "Transparent_SetupScan: call in\n");
if (g_bOpened)

Wyświetl plik

@ -2672,7 +2672,7 @@ usb_high_scan_get_rgb_24_bit_line (Mustek_Usb_Device * dev, SANE_Byte * line,
SANE_Word lines_left;
DBG (5, "usb_high_scan_get_rgb_24_bit_line: start, dev=%p, line=%p, "
"is_order_invert=%d\n", (void *) dev, line, is_order_invert);
"is_order_invert=%d\n", (void *) dev, (void *) line, is_order_invert);
RIE (usb_low_get_row (dev->chip, dev->green, &lines_left));
@ -2701,7 +2701,7 @@ usb_high_scan_get_mono_8_bit_line (Mustek_Usb_Device * dev, SANE_Byte * line,
SANE_Word lines_left;
DBG (5, "usb_high_scan_get_mono_8_bit_line: start, dev=%p, line=%p, "
"is_order_invert=%d\n", (void *) dev, line, is_order_invert);
"is_order_invert=%d\n", (void *) dev, (void *) line, is_order_invert);
RIE (usb_low_get_row (dev->chip, dev->green, &lines_left));
RIE (usb_high_cal_calibrate (dev->mono_calibrator, dev->green +

Wyświetl plik

@ -290,7 +290,7 @@ sense_handler(int fd, u_char *sense_buffer, void *ss)
int sense_key;
NEC_Sense_Data *sdat = (NEC_Sense_Data *) ss;
fd = fd; /* silence compilation warnings */
(void) fd; /* silence compilation warnings */
#define add_sense_code sense_buffer[12]
#define add_sense_qual sense_buffer[13]
@ -1890,7 +1890,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
NEC_New_Device *np;
int i;
authorize = authorize; /* silence compilation warnings */
(void) authorize; /* silence compilation warnings */
DBG_INIT ();
DBG (10, "<< sane_init ");
@ -2079,7 +2079,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int i;
DBG (10, "<< sane_get_devices ");
local_only = local_only; /* silence compilation warnings */
(void) local_only; /* silence compilation warnings */
if (devlist)
free (devlist);
@ -2714,7 +2714,7 @@ send_binary_g_table(NEC_Scanner *s, SANE_Word *a, int dtq)
SANE_Status status;
unsigned int i, j;
dtq = dtq; /* silence compilation warnings */
(void) dtq; /* silence compilation warnings */
DBG(11, "<< send_binary_g_table\n");
@ -3696,8 +3696,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle;
non_blocking = non_blocking; /* silence compilation warnings */
(void) handle;
(void) non_blocking; /* silence compilation warnings */
DBG (10, "<< sane_set_io_mode");
DBG (10, ">>\n");
@ -3708,8 +3708,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle;
fd = fd; /* silence compilation warnings */
(void) handle;
(void) fd; /* silence compilation warnings */
DBG (10, "<< sane_get_select_fd");
DBG (10, ">>\n");

Wyświetl plik

@ -705,9 +705,9 @@ net_avahi_resolve_callback (AvahiServiceResolver *r, AvahiIfIndex interface, Ava
char *t;
/* unused */
interface = interface;
protocol = protocol;
userdata = userdata;
(void) interface;
(void) protocol;
(void) userdata;
if (!r)
return;
@ -759,8 +759,8 @@ net_avahi_browse_callback (AvahiServiceBrowser *b, AvahiIfIndex interface, Avahi
AvahiProtocol proto;
/* unused */
flags = flags;
userdata = userdata;
(void) flags;
(void) userdata;
if (!b)
return;
@ -808,7 +808,7 @@ net_avahi_callback (AvahiClient *c, AvahiClientState state, void * userdata)
int error;
/* unused */
userdata = userdata;
(void) userdata;
if (!c)
return;
@ -1201,7 +1201,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
char *full_name;
int i, num_devs;
size_t len;
#define ASSERT_SPACE(n) \
#define ASSERT_SPACE(n) do \
{ \
if (devlist_len + (n) > devlist_size) \
{ \
@ -1216,7 +1216,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
return SANE_STATUS_NO_MEM; \
} \
} \
}
} while (0)
DBG (3, "sane_get_devices: local_only = %d\n", local_only);
@ -2132,7 +2132,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length,
int is_even;
DBG (3, "sane_read: handle=%p, data=%p, max_length=%d, length=%p\n",
handle, data, max_length, (void *) length);
handle, (void *) data, max_length, (void *) length);
if (!length)
{
DBG (1, "sane_read: length == NULL\n");

Wyświetl plik

@ -1368,7 +1368,7 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len)
TDataPipe *p;
TModeParam const *pMode;
DBG (DBG_MSG, "sane_read: buf=%p, maxlen=%d, ", buf, maxlen);
DBG (DBG_MSG, "sane_read: buf=%p, maxlen=%d, ", (void *) buf, maxlen);
s = (TScanner *) h;

Wyświetl plik

@ -157,7 +157,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_count++;
@ -459,8 +459,8 @@ SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fdp)
{
/* make compiler happy ... */
handle = handle;
fdp = fdp;
(void) handle;
(void) fdp;
DBG (DBG_proc, "sane_get_select_fd: start\n");
DBG (DBG_warn, "sane_get_select_fd: unsupported ...\n");
@ -1595,7 +1595,7 @@ config_attach (SANEI_Config __sane_unused__ * config, const char *devname,
/* currently, the config is a global variable so config is useless here */
/* the correct thing would be to have a generic sanei_attach_matching_devices
* using an attach function with a config parameter */
config = config;
(void) config;
/* the devname has been processed and is ready to be used
* directly. The config struct contains all the configuration data for

Wyświetl plik

@ -189,9 +189,12 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) };
#define get_inquiry_additional_length(in) in[0x04]
#define set_inquiry_length(out,n) out[0x04]=n-5
#define get_inquiry_vendor(in, buf) strncpy(buf, in + 0x08, 0x08)
#define get_inquiry_product(in, buf) strncpy(buf, in + 0x10, 0x010)
#define get_inquiry_version(in, buf) strncpy(buf, in + 0x20, 0x04)
#define get_inquiry_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, in + 0x08)
#define get_inquiry_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, in + 0x10)
#define get_inquiry_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, in + 0x20)
#define get_inquiry_max_x_res(in) getnbyte1(in + 0x24, 2)
#define get_inquiry_max_y_res(in) getnbyte1(in + 0x26, 2)

Wyświetl plik

@ -744,11 +744,8 @@ pie_get_inquiry_values (Pie_Device * dev, unsigned char *buffer)
dev->inquiry_len = get_inquiry_additional_length (buffer) + 5;
get_inquiry_vendor ((char *) buffer, dev->vendor);
dev->vendor[8] = '\0';
get_inquiry_product ((char *) buffer, dev->product);
dev->product[16] = '\0';
get_inquiry_version ((char *) buffer, dev->version);
dev->version[4] = '\0';
dev->inquiry_x_res = get_inquiry_max_x_res (buffer);
dev->inquiry_y_res = get_inquiry_max_y_res (buffer);

Wyświetl plik

@ -1436,7 +1436,7 @@ SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
DBG(DBG_info_sane,"sane_get_select_fd(): not supported (only for non-blocking IO)\n");
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -205,7 +205,8 @@ sanei_pieusb_cmd_test_unit_ready(SANE_Int device_number, struct Pieusb_Command_S
status->pieusb_status = sanei_pieusb_command (device_number, command, NULL, 0);
DBG (DBG_info_scan, "sanei_pieusb_cmd_test_unit_ready() return status = %s\n", sane_strstatus(status->pieusb_status));
DBG (DBG_info_scan, "sanei_pieusb_cmd_test_unit_ready() return status = %s\n",
sane_strstatus (sanei_pieusb_convert_status (status->pieusb_status)));
}
/**

Wyświetl plik

@ -260,7 +260,7 @@ sanei_pieusb_find_device_callback (const char *devicename)
free (dev);
DBG (DBG_error, "sanei_pieusb_find_device_callback: get scanner properties (5 bytes) failed with %d\n", status.pieusb_status);
sanei_usb_close (device_number);
return status.pieusb_status;
return sanei_pieusb_convert_status (status.pieusb_status);
}
/* get full inquiry data */
sanei_pieusb_cmd_inquiry(device_number, &inq, inq.additionalLength+4, &status);
@ -268,7 +268,7 @@ sanei_pieusb_find_device_callback (const char *devicename)
free (dev);
DBG (DBG_error, "sanei_pieusb_find_device_callback: get scanner properties failed\n");
sanei_usb_close (device_number);
return status.pieusb_status;
return sanei_pieusb_convert_status (status.pieusb_status);
}
/* Close the device again */
@ -1781,7 +1781,7 @@ sanei_pieusb_set_frame_from_options(Pieusb_Scanner * scanner)
scanner->frame.index = 0x80; /* 0x80: value from cyberview */
sanei_pieusb_cmd_set_scan_frame (scanner->device_number, scanner->frame.index, &(scanner->frame), &status);
DBG (DBG_info_sane, "sanei_pieusb_set_frame_from_options(): sanei_pieusb_cmd_set_scan_frame status %s\n", sane_strstatus (sanei_pieusb_convert_status (status.pieusb_status)));
return status.pieusb_status;
return sanei_pieusb_convert_status (status.pieusb_status);
}
/*

Wyświetl plik

@ -899,7 +899,7 @@ print_scan_param (int level, const pixma_scan_param_t * sp)
pixma_dbg (level, " dpi=%ux%u offset=(%u,%u) dimension=%ux%u\n",
sp->xdpi, sp->ydpi, sp->x, sp->y, sp->w, sp->h);
pixma_dbg (level, " gamma=%f gamma_table=%p source=%d\n", sp->gamma,
sp->gamma_table, sp->source);
(void *) sp->gamma_table, sp->source);
pixma_dbg (level, " adf-wait=%d\n", sp->adf_wait);
}
#endif

Wyświetl plik

@ -877,7 +877,7 @@ pixma_scan (pixma_t * s, pixma_scan_param_t * sp)
sp->line_size, sp->image_size, sp->channels, sp->depth);
pixma_dbg (3, " dpi=%ux%u offset=(%u,%u) dimension=%ux%u\n",
sp->xdpi, sp->ydpi, sp->x, sp->y, sp->w, sp->h);
pixma_dbg (3, " gamma=%f gamma_table=%p source=%d\n", sp->gamma, sp->gamma_table, sp->source);
pixma_dbg (3, " gamma=%f gamma_table=%p source=%d\n", sp->gamma, (void *) sp->gamma_table, sp->source);
pixma_dbg (3, " threshold=%d threshold_curve=%d\n", sp->threshold, sp->threshold_curve);
pixma_dbg (3, " adf-wait=%d\n", sp->adf_wait);
pixma_dbg (3, " ADF page count: %d\n", sp->adf_pageid);

Wyświetl plik

@ -709,7 +709,7 @@ send_scan_param (pixma_t * s)
if (mp->generation <= 2)
{
PDBG (pixma_dbg (4, "*send_scan_param gen. 1-2 ***** Setting: xdpi=%hi ydpi=%hi x=%i y=%i wx=%i ***** \n",
PDBG (pixma_dbg (4, "*send_scan_param gen. 1-2 ***** Setting: xdpi=%u ydpi=%u x=%i y=%i wx=%i ***** \n",
xdpi, ydpi, x-xs, y, wx));
data = pixma_newcmd (&mp->cb, cmd_scan_param, 0x30, 0);
pixma_set_be16 (xdpi | 0x8000, data + 0x04);
@ -731,7 +731,7 @@ send_scan_param (pixma_t * s)
}
else
{
PDBG (pixma_dbg (4, "*send_scan_param gen. 3+ ***** Setting: xdpi=%hi ydpi=%hi x=%i xs=%i y=%i wx=%i h=%i ***** \n",
PDBG (pixma_dbg (4, "*send_scan_param gen. 3+ ***** Setting: xdpi=%u ydpi=%u x=%i xs=%i y=%i wx=%i h=%i ***** \n",
xdpi, ydpi, x, xs, y, wx, h));
data = pixma_newcmd (&mp->cb, cmd_scan_param_3, 0x38, 0);
data[0x00] = (is_scanning_from_adf (s)) ? 0x02 : 0x01;
@ -1658,7 +1658,7 @@ mp150_finish_scan (pixma_t * s)
else
PDBG (pixma_dbg (4, "*mp150_finish_scan***** wait for next page from ADF *****\n"));
mp->state = state_idle;
mp->state = state_idle;
/* fall through */
case state_idle:
break;

Wyświetl plik

@ -432,10 +432,10 @@ step1 (pixma_t * s)
int tmo = 10; /* like Windows driver, 10 sec CCD calibration ? */
while (--tmo >= 0)
{
error = handle_interrupt (s, 1000); \
if (s->cancel) \
return PIXMA_ECANCELED; \
if (error != PIXMA_ECANCELED && error < 0) \
error = handle_interrupt (s, 1000);
if (s->cancel)
return PIXMA_ECANCELED;
if (error != PIXMA_ECANCELED && error < 0)
return error;
PDBG (pixma_dbg (2, "CCD Calibration ends in %d sec.\n", tmo));
}

Wyświetl plik

@ -3128,7 +3128,7 @@ _LOC Bool MotorP96AheadToDarkArea( pScanData ps )
if((bDark < 0x80) || (wTotalLastLine==wTL)) {
IOCmdRegisterToScanner( ps, ps->RegMotorControl, 0 );
return _TRUE;
return _TRUE;
}
}
#else
@ -3216,9 +3216,10 @@ _LOC void MotorP98003BackToHomeSensor( pScanData ps )
MiscStartTimer( &timer, _SECOND * 2 );
while(!(IOGetScanState( ps, _TRUE ) & _SCANSTATE_STOP) &&
!MiscCheckTimer( &timer ));
!MiscCheckTimer( &timer ))
;
_DODELAY( 1000UL );
_DODELAY( 1000UL );
ps->AsicReg.RD_ModeControl = _ModeScan;
@ -3324,7 +3325,8 @@ _LOC void MotorP98003PositionYProc( pScanData ps, ULong steps)
MiscStartTimer( &timer, _SECOND * 5 );
while(!(IOGetScanState( ps, _TRUE ) & _SCANSTATE_STOP) &&
(!MiscCheckTimer( &timer )));
!MiscCheckTimer( &timer ))
;
_DODELAY( 12 );

Wyświetl plik

@ -472,7 +472,7 @@ static void p12Init98003( pScanData ps, Bool shading )
if( _AGFA_SCANNER == ps->Device.bPCBID )
ps->Device.bDACType = _DA_WOLFSON8141;
DBG( DBG_LOW, "PCB-ID=0x%02x, CCD-ID=0x%02x, DAC-TYPE=0x%02x\n",
DBG( DBG_LOW, "PCB-ID=0x%02x, CCD-ID=0x%02x, DAC-TYPE=0x%02x\n",
ps->Device.bPCBID, ps->Device.bCCDID, ps->Device.bDACType );
p12InitiateComponentModel( ps );

Wyświetl plik

@ -613,9 +613,9 @@ static void p48xxSetGeneralRegister( pScanData ps )
if (ps->DataInf.xyPhyDpi.x <= 200)
ps->AsicReg.RD_ScanControl |= _SCAN_1ST_AVERAGE;
DBG( DBG_LOW, "RD_ModeControl = 0x%02x\n", ps->AsicReg.RD_ModeControl );
DBG( DBG_LOW, "RD_MotorControl = 0x%02x\n", ps->Asic96Reg.RD_MotorControl );
DBG( DBG_LOW, "RD_ScanControl = 0x%02x\n", ps->AsicReg.RD_ScanControl );
DBG( DBG_LOW, "RD_ModeControl = 0x%02x\n", ps->AsicReg.RD_ModeControl );
DBG( DBG_LOW, "RD_MotorControl = 0x%02x\n", ps->Asic96Reg.RD_MotorControl );
DBG( DBG_LOW, "RD_ScanControl = 0x%02x\n", ps->AsicReg.RD_ScanControl );
}
/*.............................................................................

Wyświetl plik

@ -685,7 +685,7 @@ static u_char usb_GetNewGain( Plustek_Device *dev, u_short wMax, int channel )
dwInc = (u_long)((0.93 + ceil (dRatio) * 0.067) * wMax / dAmp);
dwDec = (u_long)((0.93 + floor (dRatio) * 0.067) * wMax / dAmp);
if((dwInc >= 0xff00) ||
(labs (dwInc - m_dwIdealGain) > labs(dwDec - m_dwIdealGain))) {
(dwInc - m_dwIdealGain > m_dwIdealGain - dwDec)) {
bGain = (u_char)floor(dRatio);
} else {
bGain = (u_char)ceil(dRatio);

Wyświetl plik

@ -1444,7 +1444,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
char dev_name[PATH_MAX], *str;
size_t len;
FILE *fp;
authorize = authorize; /* silence compilation warnings */
(void) authorize; /* silence compilation warnings */
DBG_INIT ();
@ -1511,7 +1511,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
DBG (5, "sane_get_devices: enter\n");
local_only = local_only; /* silence compilation warnings */
(void) local_only; /* silence compilation warnings */
if (devlist)
free (devlist);
@ -2119,7 +2119,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
len = s->bytes_per_frame - s->num_bytes;
DBG (8, "read(buf=%p,num_bytes=%ld,max_len=%d,len=%ld)\n",
buf, (long) s->num_bytes, max_len, (long) len);
(void *) buf, (long) s->num_bytes, max_len, (long) len);
nread = read (s->read_fd, buf, len);
if (nread <= 0)

Wyświetl plik

@ -485,7 +485,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
char devnam[PATH_MAX] = "/dev/scanner";
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
DBG (11, ">> sane_init\n");
@ -514,7 +514,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
continue; /* ignore empty lines */
/* skip white space: */
for (lp = line; isspace(*lp); ++lp);
for (lp = line; isspace(*lp); ++lp)
;
strcpy (devnam, lp);
}
fclose (fp);
@ -550,7 +551,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
Ricoh_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
DBG (11, ">> sane_get_devices\n");
@ -1007,8 +1008,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle; /* silence gcc */
non_blocking = non_blocking; /* silence gcc */
(void) handle; /* silence gcc */
(void) non_blocking; /* silence gcc */
DBG (5, ">> sane_set_io_mode\n");
DBG (5, "<< sane_set_io_mode\n");
@ -1019,8 +1020,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
DBG (5, ">> sane_get_select_fd\n");
DBG (5, "<< sane_get_select_fd\n");

Wyświetl plik

@ -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;

Wyświetl plik

@ -124,8 +124,8 @@ test_ready (int fd)
static SANE_Status
sense_handler (int scsi_fd, u_char *result, void *arg)
{
scsi_fd = scsi_fd;
arg = arg; /* silence compilation warnings */
(void) scsi_fd;
(void) arg; /* silence compilation warnings */
if (result[0])
{
@ -141,7 +141,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
static SANE_Status
stop_scan (int fd)
{
fd = fd; /* silence compilation warnings */
(void) fd; /* silence compilation warnings */
/* XXX don't know how to stop the scanner. To be tested ! */
#if 0
@ -829,7 +829,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence compilation warnings */
(void) authorize; /* silence compilation warnings */
DBG_INIT ();
@ -882,7 +882,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
S9036_Device *dev;
int i;
local_only = local_only; /* silence compilation warnings */
(void) local_only; /* silence compilation warnings */
if (devlist)
free (devlist);
@ -1327,7 +1327,7 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle; /* silence compilation warnings */
(void) handle; /* silence compilation warnings */
DBG (1, "sane_set_io_mode(%d)\n", non_blocking);
@ -1338,8 +1338,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle;
fd = fd; /* silence compilation warnings */
(void) handle;
(void) fd; /* silence compilation warnings */
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -66,7 +66,7 @@ static int TransferControlMsg(TInstance *this,
{
SANE_Status err;
cJiffiesTimeout = cJiffiesTimeout;
(void) cJiffiesTimeout;
err = sanei_usb_control_msg (this->hScanner,
nReqType,
@ -95,8 +95,8 @@ static int TransferBulkRead(TInstance *this,
int err;
size_t sz = cchMax;
nEndPoint = nEndPoint;
cJiffiesTimeout = cJiffiesTimeout;
(void) nEndPoint;
(void) cJiffiesTimeout;
err = sanei_usb_read_bulk(this->hScanner,
pBuffer,

Wyświetl plik

@ -385,7 +385,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authCB)
DBG_INIT();
authCB=authCB; /* compiler */
(void) authCB; /* compiler */
DBG(DEBUG_VERBOSE,"SM3600 init\n");
if (version_code)
@ -783,7 +783,7 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode(SANE_Handle h, SANE_Bool m)
{
h=h;
(void) h;
if (m==SANE_TRUE) /* no non-blocking-mode */
return SANE_STATUS_UNSUPPORTED;
return SANE_STATUS_GOOD;
@ -792,6 +792,6 @@ sane_set_io_mode(SANE_Handle h, SANE_Bool m)
SANE_Status
sane_get_select_fd(SANE_Handle handle, SANE_Int *fd)
{
handle=handle; fd=fd;
(void) handle; (void) fd;
return SANE_STATUS_UNSUPPORTED; /* we have no file IO */
}

Wyświetl plik

@ -145,11 +145,12 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
unsigned char c, d;
int i;
DBG (2, "+sane-read:%p %p %d %p\n", (unsigned char *) s, buf, max_len,
(unsigned char *) len);
DBG (2, "+sane-read:%p %p %d %p\n", (void *) s, (void *) buf, max_len,
(void *) len);
DBG (2,
"+sane-read:remain:%lu offset:%lu linesleft:%d linebuff:%p linesread:%d\n",
(u_long)s->remaining, (u_long)s->offset, s->linesleft, s->line_buffer, s->linesread);
(u_long) s->remaining, (u_long) s->offset, s->linesleft,
(void *) s->line_buffer, s->linesread);
if (!s->scanning)
return SANE_STATUS_INVAL;
@ -798,7 +799,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle)
/* empty devicename -> use first device */
dev = first_dev;
}
DBG (2, "using device: %s %p\n", dev->sane.name, (unsigned char *) dev);
DBG (2, "using device: %s %p\n", dev->sane.name, (void *) dev);
if (!dev)
return SANE_STATUS_INVAL;
s = calloc (sizeof (*s), 1);

Wyświetl plik

@ -64,8 +64,8 @@ my_usb_bulk_write (p_usb_dev_handle dev, int ep,
SANE_Status status;
size_t my_size;
timeout = timeout;
ep = ep;
(void) timeout;
(void) ep;
my_size = size;
status =
sanei_usb_write_bulk ((SANE_Int) dev, (SANE_Byte *) bytes, &my_size);
@ -81,8 +81,8 @@ my_usb_bulk_read (p_usb_dev_handle dev, int ep,
SANE_Status status;
size_t my_size;
timeout = timeout;
ep = ep;
(void) timeout;
(void) ep;
my_size = size;
status =
sanei_usb_read_bulk ((SANE_Int) dev, (SANE_Byte *) bytes, &my_size);
@ -98,7 +98,7 @@ my_usb_control_msg (p_usb_dev_handle dev, int requesttype,
{
SANE_Status status;
timeout = timeout;
(void) timeout;
status = sanei_usb_control_msg ((SANE_Int) dev, (SANE_Int) requesttype,
(SANE_Int) request, (SANE_Int) value,
(SANE_Int) index, (SANE_Int) size,
@ -200,9 +200,8 @@ idle_ab (p_usb_dev_handle udev)
/* CW: 40 04 00b0 0000 <len> : <reg1> <value1> <reg2> <value2> ... */
static void
write_regs (p_usb_dev_handle udev, int regs, unsigned char reg1,
unsigned char val1,
... /*unsigned char reg, unsigned char val, ... */ )
write_regs (p_usb_dev_handle udev, int regs, int reg1, int val1,
... /* int reg, int val, ... */ )
{
unsigned char buff[512];
va_list marker;

Wyświetl plik

@ -81,9 +81,8 @@ static int my_usb_control_msg (p_usb_dev_handle dev, int requesttype,
#include "sm3840_params.h"
static void idle_ab (p_usb_dev_handle udev);
static void write_regs (p_usb_dev_handle udev, int regs, unsigned char reg1,
unsigned char val1,
... /*unsigned char reg, unsigned char val, ... */ );
static void write_regs (p_usb_dev_handle udev, int regs, int reg1, int val1,
... /* int reg, int val, ... */ );
static int write_vctl (p_usb_dev_handle udev, int request, int value,
int index, unsigned char byte);
static int read_vctl (p_usb_dev_handle udev, int request, int value,
@ -122,9 +121,8 @@ static void set_gain_black (p_usb_dev_handle udev,
int r_black, int g_black, int b_black);
static void idle_ab (p_usb_dev_handle udev);
static void write_regs (p_usb_dev_handle udev, int regs, unsigned char reg1,
unsigned char val1,
... /*unsigned char reg, unsigned char val, ... */ );
static void write_regs (p_usb_dev_handle udev, int regs, int reg1, int val1,
... /* int reg, int val, ... */ );
static int write_vctl (p_usb_dev_handle udev, int request, int value,
int index, unsigned char byte);
static int read_vctl (p_usb_dev_handle udev, int request, int value,

Wyświetl plik

@ -1107,7 +1107,7 @@ SANE_Status sane_control_option (SANE_Handle h,
"%s: writing \"%s\" to location %p\n",
me,
pss->mode_s,
(SANE_String) v);
(void *) v);
strcpy ((SANE_String) v, pss->mode_s);
break;
case OPT_PREVIEW_MODE:
@ -1115,7 +1115,7 @@ SANE_Status sane_control_option (SANE_Handle h,
"%s: writing \"%s\" to location %p\n",
me,
pss->preview_mode_s,
(SANE_String) v);
(void *) v);
strcpy ((SANE_String) v, pss->preview_mode_s);
break;
case OPT_SOURCE:
@ -1144,7 +1144,7 @@ SANE_Status sane_control_option (SANE_Handle h,
"%s: writing \"%s\" to location %p\n",
me,
pss->predef_window,
(SANE_String) v);
(void *) v);
strcpy ((SANE_String) v, pss->predef_window);
break;
case OPT_GAMMA_GS:
@ -1179,7 +1179,7 @@ SANE_Status sane_control_option (SANE_Handle h,
"%s: writing \"%s\" to location %p\n",
me,
pss->dither_matrix,
(SANE_String) v);
(void *) v);
strcpy ((SANE_String) v, pss->dither_matrix);
break;
case OPT_NEGATIVE:

Wyświetl plik

@ -144,7 +144,6 @@ static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg)
as_str = "Logical unit is in process of becoming ready.";
DBG (DL_MINOR_INFO, "%s: %s (%d seconds)\n", me, as_str, result[18]);
status = SANE_STATUS_DEVICE_BUSY;
DBG (DL_MINOR_INFO, "%s: %s\n", me, sense_str);
}
break;
case 0x04:
@ -160,8 +159,10 @@ static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg)
sense_str = "Illegal request.";
DBG (DL_MINOR_INFO, "%s: %s\n", me, sense_str);
if (asc == 0x25 && ascq == 0x00)
{
as_str = "Logical unit not supported.";
DBG (DL_MINOR_INFO, "%s: %s\n", me, as_str);
}
status = SANE_STATUS_IO_ERROR;
break;
case 0x09:

Wyświetl plik

@ -209,9 +209,12 @@ static scsiblk inquiryB =
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x0f, 0)
#define IN_recognized 0x02
#define get_IN_additional_length(in) in[0x04]
#define get_IN_vendor(in, buf) strncpy(buf, in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, in + 0x20, 0x04)
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, in + 0x08)
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, in + 0x10)
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, in + 0x20)
#define get_IN_color_mode(in) getbitfield(in + 0x24, 0xf, 0)
#define get_IN_color_seq(in) getbitfield(in + 0x24, 0x7, 4)
#define get_IN_adf(in) getbitfield(in + 0x24, 0x1, 7)

Wyświetl plik

@ -273,7 +273,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
char dev_name[PATH_MAX];
size_t len;
FILE *fp;
authorize = authorize; /* silence compilation warnings */
(void) authorize; /* silence compilation warnings */
DBG_INIT ();
DBG (10, "sane_init\n");
@ -310,7 +310,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
struct sp15c *dev;
int i;
local_only = local_only; /* silence compilation warnings */
(void) local_only; /* silence compilation warnings */
DBG (10, "sane_get_devices\n");
@ -335,7 +335,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle)
{
struct sp15c *dev = first_dev;
name = name; /* silence compilation warnings */
(void) name; /* silence compilation warnings */
/* Strange, name is not used? */
DBG (10, "sane_open\n");
@ -388,8 +388,8 @@ sane_open (SANE_String_Const name, SANE_Handle * handle)
SANE_Status
sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking)
{
h = h;
non_blocking = non_blocking; /* silence compilation warnings */
(void) h;
(void) non_blocking; /* silence compilation warnings */
DBG (10, "sane_set_io_mode\n");
return SANE_STATUS_UNSUPPORTED;
@ -399,8 +399,8 @@ sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle h, SANE_Int * fdp)
{
h = h;
fdp = fdp; /* silence compilation warnings */
(void) h;
(void) fdp; /* silence compilation warnings */
DBG (10, "sane_get_select_fd\n");
return SANE_STATUS_UNSUPPORTED;
@ -1080,8 +1080,8 @@ attach_one (const char *name)
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
scsi_fd = scsi_fd;
arg = arg; /* silence compilation warnings */
(void) scsi_fd;
(void) arg; /* silence compilation warnings */
return request_sense_parse (result);
} /* sense_handler */
@ -1783,7 +1783,7 @@ do_cancel (struct sp15c *scanner)
static void
swap_res (struct sp15c *s)
{
s = s; /* silence compilation warnings */
(void) s; /* silence compilation warnings */
/* for the time being, do nothing */
} /* swap_res */
@ -1815,7 +1815,7 @@ sp15c_set_window_param (struct sp15c *s, int prescan)
int ret;
int active_buffer_size;
prescan = prescan; /* silence compilation warnings */
(void) prescan; /* silence compilation warnings */
wait_scanner (s);
DBG (10, "set_window_param\n");
@ -1950,7 +1950,7 @@ sp15c_start_scan (struct sp15c *s)
static void
sigterm_handler (int signal)
{
signal = signal; /* silence compilation warnings */
(void) signal; /* silence compilation warnings */
sanei_scsi_req_flush_all (); /* flush SCSI queue */
_exit (SANE_STATUS_GOOD);

Wyświetl plik

@ -439,8 +439,8 @@ st400_sense_handler( int fd, SANE_Byte *result, void *arg )
/* ST400_Device *dev = arg; */
SANE_Status status;
fd = fd;
arg = arg; /* silence compilation warnings */
(void) fd;
(void) arg; /* silence compilation warnings */
switch( result[0] & 0x0f ) {
case 0x0:
@ -563,7 +563,7 @@ st400_config_get_arg(char **optP, unsigned long *argP, size_t linenum)
{
int n;
linenum = linenum; /* silence compilation warnings */
(void) linenum; /* silence compilation warnings */
if( sscanf(*optP, "%lu%n", argP, &n) == 1 ) {
*optP += n;
@ -1221,7 +1221,7 @@ sane_read( SANE_Handle handle, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenP )
size_t r, i;
SANE_Byte val;
DBG(DCODE, "sane_read(%p, %p, %d, %p)\n", handle, buf, (int)maxlen, (void *) lenP);
DBG(DCODE, "sane_read(%p, %p, %d, %p)\n", handle, (void *) buf, (int) maxlen, (void *) lenP);
*lenP = 0;
if( !dev->status.scanning )

Some files were not shown because too many files have changed in this diff Show More