]> sigrok.org Git - libsigrok.git/commitdiff
lecroy-logicstudio: Fix some compiler warnings on MinGW.
authorUwe Hermann <redacted>
Thu, 7 Jan 2016 22:22:42 +0000 (23:22 +0100)
committerUwe Hermann <redacted>
Thu, 7 Jan 2016 22:50:17 +0000 (23:50 +0100)
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(
                    ^

src/hardware/lecroy-logicstudio/protocol.c

index ef390ebce157ba66400bc078512b60415e71b955..9c825991b69427e6494457608dc3e8494db05cd2 100644 (file)
@@ -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;