[Spice-devel] [PATCH 10/10] Rename RCC_TO_DCC() to DISPLAY_CHANNEL_CLIENT()
Frediano Ziglio
fziglio at redhat.com
Thu Sep 1 15:00:00 UTC 2016
>
> On Thu, 2016-09-01 at 12:50 +0200, Victor Toso wrote:
> > Hi,
> >
> > On Thu, Sep 01, 2016 at 06:26:18AM -0400, Frediano Ziglio wrote:
> > >
> > > >
> > > >
> > > > Prepare for port to GObject
> > >
> > > Honestly I prefer the old name.
> > > DISPLAY_CHANNEL_CLIENT looks like you can convert anything to a
> > > DisplayChannelClient,
> > > I would expect a NULL check for every conversion.
> > >
> > > Frediano
> >
> > I'm guessing that this macro will use G_TYPE_CHECK_INSTANCE_CAST
> > later
> > on? If yes, NULL check (and warning in case cast is wrong) should be
> > covered.
> >
> > Maybe this patch can be introduced with the gobjectification of dcc?
>
>
> Yes, this was intended as a temporary change to mimic the GObject type
> casts for now until we convert to gobject. This particular part was
> relatively self-contained so it was split out so that the GObject patch
> could be minimized and easier to review. I could merge it back into the
> gobject patch, but I'm not sure that would give us any benefits.
>
>
On this I agree, rename now or not.
About my preference on the two names is not strong.
Frediano
> >
> > >
> > >
> > > >
> > > > ---
> > > > server/dcc-send.c | 86
> > > > ++++++++++++++++++++++++------------------------
> > > > server/dcc.c | 6 ++--
> > > > server/dcc.h | 2 +-
> > > > server/display-channel.c | 4 +--
> > > > 4 files changed, 49 insertions(+), 49 deletions(-)
> > > >
> > > > diff --git a/server/dcc-send.c b/server/dcc-send.c
> > > > index d6b9b41..ecf0938 100644
> > > > --- a/server/dcc-send.c
> > > > +++ b/server/dcc-send.c
> > > > @@ -133,7 +133,7 @@ static int
> > > > is_surface_area_lossy(DisplayChannelClient
> > > > *dcc, uint32_t surface_id,
> > > > static int is_bitmap_lossy(RedChannelClient *rcc, SpiceImage
> > > > *image,
> > > > SpiceRect *area,
> > > > Drawable *drawable, BitmapData
> > > > *out_data)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > >
> > > > if (image == NULL) {
> > > > // self bitmap
> > > > @@ -197,7 +197,7 @@ static void
> > > > red_display_add_image_to_pixmap_cache(RedChannelClient *rcc,
> > > > SpiceImage
> > > > *image,
> > > > SpiceImage
> > > > *io_image,
> > > > int is_lossy)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > DisplayChannel *display_channel = DCC_TO_DC(dcc);
> > > >
> > > > if ((image->descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME))
> > > > {
> > > > @@ -242,7 +242,7 @@ static void
> > > > marshal_sub_msg_inval_list_wait(SpiceMarshaller *m,
> > > > /* use legacy SpiceDataHeader (with sub_list) */
> > > > static void send_free_list_legacy(RedChannelClient *rcc)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > FreeList *free_list = &dcc->priv->send_data.free_list;
> > > > SpiceMarshaller *marshaller;
> > > > int sub_list_len = 1;
> > > > @@ -273,7 +273,7 @@ static void
> > > > send_free_list_legacy(RedChannelClient *rcc)
> > > > /* use mini header and SPICE_MSG_LIST */
> > > > static void send_free_list(RedChannelClient *rcc)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > FreeList *free_list = &dcc->priv->send_data.free_list;
> > > > int sub_list_len = 1;
> > > > SpiceMarshaller *urgent_marshaller;
> > > > @@ -508,7 +508,7 @@ static FillBitsType
> > > > fill_bits(DisplayChannelClient *dcc,
> > > > SpiceMarshaller *m,
> > > > static void fill_mask(RedChannelClient *rcc, SpiceMarshaller *m,
> > > > SpiceImage *mask_bitmap, Drawable
> > > > *drawable)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > >
> > > > if (mask_bitmap && m) {
> > > > if (dcc->priv->image_compression !=
> > > > SPICE_IMAGE_COMPRESSION_OFF) {
> > > > @@ -540,7 +540,7 @@ static void
> > > > marshall_qxl_draw_fill(RedChannelClient *rcc,
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMarshaller *brush_pat_out;
> > > > SpiceMarshaller *mask_bitmap_out;
> > > > SpiceFill fill;
> > > > @@ -760,7 +760,7 @@ static void
> > > > red_add_lossless_drawable_dependencies(RedChannelClient *rcc,
> > > > SpiceRect
> > > > *deps_areas[],
> > > > int num_deps)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > DisplayChannel *display = DCC_TO_DC(dcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int sync_rendered = FALSE;
> > > > @@ -827,7 +827,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_fill(RedChannelClient *rcc,
> > > > SpiceMarshaller *m,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > >
> > > > @@ -885,7 +885,7 @@ static FillBitsType
> > > > red_marshall_qxl_draw_opaque(RedChannelClient *rcc,
> > > > RedDrawablePipe
> > > > Item *dpi,
> > > > int
> > > > src_allowed_lossy)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *brush_pat_out;
> > > > @@ -918,7 +918,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_opaque(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *m,
> > > > RedDrawablePipeIt
> > > > em *dpi)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > >
> > > > @@ -984,7 +984,7 @@ static FillBitsType
> > > > red_marshall_qxl_draw_copy(RedChannelClient *rcc,
> > > > RedDrawablePipeIt
> > > > em *dpi,
> > > > int
> > > > src_allowed_lossy)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > @@ -1010,7 +1010,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_copy(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int has_mask = !!drawable->u.copy.mask.bitmap;
> > > > @@ -1035,7 +1035,7 @@ static void
> > > > red_marshall_qxl_draw_transparent(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > RedDrawablePipeIte
> > > > m *dpi)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Drawable *item = dpi->drawable;
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > @@ -1084,7 +1084,7 @@ static FillBitsType
> > > > red_marshall_qxl_draw_alpha_blend(RedChannelClient *rcc,
> > > > int
> > > > src_allowed_lossy)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > SpiceAlphaBlend alpha_blend;
> > > > @@ -1108,7 +1108,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_alpha_blend(RedChannelClient *rcc,
> > > > RedDrawableP
> > > > ipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int src_is_lossy;
> > > > BitmapData src_bitmap_data;
> > > > @@ -1150,7 +1150,7 @@ static void
> > > > red_lossy_marshall_qxl_copy_bits(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceRect src_rect;
> > > > int horz_offset;
> > > > @@ -1179,7 +1179,7 @@ static void
> > > > red_marshall_qxl_draw_blend(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > SpiceMarshaller *mask_bitmap_out;
> > > > @@ -1203,7 +1203,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_blend(RedChannelClient *rcc,
> > > > RedDrawablePipeIte
> > > > m *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int src_is_lossy;
> > > > BitmapData src_bitmap_data;
> > > > @@ -1265,7 +1265,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_blackness(RedChannelClient *rcc,
> > > > RedDrawablePip
> > > > eItem *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int has_mask = !!drawable->u.blackness.mask.bitmap;
> > > >
> > > > @@ -1299,7 +1299,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_whiteness(RedChannelClient *rcc,
> > > > RedDrawablePip
> > > > eItem *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int has_mask = !!drawable->u.whiteness.mask.bitmap;
> > > >
> > > > @@ -1339,7 +1339,7 @@ static void
> > > > red_marshall_qxl_draw_rop3(RedChannelClient
> > > > *rcc,
> > > > RedDrawablePipeItem *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceRop3 rop3;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > @@ -1368,7 +1368,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_rop3(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int src_is_lossy;
> > > > BitmapData src_bitmap_data;
> > > > @@ -1423,7 +1423,7 @@ static void
> > > > red_marshall_qxl_draw_composite(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceMarshaller *src_bitmap_out;
> > > > SpiceMarshaller *mask_bitmap_out;
> > > > @@ -1448,7 +1448,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_composite(RedChannelClient *rcc,
> > > > RedDrawablePip
> > > > eItem *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int src_is_lossy;
> > > > BitmapData src_bitmap_data;
> > > > @@ -1504,7 +1504,7 @@ static void
> > > > red_marshall_qxl_draw_stroke(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceStroke stroke;
> > > > SpiceMarshaller *brush_pat_out;
> > > > @@ -1529,7 +1529,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_stroke(RedChannelClient *rcc,
> > > > RedDrawablePipeIt
> > > > em *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int brush_is_lossy;
> > > > BitmapData brush_bitmap_data;
> > > > @@ -1584,7 +1584,7 @@ static void
> > > > red_marshall_qxl_draw_text(RedChannelClient
> > > > *rcc,
> > > > RedDrawablePipeItem *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > SpiceText text;
> > > > SpiceMarshaller *brush_pat_out;
> > > > @@ -1611,7 +1611,7 @@ static void
> > > > red_lossy_marshall_qxl_draw_text(RedChannelClient *rcc,
> > > > RedDrawablePipeItem
> > > > *dpi)
> > > > {
> > > > Drawable *item = dpi->drawable;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedDrawable *drawable = item->red_drawable;
> > > > int fg_is_lossy;
> > > > BitmapData fg_bitmap_data;
> > > > @@ -1683,7 +1683,7 @@ static int
> > > > red_marshall_stream_data(RedChannelClient
> > > > *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > Drawable *drawable)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > DisplayChannel *display = DCC_TO_DC(dcc);
> > > > Stream *stream = drawable->stream;
> > > > SpiceCopy *copy;
> > > > @@ -1833,7 +1833,7 @@ static void
> > > > display_channel_marshall_migrate_data(RedChannelClient *rcc,
> > > > SpiceMarshalle
> > > > r
> > > > *base_marshall
> > > > er)
> > > > {
> > > > DisplayChannel *display_channel;
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > ImageEncoders *encoders = dcc_get_encoders(dcc);
> > > > SpiceMigrateDataDisplay display_data = {0,};
> > > >
> > > > @@ -1869,7 +1869,7 @@ static void
> > > > display_channel_marshall_migrate_data(RedChannelClient *rcc,
> > > > static void
> > > > display_channel_marshall_pixmap_sync(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshalle
> > > > r)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMsgWaitForChannels wait;
> > > > PixmapCache *pixmap_cache;
> > > >
> > > > @@ -1921,7 +1921,7 @@ static void
> > > > dcc_pixmap_cache_reset(DisplayChannelClient
> > > > *dcc, SpiceMsgWaitForCha
> > > > static void
> > > > display_channel_marshall_reset_cache(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshalle
> > > > r)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMsgWaitForChannels wait;
> > > >
> > > > red_channel_client_init_send_data(rcc,
> > > > SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS, NULL);
> > > > @@ -1935,7 +1935,7 @@ static void
> > > > red_marshall_image(RedChannelClient *rcc,
> > > > SpiceMarshaller *m,
> > > > RedImageItem *item)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > DisplayChannel *display = DCC_TO_DC(dcc);
> > > > SpiceImage red_image;
> > > > SpiceBitmap bitmap;
> > > > @@ -2158,7 +2158,7 @@ static void
> > > > marshall_qxl_drawable(RedChannelClient
> > > > *rcc,
> > > > static void marshall_stream_start(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > StreamAgent *agent)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > Stream *stream = agent->stream;
> > > >
> > > > agent->last_send_time = 0;
> > > > @@ -2200,7 +2200,7 @@ static void
> > > > marshall_stream_clip(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > RedStreamClipItem *item)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > StreamAgent *agent = item->stream_agent;
> > > >
> > > > spice_return_if_fail(agent->stream);
> > > > @@ -2218,7 +2218,7 @@ static void
> > > > marshall_stream_clip(RedChannelClient *rcc,
> > > > static void marshall_stream_end(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > StreamAgent* agent)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMsgDisplayStreamDestroy destroy;
> > > >
> > > > red_channel_client_init_send_data(rcc,
> > > > SPICE_MSG_DISPLAY_STREAM_DESTROY,
> > > > NULL);
> > > > @@ -2230,7 +2230,7 @@ static void
> > > > marshall_stream_end(RedChannelClient *rcc,
> > > > static void marshall_upgrade(RedChannelClient *rcc,
> > > > SpiceMarshaller *m,
> > > > RedUpgradeItem *item)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > RedChannel *channel = red_channel_client_get_channel(rcc);
> > > > RedDrawable *red_drawable;
> > > > SpiceMsgDisplayDrawCopy copy;
> > > > @@ -2260,7 +2260,7 @@ static void
> > > > marshall_surface_create(RedChannelClient
> > > > *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > SpiceMsgSurfaceCreate
> > > > *surface_create)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > >
> > > > region_init(&dcc->priv-
> > > > >surface_client_lossy_region[surface_create->surface_id]);
> > > > red_channel_client_init_send_data(rcc,
> > > > SPICE_MSG_DISPLAY_SURFACE_CREATE,
> > > > NULL);
> > > > @@ -2271,7 +2271,7 @@ static void
> > > > marshall_surface_create(RedChannelClient
> > > > *rcc,
> > > > static void marshall_surface_destroy(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > uint32_t surface_id)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMsgSurfaceDestroy surface_destroy;
> > > >
> > > > region_destroy(&dcc->priv-
> > > > >surface_client_lossy_region[surface_id]);
> > > > @@ -2313,7 +2313,7 @@ static void
> > > > marshall_stream_activate_report(RedChannelClient *rcc,
> > > > SpiceMarshaller
> > > > *base_marshaller,
> > > > uint32_t stream_id)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > StreamAgent *agent = &dcc->priv->stream_agents[stream_id];
> > > > SpiceMsgDisplayStreamActivateReport msg;
> > > >
> > > > @@ -2329,7 +2329,7 @@ static void
> > > > marshall_gl_scanout(RedChannelClient *rcc,
> > > > SpiceMarshaller *m,
> > > > RedPipeItem *item)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > DisplayChannel *display_channel = DCC_TO_DC(dcc);
> > > > QXLInstance* qxl = display_channel->common.qxl;
> > > >
> > > > @@ -2354,7 +2354,7 @@ static void
> > > > marshall_gl_draw(RedChannelClient *rcc,
> > > >
> > > > static void begin_send_message(RedChannelClient *rcc)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > FreeList *free_list = &dcc->priv->send_data.free_list;
> > > >
> > > > if (free_list->res->count) {
> > > > @@ -2389,7 +2389,7 @@ static void
> > > > reset_send_data(DisplayChannelClient *dcc)
> > > >
> > > > void dcc_send_item(RedChannelClient *rcc, RedPipeItem
> > > > *pipe_item)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > SpiceMarshaller *m = red_channel_client_get_marshaller(rcc);
> > > >
> > > > reset_send_data(dcc);
> > > > diff --git a/server/dcc.c b/server/dcc.c
> > > > index 9972d75..16d8acd 100644
> > > > --- a/server/dcc.c
> > > > +++ b/server/dcc.c
> > > > @@ -590,7 +590,7 @@ RedPipeItem
> > > > *dcc_gl_scanout_item_new(RedChannelClient
> > > > *rcc, void *data, int num)
> > > >
> > > > RedPipeItem *dcc_gl_draw_item_new(RedChannelClient *rcc, void
> > > > *data, int
> > > > num)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > const SpiceMsgDisplayGlDraw *draw = data;
> > > > RedGlDrawItem *item = spice_new(RedGlDrawItem, 1);
> > > > spice_return_val_if_fail(item != NULL, NULL);
> > > > @@ -990,7 +990,7 @@ static int
> > > > dcc_handle_gl_draw_done(DisplayChannelClient
> > > > *dcc)
> > > >
> > > > int dcc_handle_message(RedChannelClient *rcc, uint32_t size,
> > > > uint16_t type,
> > > > void *msg)
> > > > {
> > > > - DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> > > > + DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > >
> > > > switch (type) {
> > > > case SPICE_MSGC_DISPLAY_INIT:
> > > > @@ -1186,7 +1186,7 @@ int dcc_config_socket(RedChannelClient
> > > > *rcc)
> > > > RedClient *client = red_channel_client_get_client(rcc);
> > > > MainChannelClient *mcc = red_client_get_main(client);
> > > >
> > > > - RCC_TO_DCC(rcc)->is_low_bandwidth =
> > > > main_channel_client_is_low_bandwidth(mcc);
> > > > + DISPLAY_CHANNEL_CLIENT(rcc)->is_low_bandwidth =
> > > > main_channel_client_is_low_bandwidth(mcc);
> > > >
> > > > return common_channel_config_socket(rcc);
> > > > }
> > > > diff --git a/server/dcc.h b/server/dcc.h
> > > > index 0659ce7..d08e413 100644
> > > > --- a/server/dcc.h
> > > > +++ b/server/dcc.h
> > > > @@ -60,7 +60,7 @@ typedef struct FreeList {
> > > > typedef struct DisplayChannelClient DisplayChannelClient;
> > > >
> > > > #define DCC_TO_DC(dcc)
> > > > ((DisplayChannel*)red_channel_client_get_channel((RedChannelClie
> > > > nt*)dcc))
> > > > -#define RCC_TO_DCC(rcc) ((DisplayChannelClient*)rcc)
> > > > +#define DISPLAY_CHANNEL_CLIENT(rcc) ((DisplayChannelClient*)rcc)
> > > >
> > > > typedef struct RedSurfaceCreateItem {
> > > > RedPipeItem pipe_item;
> > > > diff --git a/server/display-channel.c b/server/display-channel.c
> > > > index 74c7dc0..108e69b 100644
> > > > --- a/server/display-channel.c
> > > > +++ b/server/display-channel.c
> > > > @@ -1844,7 +1844,7 @@ static void on_disconnect(RedChannelClient
> > > > *rcc)
> > > > spice_info(NULL);
> > > > spice_return_if_fail(rcc != NULL);
> > > >
> > > > - dcc = RCC_TO_DCC(rcc);
> > > > + dcc = DISPLAY_CHANNEL_CLIENT(rcc);
> > > > display = DCC_TO_DC(dcc);
> > > >
> > > > dcc_stop(dcc); // TODO: start/stop -> connect/disconnect?
> > > > @@ -1875,7 +1875,7 @@ static uint64_t
> > > > handle_migrate_data_get_serial(RedChannelClient *rcc, uint32_t s
> > > >
> > > > static int handle_migrate_data(RedChannelClient *rcc, uint32_t
> > > > size, void
> > > > *message)
> > > > {
> > > > - return dcc_handle_migrate_data(RCC_TO_DCC(rcc), size,
> > > > message);
> > > > + return dcc_handle_migrate_data(DISPLAY_CHANNEL_CLIENT(rcc),
> > > > size,
> > > > message);
> > > > }
> > > >
> > > > static SpiceCanvas *image_surfaces_get(SpiceImageSurfaces
> > > > *surfaces,
> > > > uint32_t surface_id)
> > >
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list