[Spice-devel] [PATCH] [spice-gtk v2] usb-device: Expose libusb device

Uri Lublin uril at redhat.com
Wed Nov 19 07:36:24 PST 2014


On 11/19/2014 05:37 AM, Fabiano FidĂȘncio wrote:
> ping?
>
> On Thu, 2014-11-13 at 02:32 +0100, Fabiano FidĂȘncio wrote:
>> +
>> +/**
>> + * spice_usb_device_get_libusb_device:
>> + * @device: #SpiceUsbDevice to get the descriptor information of
>> + *
>> + * Returns: (transfer none): the %libusb_device associated to %SpiceUsbDevice.
>> + *
>> + * Since: 0.27
>> + **/
>> +gconstpointer
>> +spice_usb_device_get_libusb_device(const SpiceUsbDevice *device G_GNUC_UNUSED)
>> +{
>> +#ifdef USE_USBREDIR
>> +#ifndef G_OS_WIN32
>> +    const SpiceUsbDeviceInfo *info = (const SpiceUsbDeviceInfo *)device;
>> +
>> +    g_return_val_if_fail(info != NULL, FALSE);
>> +
>> +    return info->libdev;
>> +#endif
>> +#else
>> +    return NULL;
>> +#endif
>> +}

Hi Fabiano,

I think it's better to also return NULL when USE_USBREDIR is not defined.
(e.g. replace the 2 #ifdef to a single #if defined && ! defined )

Thanks,
     Uri.



More information about the Spice-devel mailing list