Re: [PATCH 10/10] Move RedCharDeviceCallbacks into RedCharDeviceClass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 01, 2016 at 03:51:44PM -0500, Jonathon Jongsma wrote:
> diff --git a/server/smartcard.c b/server/smartcard.c
> index 52d56ea..0238efe 100644
> --- a/server/smartcard.c
> +++ b/server/smartcard.c
> @@ -272,14 +272,6 @@ static SpiceCharDeviceInstance *smartcard_readers_get_unattached(void)
>  static RedCharDeviceSmartcard *smartcard_device_new(RedsState *reds, SpiceCharDeviceInstance *sin)
>  {
>      RedCharDevice *char_dev;
> -    RedCharDeviceCallbacks char_dev_cbs = {
> -        .read_one_msg_from_device = smartcard_read_msg_from_device,
> -        .ref_msg_to_client = smartcard_ref_msg_to_client,
> -        .unref_msg_to_client = smartcard_unref_msg_to_client,
> -        .send_msg_to_client = smartcard_send_msg_to_client,
> -        .send_tokens_to_client = smartcard_send_tokens_to_client,
> -        .remove_client = smartcard_remove_client,
> -    };
>  
>      char_dev = g_object_new(RED_TYPE_CHAR_DEVICE_SMARTCARD,
>                              "sin", sin,
> @@ -288,8 +280,8 @@ static RedCharDeviceSmartcard *smartcard_device_new(RedsState *reds, SpiceCharDe
>                              "self-tokens", ~0ULL,
>                              NULL);
>  
> -    red_char_device_set_callbacks(RED_CHAR_DEVICE(char_dev),
> -                                  &char_dev_cbs, char_dev);
> +    g_object_set(char_dev, "opaque", char_dev, NULL);
> +

I'm not sure why this is done in a separate call here rather than being
added to the g_object_new call just before as for the other
RedCharDevice children.

Looks good otherwise.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]