[Spice-commits] 2 commits - src/channel-display.c src/spice-widget-egl.c

Victor Toso de Carvalho victortoso at kemper.freedesktop.org
Wed Dec 20 15:13:26 UTC 2017


 src/channel-display.c  |    2 +-
 src/spice-widget-egl.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ddc249777fda50e8937fa152777fbaf90b0c381e
Author: Victor Toso <me at victortoso.com>
Date:   Wed Dec 20 14:11:25 2017 +0100

    Fix clang's double-promotion warning
    
    Casting to gdouble instead to float to avoid the warning and perhaps
    increase the precision.
    
    spice-widget-egl.c:573:28: error: implicit conversion increases
    floating-point precision: 'float' to 'gdouble' (aka 'double')
        tx = ((float)d->area.x / (float)d->egl.scanout.width);
           ~  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    spice-widget-egl.c:574:28: error: implicit conversion increases
    floating-point precision: 'float' to 'gdouble' (aka 'double')
        ty = ((float)d->area.y / (float)d->egl.scanout.height);
           ~  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    spice-widget-egl.c:575:32: error: implicit conversion increases
    floating-point precision: 'float' to 'gdouble' (aka 'double')
        tw = ((float)d->area.width / (float)d->egl.scanout.width);
           ~  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    spice-widget-egl.c:576:33: error: implicit conversion increases
    floating-point precision: 'float' to 'gdouble' (aka 'double')
        th = ((float)d->area.height / (float)d->egl.scanout.height);
           ~  ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index 1e71753..5354e26 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -570,10 +570,10 @@ void spice_egl_update_display(SpiceDisplay *display)
     glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
     glClear(GL_COLOR_BUFFER_BIT);
 
-    tx = ((float)d->area.x / (float)d->egl.scanout.width);
-    ty = ((float)d->area.y / (float)d->egl.scanout.height);
-    tw = ((float)d->area.width / (float)d->egl.scanout.width);
-    th = ((float)d->area.height / (float)d->egl.scanout.height);
+    tx = (gdouble) d->area.x / d->egl.scanout.width;
+    ty = (gdouble) d->area.y / d->egl.scanout.height;
+    tw = (gdouble) d->area.width / d->egl.scanout.width;
+    th = (gdouble) d->area.height / d->egl.scanout.height;
 
     /* convert to opengl coordinates, 0 is bottom, 1 is top. ty should
      * be the bottom of the area, since th is upward */
commit 37eac90efff10c77de32f28712d0d38d806acfa9
Author: Victor Toso <me at victortoso.com>
Date:   Wed Dec 20 13:48:52 2017 +0100

    Improve debug log for preferred video codec message
    
    The gst_opts[] array was moved to the -priv.h header
    inc96af50e2dd16b02b189e8 - Let's use it to improve debug messages.
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/src/channel-display.c b/src/channel-display.c
index 75d2e32..2208693 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -633,7 +633,7 @@ void spice_display_channel_change_preferred_video_codec_type(SpiceChannel *chann
      * decoding, store this information (as GArray) and send it to the server.
      * This array can be rearranged to have @codec_type in the front (which is
      * the preferred for the client side) */
-    CHANNEL_DEBUG(channel, "changing preferred video codec type to %d", codec_type);
+    CHANNEL_DEBUG(channel, "changing preferred video codec type to %s", gst_opts[codec_type].name);
     codecs = g_array_new(FALSE, FALSE, sizeof(gint));
     g_array_append_val(codecs, codec_type);
     spice_display_send_client_preferred_video_codecs(channel, codecs);


More information about the Spice-commits mailing list