send_data_async_complete_cb() is used as a callback for
libusb_fill_bulk_transfer() and it is expected to be of type
'libusb_transfer_cb_fn' which is defined using LIBUSB_CALL.
LIBUSB_CALL is only used on Windows and not having it results in the
following warning when compiling for Windows:
.../libam7xxx/src/am7xxx.c: In function ‘send_data_async’:
.../libam7xxx/src/am7xxx.c:508:7: warning: passing argument 6 of ‘libusb_fill_bulk_transfer’ from incompatible pointer type [-Wincompatible-pointer-types]
send_data_async_complete_cb, dev, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ao2/Proj/picoProjector/libam7xxx/src/am7xxx.c:24:0:
.../libam7xxx/build/libusb-1.0.21/include/libusb-1.0/libusb.h:1553:20: note: expected ‘libusb_transfer_cb_fn’ but argument is of type ‘void (*)(struct libusb_transfer *)’
static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
^~~~~~~~~~~~~~~~~~~~~~~~~
-static void send_data_async_complete_cb(struct libusb_transfer *transfer)
+static void LIBUSB_CALL send_data_async_complete_cb(struct libusb_transfer *transfer)
{
am7xxx_device *dev = (am7xxx_device *)(transfer->user_data);
int *completed = &(dev->transfer_completed);
{
am7xxx_device *dev = (am7xxx_device *)(transfer->user_data);
int *completed = &(dev->transfer_completed);