kopia lustrzana https://gitlab.com/sane-project/backends
Fix format warnings
rodzic
65ef626e1a
commit
af663bc5e7
|
@ -4,6 +4,11 @@
|
|||
Fix warnings about ignored --datarootdir
|
||||
* backend/hp5590_low.c: Fix incompatible pointer type warning
|
||||
* backend/genesys_gl646.c: Fix incompatible pointer type warning
|
||||
* backend/dc25.c, backend/epson2.c, backend/epson2-commands.c,
|
||||
backend/epson2-io.c, backend/epson2_net.c, backend/genesys.c,
|
||||
backend/genesys_gl841.c, backend/hp3900_usb.c, backend/lexmark_low.c,
|
||||
backend/plustek-usbhw.c, backend/sm3840.c: Fix format warnings
|
||||
* backend/pixma.c: Add missing #include
|
||||
|
||||
2008-02-02 Mattias Ellert <mattias.ellert@tsl.uu.se>
|
||||
|
||||
|
|
|
@ -1907,7 +1907,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback UNUSEDARG authorize)
|
|||
tty_baud = DEFAULT_TTY_BAUD;
|
||||
break;
|
||||
}
|
||||
DBG (20, "Config file baud=%d\n", tty_baud);
|
||||
DBG (20, "Config file baud=%lu\n", (u_long) tty_baud);
|
||||
}
|
||||
else if (strcmp (dev_name, "dumpinquiry") == 0)
|
||||
{
|
||||
|
|
|
@ -335,17 +335,17 @@ esci_request_extended_identity(SANE_Handle handle, unsigned char *buf)
|
|||
return status;
|
||||
|
||||
DBG(1, " command level : %c%c\n", buf[0], buf[1]);
|
||||
DBG(1, " basic resolution: %d\n", le32atoh(&buf[4]));
|
||||
DBG(1, " min resolution : %d\n", le32atoh(&buf[8]));
|
||||
DBG(1, " max resolution : %d\n", le32atoh(&buf[12]));
|
||||
DBG(1, " max pixel num : %d\n", le32atoh(&buf[16]));
|
||||
DBG(1, " scan area : %dx%d\n",
|
||||
DBG(1, " basic resolution: %lu\n", le32atoh(&buf[4]));
|
||||
DBG(1, " min resolution : %lu\n", le32atoh(&buf[8]));
|
||||
DBG(1, " max resolution : %lu\n", le32atoh(&buf[12]));
|
||||
DBG(1, " max pixel num : %lu\n", le32atoh(&buf[16]));
|
||||
DBG(1, " scan area : %lux%lu\n",
|
||||
le32atoh(&buf[20]), le32atoh(&buf[24]));
|
||||
|
||||
DBG(1, " adf area : %dx%d\n",
|
||||
DBG(1, " adf area : %lux%lu\n",
|
||||
le32atoh(&buf[28]), le32atoh(&buf[32]));
|
||||
|
||||
DBG(1, " tpu area : %dx%d\n",
|
||||
DBG(1, " tpu area : %lux%lu\n",
|
||||
le32atoh(&buf[36]), le32atoh(&buf[40]));
|
||||
|
||||
DBG(1, " main status : 0x%02x\n", buf[44]);
|
||||
|
@ -507,12 +507,12 @@ esci_set_scanning_parameter(SANE_Handle handle, unsigned char *buf)
|
|||
params[0] = FS;
|
||||
params[1] = 'W';
|
||||
|
||||
DBG(10, "resolution of main scan : %d\n", le32atoh(&buf[0]));
|
||||
DBG(10, "resolution of sub scan : %d\n", le32atoh(&buf[4]));
|
||||
DBG(10, "offset length of main scan : %d\n", le32atoh(&buf[8]));
|
||||
DBG(10, "offset length of sub scan : %d\n", le32atoh(&buf[12]));
|
||||
DBG(10, "scanning length of main scan: %d\n", le32atoh(&buf[16]));
|
||||
DBG(10, "scanning length of sub scan : %d\n", le32atoh(&buf[20]));
|
||||
DBG(10, "resolution of main scan : %lu\n", le32atoh(&buf[0]));
|
||||
DBG(10, "resolution of sub scan : %lu\n", le32atoh(&buf[4]));
|
||||
DBG(10, "offset length of main scan : %lu\n", le32atoh(&buf[8]));
|
||||
DBG(10, "offset length of sub scan : %lu\n", le32atoh(&buf[12]));
|
||||
DBG(10, "scanning length of main scan: %lu\n", le32atoh(&buf[16]));
|
||||
DBG(10, "scanning length of sub scan : %lu\n", le32atoh(&buf[20]));
|
||||
DBG(10, "scanning color : %d\n", buf[24]);
|
||||
DBG(10, "data format : %d\n", buf[25]);
|
||||
DBG(10, "option control : %d\n", buf[26]);
|
||||
|
@ -803,7 +803,8 @@ esci_request_extended_status(SANE_Handle handle, unsigned char **data,
|
|||
case 42:
|
||||
break;
|
||||
default:
|
||||
DBG(1, "%s: unknown reply length (%d)\n", __func__, buf_len);
|
||||
DBG(1, "%s: unknown reply length (%lu)\n", __func__,
|
||||
(u_long) buf_len);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ e2_cmd_simple(Epson_Scanner * s, void *buf, size_t buf_size)
|
|||
unsigned char result;
|
||||
SANE_Status status;
|
||||
|
||||
DBG(12, "%s: size = %d\n", __func__, buf_size);
|
||||
DBG(12, "%s: size = %lu\n", __func__, (u_long) buf_size);
|
||||
|
||||
status = e2_txrx(s, buf, buf_size, &result, 1);
|
||||
if (status != SANE_STATUS_GOOD) {
|
||||
|
@ -261,7 +261,8 @@ e2_recv_info_block(Epson_Scanner * s, unsigned char *scanner_status,
|
|||
if (info_size == 6)
|
||||
*payload_size *= le16atoh(&info[4]);
|
||||
|
||||
DBG(14, "%s: payload length: %d\n", __func__, *payload_size);
|
||||
DBG(14, "%s: payload length: %lu\n", __func__,
|
||||
(u_long) *payload_size);
|
||||
}
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
|
@ -283,8 +284,8 @@ e2_cmd_info_block(SANE_Handle handle, unsigned char *params,
|
|||
Epson_Scanner *s = (Epson_Scanner *) handle;
|
||||
size_t len;
|
||||
|
||||
DBG(13, "%s, params len = %d, reply len = %d, buf = %p\n",
|
||||
__func__, params_len, reply_len, (void *) buf);
|
||||
DBG(13, "%s, params len = %d, reply len = %lu, buf = %p\n",
|
||||
__func__, params_len, (u_long) reply_len, (void *) buf);
|
||||
|
||||
if (buf == NULL)
|
||||
return SANE_STATUS_INVAL;
|
||||
|
@ -315,8 +316,8 @@ e2_cmd_info_block(SANE_Handle handle, unsigned char *params,
|
|||
* length differs, throw a warning
|
||||
*/
|
||||
if (reply_len && (len != reply_len)) {
|
||||
DBG(1, "%s: mismatched len - expected %d, got %d\n",
|
||||
__func__, reply_len, len);
|
||||
DBG(1, "%s: mismatched len - expected %lu, got %lu\n",
|
||||
__func__, (u_long) reply_len, (u_long) len);
|
||||
}
|
||||
|
||||
/* allocate and receive the payload */
|
||||
|
|
|
@ -3817,9 +3817,9 @@ e2_start_ext_scan(Epson_Scanner * s)
|
|||
s->ext_counter = 0;
|
||||
|
||||
DBG(5, " status : 0x%02x\n", buf[1]);
|
||||
DBG(5, " block size : %d\n", le32atoh(&buf[2]));
|
||||
DBG(5, " block count : %d\n", le32atoh(&buf[6]));
|
||||
DBG(5, " last block size: %d\n", le32atoh(&buf[10]));
|
||||
DBG(5, " block size : %lu\n", le32atoh(&buf[2]));
|
||||
DBG(5, " block count : %lu\n", le32atoh(&buf[6]));
|
||||
DBG(5, " last block size: %lu\n", le32atoh(&buf[10]));
|
||||
|
||||
if (s->ext_last_len) {
|
||||
s->ext_blocks++;
|
||||
|
@ -4190,13 +4190,13 @@ e2_ext_sane_read(SANE_Handle handle)
|
|||
if (s->ext_counter == s->ext_blocks && s->ext_last_len)
|
||||
buf_len = s->ext_last_len;
|
||||
|
||||
DBG(18, "%s: block %d, size %d\n", __func__, s->ext_counter,
|
||||
buf_len);
|
||||
DBG(18, "%s: block %d, size %lu\n", __func__, s->ext_counter,
|
||||
(u_long) buf_len);
|
||||
|
||||
/* receive image data + error code */
|
||||
read = e2_recv(s, s->buf, buf_len + 1, &status);
|
||||
|
||||
DBG(18, "%s: read %d bytes\n", __func__, read);
|
||||
DBG(18, "%s: read %lu bytes\n", __func__, (u_long) read);
|
||||
|
||||
if (read != buf_len + 1)
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
|
|
|
@ -77,8 +77,8 @@ sanei_epson_net_read(Epson_Scanner *s, unsigned char *buf, size_t wanted,
|
|||
|
||||
/* read from buffer, if available */
|
||||
if (s->netptr != s->netbuf) {
|
||||
DBG(4, "reading %d from buffer at %p, %d available\n",
|
||||
wanted, s->netptr, s->netlen);
|
||||
DBG(4, "reading %lu from buffer at %p, %lu available\n",
|
||||
(u_long) wanted, s->netptr, (u_long) s->netlen);
|
||||
|
||||
memcpy(buf, s->netptr, wanted);
|
||||
read = wanted;
|
||||
|
@ -105,7 +105,8 @@ sanei_epson_net_read(Epson_Scanner *s, unsigned char *buf, size_t wanted,
|
|||
}
|
||||
size = be32atoh(&header[6]);
|
||||
|
||||
DBG(4, "%s: wanted = %d, available = %d\n", __FUNCTION__, wanted, size);
|
||||
DBG(4, "%s: wanted = %lu, available = %lu\n", __FUNCTION__,
|
||||
(u_long) wanted, (u_long) size);
|
||||
|
||||
*status = SANE_STATUS_GOOD;
|
||||
|
||||
|
@ -128,8 +129,8 @@ sanei_epson_net_read(Epson_Scanner *s, unsigned char *buf, size_t wanted,
|
|||
read = wanted;
|
||||
|
||||
DBG(4, "0,4 %02x %02x\n", s->netbuf[0], s->netbuf[4]);
|
||||
DBG(4, "storing %d to buffer at %p, next read at %p, %d bytes left\n",
|
||||
size, s->netbuf, s->netptr, s->netlen);
|
||||
DBG(4, "storing %lu to buffer at %p, next read at %p, %lu bytes left\n",
|
||||
(u_long) size, s->netbuf, s->netptr, (u_long) s->netlen);
|
||||
|
||||
memcpy(buf, s->netbuf, wanted);
|
||||
}
|
||||
|
@ -154,10 +155,12 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
|
|||
if (reply_len) {
|
||||
s->netbuf = s->netptr = malloc(reply_len);
|
||||
s->netlen = reply_len;
|
||||
DBG(8, "allocated %d bytes at %p\n", reply_len, s->netbuf);
|
||||
DBG(8, "allocated %lu bytes at %p\n",
|
||||
(u_long) reply_len, s->netbuf);
|
||||
}
|
||||
|
||||
DBG(2, "%s: cmd = %04x, buf = %p, buf_size = %d, reply_len = %d\n", __FUNCTION__, cmd, buf, buf_size, reply_len);
|
||||
DBG(2, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
|
||||
__FUNCTION__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
|
||||
|
||||
memset(h1, 0x00, 12);
|
||||
memset(h2, 0x00, 8);
|
||||
|
@ -179,9 +182,9 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
|
|||
htobe32a(&h2[0], buf_size);
|
||||
htobe32a(&h2[4], reply_len);
|
||||
|
||||
DBG(9, "H1[6]: %02x %02x %02x %02x (%d)\n", h1[6], h1[7], h1[8], h1[9], buf_size + 8);
|
||||
DBG(9, "H2[0]: %02x %02x %02x %02x (%d)\n", h2[0], h2[1], h2[2], h2[3], buf_size);
|
||||
DBG(9, "H2[4]: %02x %02x %02x %02x (%d)\n", h2[4], h2[5], h2[6], h2[7], reply_len);
|
||||
DBG(9, "H1[6]: %02x %02x %02x %02x (%lu)\n", h1[6], h1[7], h1[8], h1[9], (u_long) (buf_size + 8));
|
||||
DBG(9, "H2[0]: %02x %02x %02x %02x (%lu)\n", h2[0], h2[1], h2[2], h2[3], (u_long) buf_size);
|
||||
DBG(9, "H2[4]: %02x %02x %02x %02x (%lu)\n", h2[4], h2[5], h2[6], h2[7], (u_long) reply_len);
|
||||
}
|
||||
|
||||
if ((cmd >> 8) == 0x20 && (buf_size || reply_len)) {
|
||||
|
|
|
@ -4045,10 +4045,10 @@ genesys_read_ordered_data (Genesys_Device * dev, SANE_Byte * destination,
|
|||
}
|
||||
#endif
|
||||
|
||||
DBG (DBG_info, "genesys_read_ordered_data: %d lines left by output\n",
|
||||
DBG (DBG_info, "genesys_read_ordered_data: %lu lines left by output\n",
|
||||
((dev->total_bytes_to_read - dev->total_bytes_read) * 8) /
|
||||
(dev->settings.pixels * channels * depth));
|
||||
DBG (DBG_info, "genesys_read_ordered_data: %d lines left by input\n",
|
||||
DBG (DBG_info, "genesys_read_ordered_data: %lu lines left by input\n",
|
||||
((dev->read_bytes_left + dev->read_buffer.avail) * 8) /
|
||||
(src_pixels * channels * depth));
|
||||
|
||||
|
|
|
@ -420,7 +420,8 @@ gl841_bulk_write_register (Genesys_Device * dev,
|
|||
}
|
||||
|
||||
|
||||
DBG (DBG_io, "gl841_bulk_write_register: wrote %d registers\n", elems);
|
||||
DBG (DBG_io, "gl841_bulk_write_register: wrote %lu registers\n",
|
||||
(u_long) elems);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -640,7 +641,8 @@ gl841_bulk_write_data_gamma (Genesys_Device * dev, u_int8_t addr,
|
|||
size_t size;
|
||||
u_int8_t outdata[8];
|
||||
|
||||
DBG (DBG_io, "gl841_bulk_write_data_gamma writing %d bytes\n", len);
|
||||
DBG (DBG_io, "gl841_bulk_write_data_gamma writing %lu bytes\n",
|
||||
(u_long) len);
|
||||
|
||||
status =
|
||||
sanei_usb_control_msg (dev->dn, REQUEST_TYPE_OUT, REQUEST_REGISTER,
|
||||
|
@ -690,8 +692,9 @@ gl841_bulk_write_data_gamma (Genesys_Device * dev, u_int8_t addr,
|
|||
return status;
|
||||
}
|
||||
|
||||
DBG (DBG_io2, "genesys_bulk_write_data:gamma wrote %d bytes, %d remaining\n",
|
||||
size, (len - size));
|
||||
DBG (DBG_io2,
|
||||
"genesys_bulk_write_data:gamma wrote %lu bytes, %lu remaining\n",
|
||||
(u_long) size, (u_long) (len - size));
|
||||
|
||||
len -= size;
|
||||
data += size;
|
||||
|
@ -2981,8 +2984,8 @@ dummy \ scanned lines
|
|||
dev->read_bytes_left = bytes_per_line * lincnt;
|
||||
|
||||
DBG (DBG_info,
|
||||
"gl841_init_scan_regs: physical bytes to read = %d\n",
|
||||
dev->read_bytes_left);
|
||||
"gl841_init_scan_regs: physical bytes to read = %lu\n",
|
||||
(u_long) dev->read_bytes_left);
|
||||
dev->read_active = SANE_TRUE;
|
||||
|
||||
|
||||
|
|
|
@ -331,8 +331,8 @@ Read_Bulk (USB_Handle usb_handle, SANE_Byte * buffer, size_t size)
|
|||
if (buffer != NULL)
|
||||
{
|
||||
dataline_count++;
|
||||
DBG (DBG_CTL, "%06i BLK DI: Buffer length = %u. bytes\n",
|
||||
dataline_count, size);
|
||||
DBG (DBG_CTL, "%06i BLK DI: Buffer length = %lu bytes\n",
|
||||
dataline_count, (u_long) size);
|
||||
|
||||
#ifdef STANDALONE
|
||||
if (usb_handle != NULL)
|
||||
|
|
|
@ -826,8 +826,8 @@ low_usb_bulk_write (SANE_Int devnum, SANE_Byte * cmd, size_t * size)
|
|||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (5,
|
||||
"low_usb_bulk_write: returned %s (size = %ld, expected %d)\n",
|
||||
sane_strstatus (status), (long int) *size, cmd_size);
|
||||
"low_usb_bulk_write: returned %s (size = %lu, expected %lu)\n",
|
||||
sane_strstatus (status), (u_long) *size, (u_long) cmd_size);
|
||||
/* F.O. should reset the pipe here... */
|
||||
}
|
||||
return status;
|
||||
|
@ -848,12 +848,12 @@ low_usb_bulk_read (SANE_Int devnum, SANE_Byte * buf, size_t * size)
|
|||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (5,
|
||||
"low_usb_bulk_read: returned %s (size = %ld, expected %d)\n",
|
||||
sane_strstatus (status), (long int) *size, exp_size);
|
||||
"low_usb_bulk_read: returned %s (size = %lu, expected %lu)\n",
|
||||
sane_strstatus (status), (u_long) *size, (u_long) exp_size);
|
||||
/* F.O. should reset the pipe here... */
|
||||
}
|
||||
DBG (7, "low_usb_bulk_read: returned size = %ld (required %d)\n",
|
||||
(long int) *size, exp_size);
|
||||
DBG (7, "low_usb_bulk_read: returned size = %lu (required %lu)\n",
|
||||
(u_long) *size, (u_long) exp_size);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -1059,8 +1059,8 @@ low_simple_scan (Lexmark_Device * dev, SANE_Byte * regs, int xoffset,
|
|||
|
||||
/* data reading loop */
|
||||
needed = bpl * lines;
|
||||
DBG (1, "low_simple_scan: bpl=%d, lines=%d, needed=%d.\n", bpl, lines,
|
||||
needed);
|
||||
DBG (1, "low_simple_scan: bpl=%d, lines=%d, needed=%lu.\n", bpl, lines,
|
||||
(u_long) needed);
|
||||
read = 0;
|
||||
do
|
||||
{
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef USE_PTHREAD
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
#include <signal.h> /* sigaction(POSIX) */
|
||||
#include <unistd.h> /* POSIX: write read close pipe */
|
||||
#ifdef HAVE_FCNTL_H
|
||||
|
|
|
@ -1380,7 +1380,7 @@ usb_ResetRegisters( Plustek_Device *dev )
|
|||
u_char *regs = dev->usbDev.a_bRegs;
|
||||
|
||||
DBG( _DBG_INFO, "RESETTING REGISTERS(%i) - 0x%02x\n",
|
||||
dev->initialized,sizeof(dev->usbDev.a_bRegs));
|
||||
dev->initialized, (int) sizeof(dev->usbDev.a_bRegs));
|
||||
memset( regs, 0, sizeof(dev->usbDev.a_bRegs));
|
||||
|
||||
memcpy( regs+0x0b, &hw->bSensorConfiguration, 4 );
|
||||
|
|
|
@ -148,8 +148,8 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
|
|||
DBG (2, "+sane-read:%p %p %d %p\n", (unsigned char *) s, buf, max_len,
|
||||
(unsigned char *) len);
|
||||
DBG (2,
|
||||
"+sane-read:remain:%d offset:%d linesleft:%d linebuff:%p linesread:%d\n",
|
||||
s->remaining, s->offset, s->linesleft, s->line_buffer, s->linesread);
|
||||
"+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);
|
||||
|
||||
if (!s->scanning)
|
||||
return SANE_STATUS_INVAL;
|
||||
|
|
Ładowanie…
Reference in New Issue