]> sigrok.org Git - libsigrok.git/commitdiff
windows: Fix various compiler warnings.
authorUwe Hermann <redacted>
Sun, 12 Apr 2015 17:28:03 +0000 (19:28 +0200)
committerUwe Hermann <redacted>
Sun, 12 Apr 2015 17:28:36 +0000 (19:28 +0200)
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,
               ^

19 files changed:
src/hardware/fx2lafw/api.c
src/hardware/fx2lafw/protocol.c
src/hardware/fx2lafw/protocol.h
src/hardware/hantek-dso/api.c
src/hardware/ikalogic-scanalogic2/protocol.c
src/hardware/ikalogic-scanalogic2/protocol.h
src/hardware/kecheng-kc-330b/protocol.c
src/hardware/kecheng-kc-330b/protocol.h
src/hardware/lascar-el-usb/api.c
src/hardware/lascar-el-usb/protocol.c
src/hardware/lascar-el-usb/protocol.h
src/hardware/saleae-logic16/protocol.c
src/hardware/saleae-logic16/protocol.h
src/hardware/sysclk-lwla/protocol.c
src/hardware/testo/api.c
src/hardware/testo/protocol.h
src/hardware/uni-t-ut32x/protocol.c
src/hardware/uni-t-ut32x/protocol.h
src/hardware/victor-dmm/api.c

index 04284e507ecfc1833d12492d273450f607bf3569..ab3345f32cc81db6758261e48e1cd5423867b554 100644 (file)
@@ -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;
index 6681b9efd67885009973fc7dcfad9a9e954b21ff..11e3504e7948b7b6a8899fe51f9e601d85181ab5 100644 (file)
@@ -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;
index 3be871827eee35f9659820a4c408aafe56fd1ffa..c245a7a275b98c638824f16fd8b74855aedbf98f 100644 (file)
@@ -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);
index f29d4a0ec22dc513c1f8063118baf367403cddcd..47907d8e1754f36a84eceda01365a9469c1e78fb 100644 (file)
@@ -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;
index f756b6e577cb83c1236dc32ebae9b4a310956222..7a7a2cb171b5ba210c26f660f875fcf03887ac0b 100644 (file)
@@ -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;
index 45f5917a65e11b4d6f00f9be949cb0f0ea2f10cc..cd7948212ec723fc884c13b2f33b1f4dffa94ee7 100644 (file)
@@ -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,
index f563866861f1bc8c52aa8d9642c5126f60863f62..005b87cba05a50dd28f219dcd14ac07607635650 100644 (file)
@@ -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;
index a2536898895f2f17e9dfabfb358850ac7c874b1c..ff3ce8b90d7f437da9fd85754f8015e3d6dff7ef 100644 (file)
@@ -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,
index 14273ce3d4fcfcb32fc7b391ef060ec0b0acb4e0..4d9ae81dfb4aa4fddab39c83eb16aa9386c22544 100644 (file)
@@ -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)
index 7916f05dd5e256a98a1c0c485568e6cc0b28a84e..cc40bbfab7e98dd9aad4b2b59c2c444b15249e94 100644 (file)
@@ -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;
index 82d39925db64dc276cdc0652dfae4d96be4b59e5..a0f7f4fdb6e16749b28046001c8f7fd4507a6071 100644 (file)
@@ -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);
index 4bb16814ecfa79f55cc2dfc626bdef070e9bf006..3db8a82f0b8577b9bf580324b9f2a96598dcb013 100644 (file)
@@ -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;
index 00979a305cedd825bd29fcad3cba5beeb2030369..75a2089939968d4fab23c5fa094ad67b14fa91b2 100644 (file)
@@ -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
index dba336d9aee4924802511774d8a07ed0827c59f2..894c8efeb802990a5d409b704043dadf10686d75 100644 (file)
@@ -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;
index 983451ea6cea08d435c825bdad0170c35c7a8839..de3faf04334198e4d882d3a46ba25b3e41659bde 100644 (file)
@@ -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;
index c2c3a870d7f9262bee904504218cb16d83a761be..62607e2b60d152f307cc396b324ed7c160cb56fb 100644 (file)
@@ -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);
index 1a910b3aa27b232fb84cbd4b0253c7fcfd2fd338..a79d07ae2f28ade7d467e4eaea508770aaf2165c 100644 (file)
@@ -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;
index e66b792072edb11427d8e99bdd02701393472cec..1a1cf1f5baa7612e331ffb1e446492e30b126d25 100644 (file)
@@ -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
index bed4ce159ae0d6780b94211256c63926238c1b2e..7ed2bf435fb0081032023debec8cf999470d5bb9 100644 (file)
@@ -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;