From 55462b8ba9f48931de9b9a7bfbc182a1d113b3b5 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 12 Apr 2015 19:28:03 +0200 Subject: [PATCH] windows: Fix various compiler warnings. Add LIBUSB_CALL where needed to avoid warnings such as the following: In file included from src/hardware/hantek-dso/api.c:34:0: src/hardware/hantek-dso/dso.h:212:13: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)' SR_PRIV int dso_get_channeldata(const struct sr_dev_inst *sdi, ^ --- src/hardware/fx2lafw/api.c | 2 +- src/hardware/fx2lafw/protocol.c | 2 +- src/hardware/fx2lafw/protocol.h | 2 +- src/hardware/hantek-dso/api.c | 2 +- src/hardware/ikalogic-scanalogic2/protocol.c | 4 ++-- src/hardware/ikalogic-scanalogic2/protocol.h | 4 ++-- src/hardware/kecheng-kc-330b/protocol.c | 2 +- src/hardware/kecheng-kc-330b/protocol.h | 2 +- src/hardware/lascar-el-usb/api.c | 2 +- src/hardware/lascar-el-usb/protocol.c | 4 ++-- src/hardware/lascar-el-usb/protocol.h | 2 +- src/hardware/saleae-logic16/protocol.c | 2 +- src/hardware/saleae-logic16/protocol.h | 2 +- src/hardware/sysclk-lwla/protocol.c | 4 ++-- src/hardware/testo/api.c | 2 +- src/hardware/testo/protocol.h | 2 +- src/hardware/uni-t-ut32x/protocol.c | 2 +- src/hardware/uni-t-ut32x/protocol.h | 2 +- src/hardware/victor-dmm/api.c | 2 +- 19 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 04284e50..ab3345f3 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -677,7 +677,7 @@ static int start_transfers(const struct sr_dev_inst *sdi) return SR_OK; } -static void dslogic_trigger_receive(struct libusb_transfer *transfer) +static void LIBUSB_CALL dslogic_trigger_receive(struct libusb_transfer *transfer) { const struct sr_dev_inst *sdi; struct dslogic_trigger_pos *tpos; diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index 6681b9ef..11e3504e 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -375,7 +375,7 @@ static void resubmit_transfer(struct libusb_transfer *transfer) } -SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL fx2lafw_receive_transfer(struct libusb_transfer *transfer) { struct sr_dev_inst *sdi; struct dev_context *devc; diff --git a/src/hardware/fx2lafw/protocol.h b/src/hardware/fx2lafw/protocol.h index 3be87182..c245a7a2 100644 --- a/src/hardware/fx2lafw/protocol.h +++ b/src/hardware/fx2lafw/protocol.h @@ -129,7 +129,7 @@ SR_PRIV gboolean match_manuf_prod(libusb_device *dev, const char *manufacturer, SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di); SR_PRIV struct dev_context *fx2lafw_dev_new(void); SR_PRIV void fx2lafw_abort_acquisition(struct dev_context *devc); -SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL fx2lafw_receive_transfer(struct libusb_transfer *transfer); SR_PRIV size_t fx2lafw_get_buffer_size(struct dev_context *devc); SR_PRIV unsigned int fx2lafw_get_number_of_transfers(struct dev_context *devc); SR_PRIV unsigned int fx2lafw_get_timeout(struct dev_context *devc); diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index f29d4a0e..47907d8e 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -769,7 +769,7 @@ static void send_chunk(struct sr_dev_inst *sdi, unsigned char *buf, * queued up beforehand, so this just needs to chuck the incoming data onto * the libsigrok session bus. */ -static void receive_transfer(struct libusb_transfer *transfer) +static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) { struct sr_datafeed_packet packet; struct sr_dev_inst *sdi; diff --git a/src/hardware/ikalogic-scanalogic2/protocol.c b/src/hardware/ikalogic-scanalogic2/protocol.c index f756b6e5..7a7a2cb1 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.c +++ b/src/hardware/ikalogic-scanalogic2/protocol.c @@ -258,7 +258,7 @@ SR_PRIV int ikalogic_scanalogic2_receive_data(int fd, int revents, void *cb_data return TRUE; } -SR_PRIV void sl2_receive_transfer_in( struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL sl2_receive_transfer_in( struct libusb_transfer *transfer) { struct sr_dev_inst *sdi; struct dev_context *devc; @@ -389,7 +389,7 @@ SR_PRIV void sl2_receive_transfer_in( struct libusb_transfer *transfer) } } -SR_PRIV void sl2_receive_transfer_out( struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL sl2_receive_transfer_out( struct libusb_transfer *transfer) { struct sr_dev_inst *sdi; struct dev_context *devc; diff --git a/src/hardware/ikalogic-scanalogic2/protocol.h b/src/hardware/ikalogic-scanalogic2/protocol.h index 45f5917a..cd794821 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.h +++ b/src/hardware/ikalogic-scanalogic2/protocol.h @@ -217,8 +217,8 @@ struct dev_context { }; SR_PRIV int ikalogic_scanalogic2_receive_data(int fd, int revents, void *cb_data); -SR_PRIV void sl2_receive_transfer_in(struct libusb_transfer *transfer); -SR_PRIV void sl2_receive_transfer_out(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL sl2_receive_transfer_in(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL sl2_receive_transfer_out(struct libusb_transfer *transfer); SR_PRIV int sl2_set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate); SR_PRIV int sl2_set_limit_samples(const struct sr_dev_inst *sdi, diff --git a/src/hardware/kecheng-kc-330b/protocol.c b/src/hardware/kecheng-kc-330b/protocol.c index f5638668..005b87cb 100644 --- a/src/hardware/kecheng-kc-330b/protocol.c +++ b/src/hardware/kecheng-kc-330b/protocol.c @@ -124,7 +124,7 @@ static void send_data(const struct sr_dev_inst *sdi, void *buf, unsigned int buf } -SR_PRIV void kecheng_kc_330b_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL kecheng_kc_330b_receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; diff --git a/src/hardware/kecheng-kc-330b/protocol.h b/src/hardware/kecheng-kc-330b/protocol.h index a2536898..ff3ce8b9 100644 --- a/src/hardware/kecheng-kc-330b/protocol.h +++ b/src/hardware/kecheng-kc-330b/protocol.h @@ -91,7 +91,7 @@ struct dev_context { }; SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data); -SR_PRIV void kecheng_kc_330b_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL kecheng_kc_330b_receive_transfer(struct libusb_transfer *transfer); SR_PRIV int kecheng_kc_330b_configure(const struct sr_dev_inst *sdi); SR_PRIV int kecheng_kc_330b_set_date_time(struct sr_dev_inst *sdi); SR_PRIV int kecheng_kc_330b_recording_get(const struct sr_dev_inst *sdi, diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c index 14273ce3..4d9ae81d 100644 --- a/src/hardware/lascar-el-usb/api.c +++ b/src/hardware/lascar-el-usb/api.c @@ -252,7 +252,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * return SR_OK; } -static void mark_xfer(struct libusb_transfer *xfer) +static void LIBUSB_CALL mark_xfer(struct libusb_transfer *xfer) { if (xfer->status == LIBUSB_TRANSFER_COMPLETED) diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index 7916f05d..cc40bbfa 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -77,7 +77,7 @@ static libusb_device_handle *lascar_open(struct libusb_device *dev) return dev_hdl; } -static void mark_xfer(struct libusb_transfer *xfer) +static void LIBUSB_CALL mark_xfer(struct libusb_transfer *xfer) { xfer->user_data = GINT_TO_POINTER(1); @@ -503,7 +503,7 @@ SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data) return TRUE; } -SR_PRIV void lascar_el_usb_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL lascar_el_usb_receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; diff --git a/src/hardware/lascar-el-usb/protocol.h b/src/hardware/lascar-el-usb/protocol.h index 82d39925..a0f7f4fd 100644 --- a/src/hardware/lascar-el-usb/protocol.h +++ b/src/hardware/lascar-el-usb/protocol.h @@ -76,7 +76,7 @@ SR_PRIV int lascar_get_config(libusb_device_handle *dev_hdl, unsigned char *configblock, int *configlen); SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address); SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data); -SR_PRIV void lascar_el_usb_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL lascar_el_usb_receive_transfer(struct libusb_transfer *transfer); SR_PRIV int lascar_start_logging(const struct sr_dev_inst *sdi); SR_PRIV int lascar_stop_logging(const struct sr_dev_inst *sdi); SR_PRIV int lascar_is_logging(const struct sr_dev_inst *sdi); diff --git a/src/hardware/saleae-logic16/protocol.c b/src/hardware/saleae-logic16/protocol.c index 4bb16814..3db8a82f 100644 --- a/src/hardware/saleae-logic16/protocol.c +++ b/src/hardware/saleae-logic16/protocol.c @@ -702,7 +702,7 @@ static size_t convert_sample_data(struct dev_context *devc, return ret; } -SR_PRIV void logic16_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL logic16_receive_transfer(struct libusb_transfer *transfer) { gboolean packet_has_error = FALSE; struct sr_datafeed_packet packet; diff --git a/src/hardware/saleae-logic16/protocol.h b/src/hardware/saleae-logic16/protocol.h index 00979a30..75a20899 100644 --- a/src/hardware/saleae-logic16/protocol.h +++ b/src/hardware/saleae-logic16/protocol.h @@ -97,6 +97,6 @@ SR_PRIV int logic16_setup_acquisition(const struct sr_dev_inst *sdi, SR_PRIV int logic16_start_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int logic16_abort_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int logic16_init_device(const struct sr_dev_inst *sdi); -SR_PRIV void logic16_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL logic16_receive_transfer(struct libusb_transfer *transfer); #endif diff --git a/src/hardware/sysclk-lwla/protocol.c b/src/hardware/sysclk-lwla/protocol.c index dba336d9..894c8efe 100644 --- a/src/hardware/sysclk-lwla/protocol.c +++ b/src/hardware/sysclk-lwla/protocol.c @@ -604,7 +604,7 @@ static void end_acquisition(struct sr_dev_inst *sdi) /* USB output transfer completion callback. */ -static void receive_transfer_out(struct libusb_transfer *transfer) +static void LIBUSB_CALL receive_transfer_out(struct libusb_transfer *transfer) { struct sr_dev_inst *sdi; struct dev_context *devc; @@ -658,7 +658,7 @@ static void receive_transfer_out(struct libusb_transfer *transfer) /* USB input transfer completion callback. */ -static void receive_transfer_in(struct libusb_transfer *transfer) +static void LIBUSB_CALL receive_transfer_in(struct libusb_transfer *transfer) { struct sr_dev_inst *sdi; struct dev_context *devc; diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c index 983451ea..de3faf04 100644 --- a/src/hardware/testo/api.c +++ b/src/hardware/testo/api.c @@ -372,7 +372,7 @@ static void receive_data(struct sr_dev_inst *sdi, unsigned char *data, int len) } -SR_PRIV void receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; diff --git a/src/hardware/testo/protocol.h b/src/hardware/testo/protocol.h index c2c3a870..62607e2b 100644 --- a/src/hardware/testo/protocol.h +++ b/src/hardware/testo/protocol.h @@ -75,7 +75,7 @@ struct dev_context { SR_PRIV int testo_set_serial_params(struct sr_usb_dev_inst *usb); SR_PRIV int testo_probe_channels(struct sr_dev_inst *sdi); -SR_PRIV void receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer); SR_PRIV int testo_request_packet(const struct sr_dev_inst *sdi); SR_PRIV gboolean testo_check_packet_prefix(uint8_t *buf, int len); SR_PRIV uint16_t crc16_mcrf4xx(uint16_t crc, uint8_t *data, size_t len); diff --git a/src/hardware/uni-t-ut32x/protocol.c b/src/hardware/uni-t-ut32x/protocol.c index 1a910b3a..a79d07ae 100644 --- a/src/hardware/uni-t-ut32x/protocol.c +++ b/src/hardware/uni-t-ut32x/protocol.c @@ -145,7 +145,7 @@ static void process_packet(struct sr_dev_inst *sdi) } -SR_PRIV void uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; diff --git a/src/hardware/uni-t-ut32x/protocol.h b/src/hardware/uni-t-ut32x/protocol.h index e66b7920..1a1cf1f5 100644 --- a/src/hardware/uni-t-ut32x/protocol.h +++ b/src/hardware/uni-t-ut32x/protocol.h @@ -66,6 +66,6 @@ struct dev_context { }; SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data); -SR_PRIV void uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer); #endif diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c index bed4ce15..7ed2bf43 100644 --- a/src/hardware/victor-dmm/api.c +++ b/src/hardware/victor-dmm/api.c @@ -286,7 +286,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * return SR_OK; } -static void receive_transfer(struct libusb_transfer *transfer) +static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; -- 2.30.2