[Spice-commits] server/dcc-send.cpp server/display-channel.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 23 09:39:20 UTC 2020


 server/dcc-send.cpp        |   10 +++-------
 server/display-channel.cpp |    6 ++----
 2 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit 3c8037d39f4ac18f7ad69e459ab9d418cce2a6ae
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Sat Jun 20 09:52:27 2020 +0100

    Remove DISPLAY_CHANNEL cast reusing DCC_TO_DC
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Julien Ropé <jrope at gmail.com>

diff --git a/server/dcc-send.cpp b/server/dcc-send.cpp
index 152f632e..333682e1 100644
--- a/server/dcc-send.cpp
+++ b/server/dcc-send.cpp
@@ -177,14 +177,11 @@ static GList *dcc_get_tail(DisplayChannelClient *dcc)
     return dcc->get_pipe()->tail;
 }
 
-XXX_CAST(RedChannel, DisplayChannel, DISPLAY_CHANNEL);
-
 static void red_display_add_image_to_pixmap_cache(DisplayChannelClient *dcc,
                                                   SpiceImage *image, SpiceImage *io_image,
                                                   int is_lossy)
 {
-    DisplayChannel *display_channel G_GNUC_UNUSED =
-        DISPLAY_CHANNEL(dcc->get_channel());
+    DisplayChannel *display_channel G_GNUC_UNUSED = DCC_TO_DC(dcc);
 
     if ((image->descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME)) {
         spice_assert(image->descriptor.width * image->descriptor.height > 0);
@@ -1794,7 +1791,7 @@ static void display_channel_marshall_migrate_data(DisplayChannelClient *dcc,
     SpiceMigrateDataDisplay display_data = {0,};
     GlzEncDictRestoreData glz_dict_data;
 
-    display_channel = DISPLAY_CHANNEL(dcc->get_channel());
+    display_channel = DCC_TO_DC(dcc);
 
     dcc->init_send_data(SPICE_MSG_MIGRATE_DATA);
     spice_marshaller_add_uint32(base_marshaller, SPICE_MIGRATE_DATA_DISPLAY_MAGIC);
@@ -2099,8 +2096,7 @@ static void marshall_qxl_drawable(DisplayChannelClient *dcc,
     spice_return_if_fail(dcc);
 
     Drawable *item = dpi->drawable;
-    DisplayChannel *display =
-        DISPLAY_CHANNEL(dcc->get_channel());
+    DisplayChannel *display = DCC_TO_DC(dcc);
 
     spice_return_if_fail(display);
     /* allow sized frames to be streamed, even if they where replaced by another frame, since
diff --git a/server/display-channel.cpp b/server/display-channel.cpp
index 398aed33..384cde6b 100644
--- a/server/display-channel.cpp
+++ b/server/display-channel.cpp
@@ -21,8 +21,6 @@
 #include "display-channel-private.h"
 #include "red-qxl.h"
 
-XXX_CAST(RedChannel, DisplayChannel, DISPLAY_CHANNEL);
-
 DisplayChannel::~DisplayChannel()
 {
     display_channel_destroy_surfaces(this);
@@ -2491,7 +2489,7 @@ void DisplayChannel::on_connect(RedClient *client,
 
 void DisplayChannelClient::disconnect()
 {
-    DisplayChannel *display = DISPLAY_CHANNEL(get_channel());
+    DisplayChannel *display = DCC_TO_DC(this);
 
     guest_set_client_capabilities(display);
 
@@ -2500,7 +2498,7 @@ void DisplayChannelClient::disconnect()
 
 void DisplayChannelClient::migrate()
 {
-    DisplayChannel *display = DISPLAY_CHANNEL(get_channel());
+    DisplayChannel *display = DCC_TO_DC(this);
 
     /* We need to stop the streams, and to send upgrade_items to the client.
      * Otherwise, (1) the client might display lossy regions that we don't track


More information about the Spice-commits mailing list