Fixed compilation warning related to an argument type in Read_Bulk function

merge-requests/1/head
Jonathan Bravo Lopez 2008-01-16 10:38:42 +00:00
rodzic e7e161c6ee
commit 04c145d8d1
2 zmienionych plików z 20 dodań i 10 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
2008-01-16 Jonathan Bravo Lopez <jkdsoft@gmail.com>
* backend/hp3900_usb.c: fixed compilation warning related
to an argument type in Read_Bulk function.
2008-01-14 m. allan noah <kitno455 a t gmail d o t com> 2008-01-14 m. allan noah <kitno455 a t gmail d o t com>
* tools/check-po.awk: support different use of 'fuzzy' * tools/check-po.awk: support different use of 'fuzzy'
* po/sane-backends.fr.po: updated translation * po/sane-backends.fr.po: updated translation

Wyświetl plik

@ -40,6 +40,10 @@
If you do not wish that, delete this exception notice. If you do not wish that, delete this exception notice.
*/ */
#ifndef USBLAYER
#define USBLAYER
#define TIMEOUT 1000 #define TIMEOUT 1000
#define BLK_READ_EP 0x81 #define BLK_READ_EP 0x81
#define BLK_WRITE_EP 0x02 #define BLK_WRITE_EP 0x02
@ -298,16 +302,16 @@ Write_Bulk (USB_Handle usb_handle, SANE_Byte * buffer, SANE_Int size)
#ifdef STANDALONE #ifdef STANDALONE
if (usb_handle != NULL) if (usb_handle != NULL)
if (usb_bulk_write (usb_handle, if (usb_bulk_write
BLK_WRITE_EP, (usb_handle, BLK_WRITE_EP, (char *) buffer, size,
(char *) buffer, size, TIMEOUT) == size) TIMEOUT) == size)
rst = OK; rst = OK;
#else #else
if (usb_handle != -1) if (usb_handle != -1)
{ {
size_t mysize = size; size_t mysize = size;
if (sanei_usb_write_bulk (usb_handle, if (sanei_usb_write_bulk (usb_handle, buffer, &mysize) ==
buffer, &mysize) == SANE_STATUS_GOOD) SANE_STATUS_GOOD)
rst = OK; rst = OK;
} }
#endif #endif
@ -327,17 +331,18 @@ Read_Bulk (USB_Handle usb_handle, SANE_Byte * buffer, size_t size)
if (buffer != NULL) if (buffer != NULL)
{ {
dataline_count++; dataline_count++;
DBG (DBG_CTL, "%06i BLK DI: Buffer length = %i. bytes\n", DBG (DBG_CTL, "%06i BLK DI: Buffer length = %u. bytes\n",
dataline_count, size); dataline_count, size);
#ifdef STANDALONE #ifdef STANDALONE
if (usb_handle != NULL) if (usb_handle != NULL)
rst = usb_bulk_read (usb_handle, rst =
BLK_READ_EP, (char *) buffer, size, TIMEOUT); usb_bulk_read (usb_handle, BLK_READ_EP, (char *) buffer, size,
TIMEOUT);
#else #else
if (usb_handle != -1) if (usb_handle != -1)
if (sanei_usb_read_bulk (usb_handle, if (sanei_usb_read_bulk (usb_handle, buffer, &size) ==
buffer, &size) == SANE_STATUS_GOOD) SANE_STATUS_GOOD)
rst = size; rst = size;
#endif #endif
} }
@ -501,3 +506,4 @@ show_buffer (SANE_Int level, SANE_Byte * buffer, SANE_Int size)
} }
return OK; return OK;
} }
#endif /*USBLAYER*/