[Spice-devel,usbredir,4/6] usbredirhost: add LIBUSB_CALL to libusb complete-callback-functions

Submitted by Uri Lublin on May 3, 2012, 3:04 p.m.

Details

Message ID 1336057479-22629-5-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin May 3, 2012, 3:04 p.m.
In libusb.h the following definition appears:
typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);

Added LIBUSB_CALL to the following functions:
	usbredirhost_iso_packet_complete
	usbredirhost_interrupt_packet_complete
	usbredirhost_control_packet_complete
	usbredirhost_bulk_packet_complete

This fixes the following compiler warning for Windows (mingw):
./usbredirhost/usbredirhost.c: In function 'usbredirhost_alloc_iso_stream':
./usbredir/usbredirhost/usbredirhost.c:1206:13: warning: passing argument 7 of 'libusb_fill_iso_transfer' from incompatible pointer type [enabled by default]
---
 usbredirhost/usbredirhost.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 068ea1d..305dd35 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -1032,7 +1032,7 @@  static int usbredirhost_handle_iso_status(struct usbredirhost *host,
     }
 }

-static void usbredirhost_iso_packet_complete(
+static void LIBUSB_CALL usbredirhost_iso_packet_complete(
     struct libusb_transfer *libusb_transfer)
 {
     struct usbredirtransfer *transfer = libusb_transfer->user_data;
@@ -1271,7 +1271,7 @@  static int usbredirhost_submit_interrupt_in_transfer(struct usbredirhost *host,
     return usb_redir_success;
 }

-static void usbredirhost_interrupt_packet_complete(
+static void LIBUSB_CALL usbredirhost_interrupt_packet_complete(
     struct libusb_transfer *libusb_transfer)
 {
     struct usbredirtransfer *transfer = libusb_transfer->user_data;
@@ -1794,7 +1794,7 @@  static void usbredirhost_cancel_data_packet(void *priv, uint32_t id)
     UNLOCK(host);
 }

-static void usbredirhost_control_packet_complete(
+static void LIBUSB_CALL usbredirhost_control_packet_complete(
     struct libusb_transfer *libusb_transfer)
 {
     struct usb_redir_control_packet_header control_packet;
@@ -1925,7 +1925,7 @@  static void usbredirhost_control_packet(void *priv, uint32_t id,
     }
 }

-static void usbredirhost_bulk_packet_complete(
+static void LIBUSB_CALL usbredirhost_bulk_packet_complete(
     struct libusb_transfer *libusb_transfer)
 {
     struct usb_redir_bulk_packet_header bulk_packet;

Comments

ACK

Christophe

On Thu, May 03, 2012 at 06:04:37PM +0300, Uri Lublin wrote:
> In libusb.h the following definition appears:
> typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);
> 
> Added LIBUSB_CALL to the following functions:
> 	usbredirhost_iso_packet_complete
> 	usbredirhost_interrupt_packet_complete
> 	usbredirhost_control_packet_complete
> 	usbredirhost_bulk_packet_complete
> 
> This fixes the following compiler warning for Windows (mingw):
> ./usbredirhost/usbredirhost.c: In function 'usbredirhost_alloc_iso_stream':
> ./usbredir/usbredirhost/usbredirhost.c:1206:13: warning: passing argument 7 of 'libusb_fill_iso_transfer' from incompatible pointer type [enabled by default]
> ---
>  usbredirhost/usbredirhost.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
> index 068ea1d..305dd35 100644
> --- a/usbredirhost/usbredirhost.c
> +++ b/usbredirhost/usbredirhost.c
> @@ -1032,7 +1032,7 @@ static int usbredirhost_handle_iso_status(struct usbredirhost *host,
>      }
>  }
> 
> -static void usbredirhost_iso_packet_complete(
> +static void LIBUSB_CALL usbredirhost_iso_packet_complete(
>      struct libusb_transfer *libusb_transfer)
>  {
>      struct usbredirtransfer *transfer = libusb_transfer->user_data;
> @@ -1271,7 +1271,7 @@ static int usbredirhost_submit_interrupt_in_transfer(struct usbredirhost *host,
>      return usb_redir_success;
>  }
> 
> -static void usbredirhost_interrupt_packet_complete(
> +static void LIBUSB_CALL usbredirhost_interrupt_packet_complete(
>      struct libusb_transfer *libusb_transfer)
>  {
>      struct usbredirtransfer *transfer = libusb_transfer->user_data;
> @@ -1794,7 +1794,7 @@ static void usbredirhost_cancel_data_packet(void *priv, uint32_t id)
>      UNLOCK(host);
>  }
> 
> -static void usbredirhost_control_packet_complete(
> +static void LIBUSB_CALL usbredirhost_control_packet_complete(
>      struct libusb_transfer *libusb_transfer)
>  {
>      struct usb_redir_control_packet_header control_packet;
> @@ -1925,7 +1925,7 @@ static void usbredirhost_control_packet(void *priv, uint32_t id,
>      }
>  }
> 
> -static void usbredirhost_bulk_packet_complete(
> +static void LIBUSB_CALL usbredirhost_bulk_packet_complete(
>      struct libusb_transfer *libusb_transfer)
>  {
>      struct usb_redir_bulk_packet_header bulk_packet;
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel