From: Uwe Hermann Date: Thu, 7 Jan 2016 22:22:42 +0000 (+0100) Subject: lecroy-logicstudio: Fix some compiler warnings on MinGW. X-Git-Tag: libsigrok-0.4.0~30 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ff7c7cda93a8457777eda9466c561d62313a9d49;p=libsigrok.git lecroy-logicstudio: Fix some compiler warnings on MinGW. src/hardware/lecroy-logicstudio/protocol.c: In function 'handle_fetch_samples_done': src/hardware/lecroy-logicstudio/protocol.c:261:3: warning: passing argument 6 of 'libusb_fill_bulk_transfer' from incompatible pointer type recv_bulk_transfer, (void *)sdi, USB_TIMEOUT_MS); ^ In file included from ./src/libsigrok-internal.h:31:0, from src/hardware/lecroy-logicstudio/protocol.h:26, from src/hardware/lecroy-logicstudio/protocol.c:23: /home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1546: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/hardware/lecroy-logicstudio/protocol.c: In function 'fetch_samples_async': src/hardware/lecroy-logicstudio/protocol.c:314:4: warning: passing argument 6 of 'write_registers_async' from incompatible pointer type handle_fetch_samples_done); ^ src/hardware/lecroy-logicstudio/protocol.c:200:12: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)' static int write_registers_async(const struct sr_dev_inst *sdi, ^ src/hardware/lecroy-logicstudio/protocol.c: In function 'lls_start_acquisition': src/hardware/lecroy-logicstudio/protocol.c:1122:3: warning: passing argument 6 of 'libusb_fill_interrupt_transfer' from incompatible pointer type recv_intr_transfer, (void *) sdi, USB_TIMEOUT_MS); ^ In file included from ./src/libsigrok-internal.h:31:0, from src/hardware/lecroy-logicstudio/protocol.h:26, from src/hardware/lecroy-logicstudio/protocol.c:23: /home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1602:20: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)' static inline void libusb_fill_interrupt_transfer( ^ --- diff --git a/src/hardware/lecroy-logicstudio/protocol.c b/src/hardware/lecroy-logicstudio/protocol.c index ef390ebc..9c825991 100644 --- a/src/hardware/lecroy-logicstudio/protocol.c +++ b/src/hardware/lecroy-logicstudio/protocol.c @@ -114,8 +114,8 @@ struct regval { uint16_t val; }; -static void handle_fetch_samples_done(struct libusb_transfer *xfer); -static void recv_bulk_transfer(struct libusb_transfer *xfer); +static void LIBUSB_CALL handle_fetch_samples_done(struct libusb_transfer *xfer); +static void LIBUSB_CALL recv_bulk_transfer(struct libusb_transfer *xfer); static const struct samplerate_info samplerates[] = { { SR_GHZ(1), -24, 0x1f }, @@ -241,7 +241,7 @@ static void prep_regw(struct regval *regval, uint8_t reg, uint16_t val) regval->val = val; } -static void handle_fetch_samples_done(struct libusb_transfer *xfer) +static void LIBUSB_CALL handle_fetch_samples_done(struct libusb_transfer *xfer) { const struct sr_dev_inst *sdi; struct sr_usb_dev_inst *usb; @@ -907,7 +907,7 @@ SR_PRIV int lls_setup_acquisition(const struct sr_dev_inst *sdi) return SR_OK; } -static void recv_intr_transfer(struct libusb_transfer *xfer) +static void LIBUSB_CALL recv_intr_transfer(struct libusb_transfer *xfer) { const struct sr_dev_inst *sdi; struct drv_context *drvc; @@ -1000,7 +1000,7 @@ static uint16_t sample_to_byte_offset(struct dev_context *devc, uint64_t o) return o * devc->num_enabled_channel_groups; } -static void recv_bulk_transfer(struct libusb_transfer *xfer) +static void LIBUSB_CALL recv_bulk_transfer(struct libusb_transfer *xfer) { const struct sr_dev_inst *sdi; struct dev_context *devc;