[sane-devel] avision backend support of HP 8250

Henning Meier-Geinitz henning at meier-geinitz.de
Wed Oct 5 17:27:52 UTC 2005


Hi,

On Mon, Oct 03, 2005 at 03:58:16PM +0300, Anastas Giokov wrote:
> [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
> [sanei_usb] 0000: 00                                             
> ................
> [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes

Maybe the problem is already at this point?

> --- sanei_usb.c.bak     2005-07-16 00:00:57.000000000 +0300
> +++ sanei_usb.c 2005-10-03 15:38:26.000000000 +0300
> @@ -972,7 +972,7 @@
>        if (devices[dn].bulk_in_ep)
>         read_size = usb_bulk_read (devices[dn].libusb_handle,
>                                    devices[dn].bulk_in_ep, (char *) buffer,
> -                                  (int) *size, libusb_timeout);
> +                                  (unsigned long) *size, libusb_timeout);
>        else
>         {
>           DBG (1, "sanei_usb_read_bulk: can't read without a bulk-in "
> 
> size is always type-cast as unsigned long except for this place, so
> I'll give it a try.

usb_bulk_read expects an int, not a long int  according to the libusb spec.

"(unsigned long) size" is used in printf statements because you don't
know if size_t has the size of an int or of a ling int, it depends on
the platform.

Bye,
  Henning




More information about the sane-devel mailing list