[Spice-commits] 9 commits - client/display_channel.cpp client/glz_decoder.cpp client/gui client/hot_keys.cpp client/red_client.cpp client/x11 common/canvas_base.c common/sw_canvas.c python_modules/demarshal.py python_modules/marshal.py server/jpeg_encoder.c server/red_parse_qxl.c server/reds.c server/red_worker.c

Alon Levy alon at kemper.freedesktop.org
Thu Jan 27 02:47:01 PST 2011


 client/display_channel.cpp     |   18 ++++++++++++------
 client/glz_decoder.cpp         |    5 -----
 client/gui/resource_provider.h |    3 +++
 client/gui/softrenderer.h      |    2 ++
 client/gui/softtexture.h       |    3 +++
 client/hot_keys.cpp            |    2 --
 client/red_client.cpp          |    1 -
 client/x11/platform.cpp        |    7 +++++--
 common/canvas_base.c           |   12 ------------
 common/sw_canvas.c             |    3 +--
 python_modules/demarshal.py    |   30 +++++++++++++++++++++---------
 python_modules/marshal.py      |    8 +++++---
 server/jpeg_encoder.c          |    3 +--
 server/red_parse_qxl.c         |    3 +--
 server/red_worker.c            |   14 +-------------
 server/reds.c                  |    5 +++--
 16 files changed, 58 insertions(+), 61 deletions(-)

New commits:
commit a13824b22a7946bbf6f8f440b44d03c28c1748be
Author: Alon Levy <alevy at redhat.com>
Date:   Mon Jan 24 23:32:43 2011 +0200

    demarshaller/marshaller fix gcc 4.6.0
    
    python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
    warning about set but unused variables. The fixes disable creating
    of variables mem_size when they are not used (demarshall) and
    declaring a src variable when the message doesn't use it (marshal).
    
    You need to touch *.proto after applying this (should add a Makefile
    dependency).

diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 48551c0..9d3b1e4 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -251,14 +251,18 @@ def write_validate_pointer_item(writer, container, item, scope, parent_scope, st
 
             array_item = ItemInfo(target_type, "%s__array" % item.prefix, start)
             scope.variable_def("uint32_t", array_item.nw_size())
-            scope.variable_def("uint32_t", array_item.mem_size())
+            # don't create a variable that isn't used, fixes -Werror=unused-but-set-variable
+            need_mem_size = want_mem_size or (
+                want_extra_size and not item.member.has_attr("chunk")
+                and not target_type.is_cstring_length())
+            if need_mem_size:
+                scope.variable_def("uint32_t", array_item.mem_size())
             if target_type.is_cstring_length():
                 writer.assign(array_item.nw_size(), "spice_strnlen((char *)message_start + %s, message_end - (message_start + %s))" % (v, v))
                 writer.error_check("*(message_start + %s + %s) != 0" % (v, array_item.nw_size()))
-                writer.assign(array_item.mem_size(), array_item.nw_size())
             else:
                 write_validate_array_item(writer, container, array_item, scope, parent_scope, start,
-                                          True, True, False)
+                                          True, want_mem_size=need_mem_size, want_extra_size=False)
                 writer.error_check("message_start + %s + %s > message_end" % (v, array_item.nw_size()))
 
             if want_extra_size:
