From: Antonio Ospite Date: Mon, 26 Feb 2018 15:05:20 +0000 (+0100) Subject: am7xxx: specify LIBUSB_CALL for send_data_async_complete_cb() X-Git-Tag: v0.1.7~20 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/151dac365e5b086e4aae52585130fe26fc6b4cc5?ds=inline am7xxx: specify LIBUSB_CALL for send_data_async_complete_cb() 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, ^~~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/src/am7xxx.c b/src/am7xxx.c index 84d7e9c..1e05601 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -414,7 +414,7 @@ static int send_data(am7xxx_device *dev, uint8_t *buffer, unsigned int len) return 0; } -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);