From 151dac365e5b086e4aae52585130fe26fc6b4cc5 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 26 Feb 2018 16:05:20 +0100 Subject: [PATCH] am7xxx: specify LIBUSB_CALL for send_data_async_complete_cb() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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, ^~~~~~~~~~~~~~~~~~~~~~~~~ --- src/am7xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.1.4