@@ -524,7 +528,7 @@ def write_validate_member(writer, container, member, parent_scope, start,
 def write_validate_container(writer, prefix, container, start, parent_scope, want_nw_size, want_mem_size, want_extra_size):
     for m in container.members:
         sub_want_nw_size = want_nw_size and not m.is_fixed_nw_size()
-        sub_want_mem_size = m.is_extra_size()
+        sub_want_mem_size = m.is_extra_size() and want_mem_size
         sub_want_extra_size = not m.is_extra_size() and m.contains_extra_size()
 
         defs = ["size_t"]
@@ -1007,6 +1011,9 @@ def write_msg_parser(writer, message):
     msg_type = message.c_type()
     msg_sizeof = message.sizeof()
 
+    want_mem_size = (len(message.members) != 1 or message.members[0].is_fixed_nw_size()
+                         or not message.members[0].is_array())
+
     writer.newline()
     parent_scope = writer.function(function_name,
                                    "uint8_t *",
@@ -1014,7 +1021,9 @@ def write_msg_parser(writer, message):
     parent_scope.variable_def("SPICE_GNUC_UNUSED uint8_t *", "pos");
     parent_scope.variable_def("uint8_t *", "start = message_start");
     parent_scope.variable_def("uint8_t *", "data = NULL");
-    parent_scope.variable_def("size_t", "mem_size", "nw_size");
+    parent_scope.variable_def("size_t", "nw_size")
+    if want_mem_size:
+        parent_scope.variable_def("size_t", "mem_size")
     if not message.has_attr("nocopy"):
         parent_scope.variable_def("uint8_t *", "in", "end");
     num_pointers = message.get_num_pointers()
@@ -1026,7 +1035,8 @@ def write_msg_parser(writer, message):
 
     write_parser_helpers(writer)
 
-    write_validate_container(writer, None, message, "start", parent_scope, True, True, False)
+    write_validate_container(writer, None, message, "start", parent_scope, True,
+                             want_mem_size=want_mem_size, want_extra_size=False)
 
     writer.newline()
 
diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index a82df98..5b4dfdd 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -356,10 +356,12 @@ def write_message_marshaller(writer, message, is_server, private):
     for n in names:
         writer.assign("*%s_out" % n, "NULL")
 
-    src = RootMarshallingSource(None, message.c_type(), message.sizeof(), "msg")
-    src.reuse_scope = scope
+    # fix warnings about unused variables by not creating body if no members to parse
+    if any(x.is_fixed_nw_size() for x in message.members):
+        src = RootMarshallingSource(None, message.c_type(), message.sizeof(), "msg")
+        src.reuse_scope = scope
 
-    write_container_marshaller(writer, message, src)
+        write_container_marshaller(writer, message, src)
 
     writer.end_block()
     writer.newline()
commit 00f2d2782863a1ddd951e04931e72ef1dbef2cca
Author: Alon Levy <alevy at redhat.com>
Date:   Mon Jan 24 22:07:55 2011 +0200

    codegen: avoid creating out if not used (fix gcc 4.6.0 warning)

diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index cbe3599..48551c0 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -1047,9 +1047,11 @@ def write_msg_parser(writer, message):
         writer.assign("end", "data + %s" % (msg_sizeof))
         writer.assign("in", "start").newline()
 
-        dest = RootDemarshallingDestination(None, msg_type, msg_sizeof, "data")
-        dest.reuse_scope = parent_scope
-        write_container_parser(writer, message, dest)
+        # avoid defined and assigned but not used warnings of gcc 4.6.0+
+        if message.is_extra_size() or not message.is_fixed_nw_size() or message.get_fixed_nw_size() > 0:
+            dest = RootDemarshallingDestination(None, msg_type, msg_sizeof, "data")
+            dest.reuse_scope = parent_scope
+            write_container_parser(writer, message, dest)
 
         writer.newline()
         writer.statement("assert(in <= message_end)")
commit d20c90c7ef00c36bd5737dcb27da21d43e2f7c9c
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 12:28:26 2011 +0200

    client: gcc 4.6.0: two more unused variable fixes

diff --git a/client/hot_keys.cpp b/client/hot_keys.cpp
index 60b58a4..053f499 100644
--- a/client/hot_keys.cpp
+++ b/client/hot_keys.cpp
@@ -135,8 +135,6 @@ void HotKeysParser::add_hotkey(const std::string& hotkey, const CommandsMap& com
     }
     std::string command_name = hotkey.substr(0, key_start);
 
-    CommandsMap::const_iterator command = commands_map.find(command_name);
-
     if (commands_map.find(command_name) == commands_map.end()) {
         char buf[1000];
         sprintf(buf, "invalid action bname %s", command_name.c_str());
diff --git a/client/red_client.cpp b/client/red_client.cpp
index c632a21..1810593 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -464,7 +464,6 @@ void RedClient::on_disconnect()
 void RedClient::delete_channels()
 {
     Lock lock(_channels_lock);
-    Channels::iterator iter = _channels.begin();
     while (!_channels.empty()) {
         RedChannel *channel = *_channels.begin();
         _channels.pop_front();
commit 9076e2e9574531443e945e49f9acb6ccaf5458f5
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 12:27:19 2011 +0200

    client/cegui: cegui 0.6.0 gcc 4.6.0 related fix
    
    cegui doesn't include stddef required for ptrdiff_t type, we
    include it for it.

diff --git a/client/gui/resource_provider.h b/client/gui/resource_provider.h
index 1443abe..c313688 100644
--- a/client/gui/resource_provider.h
+++ b/client/gui/resource_provider.h
@@ -1,6 +1,9 @@
 #ifndef _H_RESOURCE_PROVIDER
 #define _H_RESOURCE_PROVIDER
 
+/* CEGUI 0.6 bug, CEGUITexture.h doesn't include this, we need to */
+#include <cstddef>
+
 #include "CEGUIDefaultResourceProvider.h"
 
 class CEGUIResourceProvider: public CEGUI::ResourceProvider {
diff --git a/client/gui/softrenderer.h b/client/gui/softrenderer.h
index 9fc1a29..f5155ad 100644
--- a/client/gui/softrenderer.h
+++ b/client/gui/softrenderer.h
@@ -4,6 +4,8 @@
 #include <stdint.h>
 #include <list>
 #include <set>
+/* CEGUI 0.6 bug, CEGUITexture.h doesn't include this, we need to */
+#include <cstddef>
 
 #include "CEGUIRenderer.h"
 #include "CEGUIColourRect.h"
diff --git a/client/gui/softtexture.h b/client/gui/softtexture.h
index 37617f2..788795f 100644
--- a/client/gui/softtexture.h
+++ b/client/gui/softtexture.h
@@ -3,6 +3,9 @@
 #define _softtexture_h_
 
 #include <stdint.h>
+/* CEGUI 0.6 bug, CEGUITexture.h doesn't include this, we need to */
+#include <cstddef>
+
 #include "CEGUIBase.h"
 #include "CEGUITexture.h"
 
commit 6fb222e4f3a1cd767ec0b32c51fae94313b29fb1
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 12:26:44 2011 +0200

    client/glz_decoder.cpp: gcc 4.6.0 unused fixes

diff --git a/client/glz_decoder.cpp b/client/glz_decoder.cpp
index a71b514..c5ccb95 100644
--- a/client/glz_decoder.cpp
+++ b/client/glz_decoder.cpp
@@ -234,7 +234,6 @@ const decode_function DECODE_TO_SAME[] = {
 
 void GlzDecoder::decode(uint8_t *data, SpicePalette *palette, void *opaque_usr_info)
 {
-    int out_size;
     DecodedImageWinId image_window_id;
     GlzDecodedImage *decoded_image;
     size_t n_in_bytes_decoded;
@@ -247,7 +246,6 @@ void GlzDecoder::decode(uint8_t *data, SpicePalette *palette, void *opaque_usr_i
     decode_header();
 
 #ifdef GLZ_DECODE_TO_RGB32
-    out_size = _image.gross_pixels << 2;
     bytes_per_pixel = 4;
 
     if (_image.type == LZ_IMAGE_TYPE_RGBA) {
@@ -259,9 +257,6 @@ void GlzDecoder::decode(uint8_t *data, SpicePalette *palette, void *opaque_usr_i
 #else
     if (IS_IMAGE_TYPE_PLT[_image.type]) {
         GLZ_ASSERT(_debug_calls, !(_image.gross_pixels % PLT_PIXELS_PER_BYTE[_image.type]));
-        out_size = _image.gross_pixels / PLT_PIXELS_PER_BYTE[_image.type];
-    } else {
-        out_size = _image.gross_pixels * RGB_BYTES_PER_PIXEL[_image.type];
     }
     bytes_per_pixel = RGB_BYTES_PER_PIXEL[_image.type];
     decoded_type = _image.type;
commit f899034fd2851f3f1fee4d57cfbe15d596fcc186
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 12:26:22 2011 +0200

    client/display_channel: gcc 4.6.0 unused fixes

diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 5717834..94bfe6b 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -880,15 +880,16 @@ void DisplayChannel::set_capture_mode(bool on)
 
 void DisplayChannel::update_interrupt()
 {
+#ifdef USE_OGL
     Canvas *canvas;
+#endif
 
     if (!surfaces_mngr.is_present_canvas(0) || !screen()) {
         return;
     }
 
-    canvas = surfaces_mngr.get_canvas(0);
-
 #ifdef USE_OGL
+    canvas = surfaces_mngr.get_canvas(0);
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->pre_gl_copy();
     }
@@ -1404,7 +1405,9 @@ void DisplayChannel::handle_stream_destroy_all(RedPeer::InMessage* message)
 
 void DisplayChannel::create_primary_surface(int width, int height, uint32_t format)
 {
+#ifdef USE_OGL
    Canvas *canvas;
+#endif
    _mark = false;
     attach_to_screen(get_client().get_application(), get_id());
     clear_area();
@@ -1421,9 +1424,9 @@ void DisplayChannel::create_primary_surface(int width, int height, uint32_t form
     _y_res = height;
     _format = format;
 
+#ifdef USE_OGL
     canvas = surfaces_mngr.get_canvas(0);
 
-#ifdef USE_OGL
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->touch_context();
         screen()->set_update_interrupt_trigger(&_interrupt_update);
@@ -1434,8 +1437,9 @@ void DisplayChannel::create_primary_surface(int width, int height, uint32_t form
 
 void DisplayChannel::create_surface(int surface_id, int width, int height, uint32_t format)
 {
-   Canvas *canvas;
-
+#ifdef USE_OGL
+    Canvas *canvas;
+#endif
     AutoRef<CreateSurfaceEvent> event(new CreateSurfaceEvent(*this, surface_id, width, height,
                                                              format));
     get_client().push_event(*event);
@@ -1444,9 +1448,11 @@ void DisplayChannel::create_surface(int surface_id, int width, int height, uint3
         THROW("Create surface failed");
     }
 
+#ifdef USE_OGL
+    Canvas *canvas;
+
     canvas = surfaces_mngr.get_canvas(surface_id);
 
-#ifdef USE_OGL
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->touch_context();
     }
commit e7cf427cb983e6d4e74edc461ae0aceba26b9fa4
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 00:38:16 2011 +0200

    common/sw_canvas: remove unused error val
    
    This is the only unused var change I'll want to revisit eventually,
    I'm submitting anyway since it doesn't change current behavior. I'm
    talking about ignoring the return value from canvas creation. Adding
    a print is possible but I didn't test (may be too verbose, also
    preferable to be a debug print if so, and we don't have that option
    in the code atm - probably an environment variable will do, or adding
    some spice_server_set_logging_level api, maybe even
    spice_server_set_logging_fd?)

diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index 37083df..f17bc58 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -1180,7 +1180,6 @@ static SpiceCanvas *canvas_create_common(pixman_image_t *image,
                            )
 {
     SwCanvas *canvas;
-    int init_ok;
 
     if (need_init) {
         return NULL;
@@ -1189,7 +1188,7 @@ static SpiceCanvas *canvas_create_common(pixman_image_t *image,
                                   spice_surface_format_to_pixman (format));
 
     canvas = spice_new0(SwCanvas, 1);
-    init_ok = canvas_base_init(&canvas->base, &sw_canvas_ops,
+    canvas_base_init(&canvas->base, &sw_canvas_ops,
                                pixman_image_get_width (image),
                                pixman_image_get_height (image),
                                format
commit 7b08afc308360346257612882ab593fcd2dfaa38
Author: Alon Levy <alevy at redhat.com>
Date:   Tue Jan 25 00:37:45 2011 +0200

    common/canvas_base.c: remove unused variables

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 3b0f801..796bda3 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -647,14 +647,12 @@ static pixman_image_t *canvas_bitmap_to_surface(CanvasBase *canvas, SpiceBitmap*
                                                 SpicePalette *palette, int want_original)
 {
     uint8_t* src;
-    int src_stride;
     pixman_image_t *image;
     pixman_format_code_t format;
 
     spice_chunks_linearize(bitmap->data);
 
     src = bitmap->data->chunk[0].data;
-    src_stride = bitmap->stride;
 
     if (want_original) {
         format = spice_bitmap_format_to_pixman(bitmap->format, canvas->format);
@@ -2528,11 +2526,6 @@ static void canvas_draw_blend(SpiceCanvas *spice_canvas, SpiceRect *bbox, SpiceC
                                                                bbox->top - blend->src_area.top,
                                                                rop);
         } else {
-            double sx, sy;
-    
-            sx = (double)(blend->src_area.right - blend->src_area.left) / (bbox->right - bbox->left);
-            sy = (double)(blend->src_area.bottom - blend->src_area.top) / (bbox->bottom - bbox->top);
-    
             if (rop == SPICE_ROP_COPY) {
                 spice_canvas->ops->scale_image_from_surface(spice_canvas, &dest_region,
                                                             surface_canvas,
@@ -2574,11 +2567,6 @@ static void canvas_draw_blend(SpiceCanvas *spice_canvas, SpiceRect *bbox, SpiceC
                                                   bbox->top - blend->src_area.top,
                                                   rop);
         } else {
-            double sx, sy;
-    
-            sx = (double)(blend->src_area.right - blend->src_area.left) / (bbox->right - bbox->left);
-            sy = (double)(blend->src_area.bottom - blend->src_area.top) / (bbox->bottom - bbox->top);
-    
             if (rop == SPICE_ROP_COPY) {
                 spice_canvas->ops->scale_image(spice_canvas, &dest_region,
                                                src_image,
commit 46c70521d55ca649d94dd999986a6a4e91b15923
Author: Alon Levy <alevy at redhat.com>
Date:   Mon Jan 24 18:17:34 2011 +0200

    client/server: warning fixes (gcc 4.6.0)
    
    gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
    few fixes tend to that. Mostly harmless.

diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 334a74f..4877798 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -3050,8 +3050,8 @@ void Platform::init()
 {
 #ifdef USE_OGL
     int err, ev;
-#endif // USE_OGL
     int threads_enable;
+#endif // USE_OGL
     int major, minor;
     Bool pixmaps;
 
@@ -3059,8 +3059,11 @@ void Platform::init()
 
     setlocale(LC_ALL, "");
 
+#ifdef USE_OGL
     threads_enable = XInitThreads();
-
+#else
+    XInitThreads();
+#endif
 
     if (!(x_display = XOpenDisplay(NULL))) {
         THROW("open X display failed");
diff --git a/server/jpeg_encoder.c b/server/jpeg_encoder.c
index 95cf240..44dad86 100644
--- a/server/jpeg_encoder.c
+++ b/server/jpeg_encoder.c
@@ -174,10 +174,9 @@ static void do_jpeg_encode(JpegEncoder *jpeg, uint8_t *lines, unsigned int num_l
 {    
     uint8_t *lines_end;
     uint8_t *RGB24_line;
-    int stride, width, height;
+    int stride, width;
     JSAMPROW row_pointer[1];
     width = jpeg->cur_image.width;
-    height = jpeg->cur_image.height;
     stride = jpeg->cur_image.stride;
 
     if (jpeg->cur_image.type != JPEG_IMAGE_TYPE_RGB24) {
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c
index 48b6c40..380765d 100644
--- a/server/red_parse_qxl.c
+++ b/server/red_parse_qxl.c
@@ -236,7 +236,7 @@ static SpiceClipRects *red_get_clip_rects(RedMemSlotInfo *slots, int group_id,
     RedDataChunk chunks;
     QXLClipRects *qxl;
     SpiceClipRects *red;
-    QXLRect *start, *end;
+    QXLRect *start;
     uint8_t *data;
     bool free_data;
     size_t size;
@@ -254,7 +254,6 @@ static SpiceClipRects *red_get_clip_rects(RedMemSlotInfo *slots, int group_id,
     red->num_rects = qxl->num_rects;
 
     start = (QXLRect*)data;
-    end = (QXLRect*)(data + size);
     for (i = 0; i < red->num_rects; i++) {
         red_get_rect_ptr(red->rects + i, start++);
     }
diff --git a/server/red_worker.c b/server/red_worker.c
index dc7bc9e..f899ff2 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -4512,7 +4512,6 @@ static void red_add_surface_image(RedWorker *worker, int surface_id)
 {
     SpiceRect area;
     RedSurface *surface;
-    ImageItem *item;
 
     surface = &worker->surfaces[surface_id];
 
@@ -4526,7 +4525,7 @@ static void red_add_surface_image(RedWorker *worker, int surface_id)
 
     /* not allowing lossy compression because probably, especially if it is a primary surface,
        it combines both "picture-like" areas with areas that are more "artificial"*/
-    item = red_add_surface_area_image(worker, surface_id, &area, NULL, FALSE);
+    red_add_surface_area_image(worker, surface_id, &area, NULL, FALSE);
     display_channel_push(worker);
 }
 
@@ -4659,15 +4658,12 @@ static void red_display_reset_compress_buf(DisplayChannel *display_channel)
    in the channel (2) to the Drawable*/
 static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannel *channel, Drawable *drawable)
 {
-    RedSurface *surface;
     RedGlzDrawable *ret;
 
     if (drawable->red_glz_drawable) {
         return drawable->red_glz_drawable;
     }
 
-    surface = &channel->base.worker->surfaces[drawable->surface_id];
-
     ret = spice_new(RedGlzDrawable, 1);
 
     ret->display_channel = channel;
@@ -5921,15 +5917,11 @@ static FillBitsType fill_bits(DisplayChannel *display_channel, SpiceMarshaller *
            global dictionary (in cases of multiple monitors) */
         if (!red_compress_image(display_channel, &image, &simage->u.bitmap,
                                 drawable, can_lossy, &comp_send_data)) {
-            uint32_t y;
-            uint32_t stride;
             SpicePalette *palette;
 
             red_display_add_image_to_pixmap_cache(display_channel, simage, &image, FALSE);
 
             *bitmap = simage->u.bitmap;
-            y = bitmap->y;
-            stride = bitmap->stride;
             bitmap->flags = bitmap->flags & SPICE_BITMAP_FLAGS_TOP_DOWN;
 
             palette = bitmap->palette;
@@ -7734,11 +7726,7 @@ static inline int red_send_stream_data(DisplayChannel *display_channel, Drawable
 
 static inline void send_qxl_drawable(DisplayChannel *display_channel, Drawable *item)
 {
-    RedChannel *channel;
-
     ASSERT(display_channel);
-    channel = &display_channel->base;
-
     if (item->stream && red_send_stream_data(display_channel, item)) {
         return;
     }
diff --git a/server/reds.c b/server/reds.c
index 470a0e6..b8ac79b 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -344,6 +344,7 @@ static int reds_ssl_write(void *ctx, void *buf, size_t size)
 
     if (return_code < 0) {
         ssl_error = SSL_get_error(ssl, return_code);
+        (void)ssl_error;
     }
 
     return (return_code);
@@ -359,6 +360,7 @@ static int reds_ssl_read(void *ctx, void *buf, size_t size)
 
     if (return_code < 0) {
         ssl_error = SSL_get_error(ssl, return_code);
+        (void)ssl_error;
     }
 
     return (return_code);
@@ -376,6 +378,7 @@ static int reds_ssl_writev(void *ctx, const struct iovec *vector, int count)
         n = SSL_write(ssl, vector[i].iov_base, vector[i].iov_len);
         if (n <= 0) {
             ssl_error = SSL_get_error(ssl, n);
+            (void)ssl_error;
             if (return_code <= 0) {
                 return n;
             } else {
@@ -2508,9 +2511,7 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
 {
     SpiceCharDeviceInstance* char_device =
             SPICE_CONTAINEROF(sin, SpiceCharDeviceInstance, base);
-    SpiceCharDeviceInterface* sif;
 
-    sif = SPICE_CONTAINEROF(char_device->base.sif, SpiceCharDeviceInterface, base);
     red_printf("CHAR_DEVICE %s", char_device->subtype);
     if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
         if (vdagent) {


More information about the Spice-commits mailing list