Daniel, Here is a couple of patches that fixes deprecation warning/errors to be applied on top of your series after review. They fix compilation with mingw.
On Tue, Mar 13, 2012 at 3:46 PM, Daniel P. Berrange <berra...@redhat.com> wrote: > On Tue, Mar 13, 2012 at 03:33:46PM +0100, Hans de Goede wrote: >> Hi, >> >> On 03/13/2012 03:23 PM, Daniel P. Berrange wrote: >> >On Tue, Mar 13, 2012 at 03:00:04PM +0100, Hans de Goede wrote: >> >>Hi, >> >> >> >>Series looks good. I've a few remarks on patch 14/15 though. Also >> >>if you're enable ssp why not also add -DFORTIFY_SOURCE=2 ? >> > >> >We do actually, but not via a compile flag. Instead it uses >> >AC_DEFINE(_FORTIFY_SOURCE, 2), which causes it to appear in >> >config.h. Since every source file includes config.h, this >> >is equivalent. >> > >> >FYI, to make it easier to consume, I have pushed a revised patch >> >series to: >> > >> > https://gitorious.org/~berrange/virt-tools/berrange-spice-gtk >> > >> >> Looks good, ack series. >> >> Don't you have commit rights on spice-gtk yet? If not I think >> it is time you get them :) Marc-André, do you agree? If so >> one of us needs to file a bug here: >> https://bugs.freedesktop.org/enter_bug.cgi?product=freedesktop.org >> >> component administration Requesting Daniel to be added to the >> spice group. Daniel, what is your freedesktop.org username? > > I wish I had a fdo account. Still waiting for anyone to respond to the > request I put in weeks ago.... > > https://bugs.freedesktop.org/show_bug.cgi?id=45767 > > Regards, > Daniel > -- > |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| > |: http://libvirt.org -o- http://virt-manager.org :| > |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| > |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| > _______________________________________________ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel -- Marc-André Lureau
From 360809ac7fa66e244743aa3d14233ccfb817abd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lur...@redhat.com> Date: Wed, 14 Mar 2012 01:04:17 +0100 Subject: [PATCH spice-gtk 1/4] Remove deprecation warnings --- gtk/channel-usbredir.c | 10 ++++++++-- gtk/spice-channel-priv.h | 2 +- gtk/spice-channel.c | 22 ++++++++++++---------- gtk/spicy.c | 2 ++ gtk/usb-device-manager.c | 11 ++++++++--- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c index ddc6922..5ce5118 100644 --- a/gtk/channel-usbredir.c +++ b/gtk/channel-usbredir.c @@ -505,7 +505,12 @@ static int usbredir_write_callback(void *user_data, uint8_t *data, int count) } static void *usbredir_alloc_lock(void) { - return g_mutex_new(); + GMutex *mutex; + + mutex = g_new0(GMutex, 1); + g_mutex_init(mutex); + + return mutex; } static void usbredir_lock_lock(void *user_data) { @@ -523,7 +528,8 @@ static void usbredir_unlock_lock(void *user_data) { static void usbredir_free_lock(void *user_data) { GMutex *mutex = user_data; - g_mutex_free(mutex); + g_mutex_clear(mutex); + g_free(mutex); } /* --------------------------------------------------------------------- */ diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h index a6a36ed..482927b 100644 --- a/gtk/spice-channel-priv.h +++ b/gtk/spice-channel-priv.h @@ -101,7 +101,7 @@ struct _SpiceChannelPrivate { GQueue xmit_queue; gboolean xmit_queue_blocked; - GStaticMutex xmit_queue_lock; + GMutex xmit_queue_lock; guint xmit_queue_wakeup_id; char name[16]; diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index c154312..77b066e 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -110,7 +110,7 @@ static void spice_channel_init(SpiceChannel *channel) spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION); spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_MINI_HEADER); g_queue_init(&c->xmit_queue); - g_static_mutex_init(&c->xmit_queue_lock); + g_mutex_init(&c->xmit_queue_lock); } static void spice_channel_constructed(GObject *gobject) @@ -160,7 +160,9 @@ static void spice_channel_finalize(GObject *gobject) SPICE_DEBUG("%s: %s %p", c->name, __FUNCTION__, gobject); - g_idle_remove_by_data (gobject); + g_idle_remove_by_data(gobject); + + g_mutex_clear(&c->xmit_queue_lock); if (c->caps) g_array_free(c->caps, TRUE); @@ -665,9 +667,9 @@ static gboolean spice_channel_idle_wakeup(gpointer user_data) * 5) xmit_queue_wakeup_id now says there is a wakeup pending which is * false */ - g_static_mutex_lock(&c->xmit_queue_lock); + g_mutex_lock(&c->xmit_queue_lock); c->xmit_queue_wakeup_id = 0; - g_static_mutex_unlock(&c->xmit_queue_lock); + g_mutex_unlock(&c->xmit_queue_lock); spice_channel_wakeup(channel, FALSE); @@ -683,7 +685,7 @@ void spice_msg_out_send(SpiceMsgOut *out) g_return_if_fail(out != NULL); g_return_if_fail(out->channel != NULL); - g_static_mutex_lock(&out->channel->priv->xmit_queue_lock); + g_mutex_lock(&out->channel->priv->xmit_queue_lock); if (out->channel->priv->xmit_queue_blocked) { g_warning("message queue is blocked, dropping message"); goto end; @@ -703,7 +705,7 @@ void spice_msg_out_send(SpiceMsgOut *out) } end: - g_static_mutex_unlock(&out->channel->priv->xmit_queue_lock); + g_mutex_unlock(&out->channel->priv->xmit_queue_lock); } /* coroutine context */ @@ -1970,9 +1972,9 @@ static void spice_channel_iterate_write(SpiceChannel *channel) SpiceMsgOut *out; do { - g_static_mutex_lock(&c->xmit_queue_lock); + g_mutex_lock(&c->xmit_queue_lock); out = g_queue_pop_head(&c->xmit_queue); - g_static_mutex_unlock(&c->xmit_queue_lock); + g_mutex_unlock(&c->xmit_queue_lock); if (out) spice_channel_write_msg(channel, out); } while (out); @@ -2371,7 +2373,7 @@ static void channel_reset(SpiceChannel *channel, gboolean migrating) c->peer_msg = NULL; c->peer_pos = 0; - g_static_mutex_lock(&c->xmit_queue_lock); + g_mutex_lock(&c->xmit_queue_lock); c->xmit_queue_blocked = TRUE; /* Disallow queuing new messages */ g_queue_foreach(&c->xmit_queue, (GFunc)spice_msg_out_unref, NULL); g_queue_clear(&c->xmit_queue); @@ -2379,7 +2381,7 @@ static void channel_reset(SpiceChannel *channel, gboolean migrating) g_source_remove(c->xmit_queue_wakeup_id); c->xmit_queue_wakeup_id = 0; } - g_static_mutex_unlock(&c->xmit_queue_lock); + g_mutex_unlock(&c->xmit_queue_lock); g_array_set_size(c->remote_common_caps, 0); g_array_set_size(c->remote_caps, 0); diff --git a/gtk/spicy.c b/gtk/spicy.c index b5b6e1d..c521354 100644 --- a/gtk/spicy.c +++ b/gtk/spicy.c @@ -1690,7 +1690,9 @@ int main(int argc, char *argv[]) spice_connection *conn; gchar *conf_file, *conf; +#if !GLIB_CHECK_VERSION(2,31,18) g_thread_init(NULL); +#endif bindtextdomain(GETTEXT_PACKAGE, SPICE_GTK_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 37cc88b..de64e29 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -695,9 +695,14 @@ gboolean spice_usb_device_manager_start_event_listening( priv->event_thread = NULL; } priv->event_thread_run = TRUE; - priv->event_thread = g_thread_create( - spice_usb_device_manager_usb_ev_thread, - self, TRUE, err); +#if GLIB_CHECK_VERSION(2,31,19) + priv->event_thread = g_thread_new("usb_ev_thread", + spice_usb_device_manager_usb_ev_thread, + self); +#else + priv->event_thread = g_thread_create(spice_usb_device_manager_usb_ev_thread, + self, TRUE, err); +#endif return priv->event_thread != NULL; } -- 1.7.7.6
From f569bcde37d771a7bfd1b0190bd7b486c5e1e10d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lur...@redhat.com> Date: Wed, 14 Mar 2012 01:16:44 +0100 Subject: [PATCH spice-gtk 2/4] Fix -Werror=format with mingw spice-util.c:88:28: error: unknown conversion type character 'h' in format [-Werror=format] --- gtk/spice-util.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk/spice-util.c b/gtk/spice-util.c index 6092a80..3f98d44 100644 --- a/gtk/spice-util.c +++ b/gtk/spice-util.c @@ -20,6 +20,7 @@ # include "config.h" #endif #include <glib-object.h> +#include <stdio.h> #include "spice-util-priv.h" #include "spice-util.h" #include "spice-util-priv.h" @@ -81,11 +82,15 @@ gboolean spice_strv_contains(const GStrv strv, const gchar *str) G_GNUC_INTERNAL gchar* spice_uuid_to_string(const guint8 uuid[16]) { - return g_strdup_printf(UUID_FMT, uuid[0], uuid[1], - uuid[2], uuid[3], uuid[4], uuid[5], - uuid[6], uuid[7], uuid[8], uuid[9], - uuid[10], uuid[11], uuid[12], uuid[13], - uuid[14], uuid[15]); + gchar* uuidstr = g_malloc0(64); + + snprintf(uuidstr, 64, UUID_FMT, uuid[0], uuid[1], + uuid[2], uuid[3], uuid[4], uuid[5], + uuid[6], uuid[7], uuid[8], uuid[9], + uuid[10], uuid[11], uuid[12], uuid[13], + uuid[14], uuid[15]); + + return uuidstr; } typedef struct { -- 1.7.7.6
From 4a8d79b0876e9aa4274d94082041177dd07f0590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lur...@redhat.com> Date: Wed, 14 Mar 2012 01:22:46 +0100 Subject: [PATCH spice-gtk 3/4] Fix 'libintl_printf' is an unrecognized format function ../common/lz.h:18:5: error: 'libintl_printf' is an unrecognized format function type [-Werror=format] --- gtk/usb-device-manager.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index de64e29..29e9b4c 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -22,7 +22,6 @@ #include "config.h" #include <glib-object.h> -#include <glib/gi18n.h> #include "glib-compat.h" @@ -40,6 +39,8 @@ #include "spice-marshal.h" #include "usb-device-manager-priv.h" +#include <glib/gi18n.h> + /** * SECTION:usb-device-manager * @short_description: USB device management -- 1.7.7.6
From 06c2bc71e8cc51f19119ac25afdd08e79cc69fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lur...@redhat.com> Date: Wed, 14 Mar 2012 01:30:24 +0100 Subject: [PATCH spice-gtk 4/4] Use GTK_DISABLE_DEPRECATED to avoid inclusion of problematic headers /usr/i686-w64-mingw32/sys-root/mingw/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration isn't a prototype [-Werror=strict-prototypes] --- gtk/Makefile.am | 1 + gtk/spicy.c | 8 ++++++++ gtk/usb-device-widget.c | 10 ++++++++++ gtk/usb-device-widget.h | 8 ++++++++ 4 files changed, 27 insertions(+), 0 deletions(-) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 2f7d4ae..4b749d0 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -58,6 +58,7 @@ EXTRA_DIST += $(KEYMAPS) SPICE_COMMON_CPPFLAGS = \ -DG_LOG_DOMAIN=\"GSpice\" \ -DSPICE_NO_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ -DSW_CANVAS_CACHE \ -DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\" \ -DPNP_IDS=\""$(PNP_IDS)"\"\ diff --git a/gtk/spicy.c b/gtk/spicy.c index c521354..2261488 100644 --- a/gtk/spicy.c +++ b/gtk/spicy.c @@ -1191,7 +1191,11 @@ static spice_window *create_spice_window(spice_connection *conn, int id, SpiceCh G_CALLBACK(grab_keys_pressed_cb), win); /* status line */ +#if GTK_CHECK_VERSION(3,0,0) + win->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1); +#else win->statusbar = gtk_hbox_new(FALSE, 1); +#endif win->status = gtk_label_new("status line"); gtk_misc_set_alignment(GTK_MISC(win->status), 0, 0.5); @@ -1211,7 +1215,11 @@ static spice_window *create_spice_window(spice_connection *conn, int id, SpiceCh } /* Make a vbox and put stuff in */ +#if GTK_CHECK_VERSION(3,0,0) + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1); +#else vbox = gtk_vbox_new(FALSE, 1); +#endif gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); gtk_container_add(GTK_CONTAINER(win->toplevel), vbox); gtk_box_pack_start(GTK_BOX(vbox), win->menubar, FALSE, FALSE, 0); diff --git a/gtk/usb-device-widget.c b/gtk/usb-device-widget.c index faaeace..8501ab4 100644 --- a/gtk/usb-device-widget.c +++ b/gtk/usb-device-widget.c @@ -76,7 +76,12 @@ struct _SpiceUsbDeviceWidgetPrivate { static guint signals[LAST_SIGNAL] = { 0, }; +#if GTK_CHECK_VERSION(3,0,0) +G_DEFINE_TYPE(SpiceUsbDeviceWidget, spice_usb_device_widget, GTK_TYPE_BOX); +#else G_DEFINE_TYPE(SpiceUsbDeviceWidget, spice_usb_device_widget, GTK_TYPE_VBOX); +#endif + static void spice_usb_device_widget_get_property(GObject *gobject, guint prop_id, @@ -145,7 +150,11 @@ spice_usb_device_widget_show_info_bar(SpiceUsbDeviceWidget *self, gtk_info_bar_set_message_type(GTK_INFO_BAR(info_bar), message_type); content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar)); +#if GTK_CHECK_VERSION(3,0,0) + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); +#else hbox = gtk_hbox_new(FALSE, 12); +#endif gtk_container_add(GTK_CONTAINER(content_area), hbox); widget = gtk_image_new_from_stock(stock_icon_id, @@ -320,6 +329,7 @@ GtkWidget *spice_usb_device_widget_new(SpiceSession *session, const gchar *device_format_string) { return g_object_new(SPICE_TYPE_USB_DEVICE_WIDGET, + "orientation", GTK_ORIENTATION_VERTICAL, "session", session, "device-format-string", device_format_string, "spacing", 6, diff --git a/gtk/usb-device-widget.h b/gtk/usb-device-widget.h index 27ec795..71e7911 100644 --- a/gtk/usb-device-widget.h +++ b/gtk/usb-device-widget.h @@ -45,7 +45,11 @@ typedef struct _SpiceUsbDeviceWidgetPrivate SpiceUsbDeviceWidgetPrivate; */ struct _SpiceUsbDeviceWidget { +#if GTK_CHECK_VERSION(3,0,0) + GtkBox parent; +#else GtkVBox parent; +#endif /*< private >*/ SpiceUsbDeviceWidgetPrivate *priv; @@ -61,7 +65,11 @@ struct _SpiceUsbDeviceWidget */ struct _SpiceUsbDeviceWidgetClass { +#if GTK_CHECK_VERSION(3,0,0) + GtkBoxClass parent_class; +#else GtkVBoxClass parent_class; +#endif /* signals */ void (*connect_failed) (SpiceUsbDeviceWidget *widget, -- 1.7.7.6
_______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel