[Spice-commits] 20 commits - common/canvas_base.c common/lines.c common/lz.h common/macros.h common/marshaller.c common/pixman_utils.c common/quic.c common/quic_family_tmpl.c common/quic.h common/rop3.c common/rop3.h common/ssl_verify.c common/sw_canvas.c common/sw_canvas.h configure.ac gtk/channel-display.c gtk/channel-main.c gtk/channel-main.h gtk/channel-record.c gtk/channel-usbredir.c gtk/display gtk/Makefile.am gtk/snappy.c gtk/spice-audio.c gtk/spice-audio.h gtk/spice-channel.c gtk/spice-channel-priv.h gtk/spice-client.c gtk/spice-client-glib-usb-acl-helper.c gtk/spice-util.c gtk/spice-util.h gtk/spice-util-priv.h gtk/spice-widget.c gtk/spice-widget.h gtk/spicy.c gtk/usb-acl-helper.c gtk/usb-acl-helper.h gtk/usb-device-manager.c gtk/usb-device-widget.c gtk/usb-device-widget.h m4/manywarnings.m4 m4/spice-compile-warnings.m4 m4/warnings.m4 Makefile.am

Marc-André Lureau elmarco at kemper.freedesktop.org
Wed Mar 14 05:30:39 PDT 2012


 Makefile.am                            |    2 
 common/canvas_base.c                   |    8 -
 common/lines.c                         |    2 
 common/lz.h                            |    7 -
 common/macros.h                        |   30 +++++
 common/marshaller.c                    |    2 
 common/pixman_utils.c                  |    4 
 common/quic.c                          |    6 -
 common/quic.h                          |    9 -
 common/quic_family_tmpl.c              |    4 
 common/rop3.c                          |    8 -
 common/rop3.h                          |    2 
 common/ssl_verify.c                    |   19 +--
 common/sw_canvas.c                     |    2 
 common/sw_canvas.h                     |    2 
 configure.ac                           |   70 ------------
 gtk/Makefile.am                        |    6 -
 gtk/channel-display.c                  |    5 
 gtk/channel-main.c                     |    6 -
 gtk/channel-main.h                     |    4 
 gtk/channel-record.c                   |    3 
 gtk/channel-usbredir.c                 |   10 +
 gtk/display/gnome-rr.c                 |    2 
 gtk/snappy.c                           |    2 
 gtk/spice-audio.c                      |    1 
 gtk/spice-audio.h                      |    1 
 gtk/spice-channel-priv.h               |    2 
 gtk/spice-channel.c                    |   27 ++--
 gtk/spice-client-glib-usb-acl-helper.c |    2 
 gtk/spice-client.c                     |    2 
 gtk/spice-util-priv.h                  |    2 
 gtk/spice-util.c                       |    1 
 gtk/spice-util.h                       |    7 +
 gtk/spice-widget.c                     |    2 
 gtk/spice-widget.h                     |    2 
 gtk/spicy.c                            |   27 +++-
 gtk/usb-acl-helper.c                   |    2 
 gtk/usb-acl-helper.h                   |    3 
 gtk/usb-device-manager.c               |   14 +-
 gtk/usb-device-widget.c                |   10 +
 gtk/usb-device-widget.h                |    8 +
 m4/manywarnings.m4                     |  184 +++++++++++++++++++++++++++++++++
 m4/spice-compile-warnings.m4           |  144 +++++++++++++++++++++++++
 m4/warnings.m4                         |   37 ++++++
 44 files changed, 537 insertions(+), 156 deletions(-)

New commits:
commit a8a11db952a8c47f61656fa562052a6af89c3642
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 14 01:30:24 2012 +0100

    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]

diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index efb89f3..f4869b9 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,
commit 70be0760271f3c7c84a1dba4a69278aae25eba9e
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 14 01:22:46 2012 +0100

    Fix 'libintl_printf' is an unrecognized format function
    
    ../common/lz.h:18:5: error: 'libintl_printf' is an unrecognized format function type [-Werror=format]

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
commit 8bd1299551c533308cd835a7fc117ac18d5928ba
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Mar 14 01:04:17 2012 +0100

    Remove deprecation warnings

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;
 }
 
commit 04e8187a81e806cf6c2ff820cf9838fa96869fb7
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Wed Mar 14 12:24:35 2012 +0000

    Disable -Wwrite-strings for Python binding
    
    The code generator for the python binding generates code which
    throws away const-ness on strings. Disable the -Wwrite-strings
    warning to avoid failing on this auto-generated code.

diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 2f7d4ae..efb89f3 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -543,7 +543,7 @@ if WITH_PYTHON
 pyexec_LTLIBRARIES = SpiceClientGtk.la
 
 SpiceClientGtk_la_LIBADD = libspice-client-gtk-2.0.la libspice-client-glib-2.0.la $(PYGTK_LIBS)
-SpiceClientGtk_la_CFLAGS = $(GTK_CFLAGS) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS)
+SpiceClientGtk_la_CFLAGS = $(GTK_CFLAGS) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS) $(WARN_PYFLAGS)
 SpiceClientGtk_la_LDFLAGS = -module -avoid-version -fPIC
 SpiceClientGtk_la_SOURCES = spice-client-gtk-module.c
 nodist_SpiceClientGtk_la_SOURCES = spice-client-gtk-module.defs.c
diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
index 214449f..b98e2ef 100644
--- a/m4/spice-compile-warnings.m4
+++ b/m4/spice-compile-warnings.m4
@@ -137,4 +137,8 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
     WARN_LDFLAGS=$WARN_CFLAGS
     AC_SUBST([WARN_CFLAGS])
     AC_SUBST([WARN_LDFLAGS])
+
+    gl_WARN_ADD([-Wno-write-strings])
+    WARN_PYFLAGS=$WARN_CFLAGS
+    AC_SUBST([WARN_PYFLAGS])
 ])
commit 69406f7330d9fd0b36a2aefd479636cc8738127c
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Tue Mar 13 18:10:23 2012 +0000

    Replace %02hhx with %02x in UUID format
    
    Use of 'hh' in the UUID format string is not required. Furthermore
    it causes errors on Mingw32, where the 'hh' modifier is not supported

diff --git a/gtk/spice-util-priv.h b/gtk/spice-util-priv.h
index ee70f64..4d52100 100644
--- a/gtk/spice-util-priv.h
+++ b/gtk/spice-util-priv.h
@@ -22,7 +22,7 @@
 
 G_BEGIN_DECLS
 
-#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
+#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
 
 gboolean spice_strv_contains(const GStrv strv, const gchar *str);
 gchar* spice_uuid_to_string(const guint8 uuid[16]);
commit 8ef8fd7a2693c9530b5f1f9c0c0f238f1d775d25
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 13:00:11 2012 +0000

    Import GNULIB's GCC warning macros
    
    GNULIB has a helpful module 'manywarnings' which makes it easy
    to turn on every single GCC warning. The general goal is that
    every possible GCC warning should be enabled, except for certain
    blacklisted warnings.
    
    This imports the GNULIB m4 macros, and updates configure.ac to
    use this new capability. As & when new GCC warnings are created,
    the 'manywarnings.m4' can be refreshed from upstream GNULIB
    
    * m4/manywarnings.m4, m4/warnings.m4: GNULIB warning macros
    * configure.ac: Remove custom compiler warning checks
    * m4/spice-compile-warnings.m4: Decide what GCC warnings to enable

diff --git a/configure.ac b/configure.ac
index 13f33e6..2d062b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -572,76 +572,8 @@ AM_CONDITIONAL(WITH_PYTHON, [test "$WITH_PYTHON" = "yes"])
 dnl ===========================================================================
 dnl check compiler flags
 
-AC_DEFUN([SPICE_CC_TRY_FLAG], [
-  AC_MSG_CHECKING([whether $CC supports $1])
+SPICE_COMPILE_WARNINGS
 
-  spice_save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $1"
-
-  AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ])], [spice_cc_flag=yes], [spice_cc_flag=no])
-  CFLAGS="$spice_save_CFLAGS"
-
-  if test "x$spice_cc_flag" = "xyes"; then
-    ifelse([$2], , :, [$2])
-  else
-    ifelse([$3], , :, [$3])
-  fi
-  AC_MSG_RESULT([$spice_cc_flag])
-])
-
-
-dnl Use lots of warning flags with with gcc and compatible compilers
-
-dnl Note: if you change the following variable, the cache is automatically
-dnl skipped and all flags rechecked.  So there's no need to do anything
-dnl else.  If for any reason you need to force a recheck, just change
-dnl MAYBE_WARN in an ignorable way (like adding whitespace)
-
-dnl MAYBE_WARN="-Wall -Wno-sign-compare -Werror -Wno-deprecated-declarations"
-
-MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations"
-
-AC_ARG_ENABLE([werror],
-  AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]),
-  [set_werror="$enableval"],
-  [if test -d $srcdir/.git; then
-     is_git_version=true
-     set_werror=yes
-   else
-     set_werror=no
-   fi])
-
-# invalidate cached value if MAYBE_WARN has changed
-if test "x$spice_cv_warn_maybe" != "x$MAYBE_WARN"; then
-	unset spice_cv_warn_cflags
-fi
-AC_CACHE_CHECK([for supported warning flags], spice_cv_warn_cflags, [
-	echo
-	WARN_CFLAGS=""
-
-	# Some warning options are not supported by all versions of
-	# gcc, so test all desired options against the current
-	# compiler.
-	#
-	# Note that there are some order dependencies
-	# here. Specifically, an option that disables a warning will
-	# have no net effect if a later option then enables that
-	# warnings, (perhaps implicitly). So we put some grouped
-	# options (-Wall and -Wextra) up front and the -Wno options
-	# last.
-
-	for W in $MAYBE_WARN; do
-		SPICE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
-	done
-	if test "$set_werror" != "no"; then
-		SPICE_CC_TRY_FLAG(["-Werror"], [WARN_CFLAGS="$WARN_CFLAGS -Werror"])
-	fi
-
-	spice_cv_warn_cflags=$WARN_CFLAGS
-	spice_cv_warn_maybe=$MAYBE_WARN
-
-	AC_MSG_CHECKING([which warning flags were supported])])
-WARN_CFLAGS="$spice_cv_warn_cflags"
 SPICE_CFLAGS="$SPICE_CFLAGS $WARN_CFLAGS"
 
 AC_SUBST(SPICE_CFLAGS)
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
new file mode 100644
index 0000000..fd0e372
--- /dev/null
+++ b/m4/manywarnings.m4
@@ -0,0 +1,184 @@
+# manywarnings.m4 serial 3
+dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR)
+# --------------------------------------------------
+# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR.
+# Elements separated by whitespace.  In set logic terms, the function
+# does OUTVAR = LISTVAR \ REMOVEVAR.
+AC_DEFUN([gl_MANYWARN_COMPLEMENT],
+[
+  gl_warn_set=
+  set x $2; shift
+  for gl_warn_item
+  do
+    case " $3 " in
+      *" $gl_warn_item "*)
+        ;;
+      *)
+        gl_warn_set="$gl_warn_set $gl_warn_item"
+        ;;
+    esac
+  done
+  $1=$gl_warn_set
+])
+
+# gl_MANYWARN_ALL_GCC(VARIABLE)
+# -----------------------------
+# Add all documented GCC warning parameters to variable VARIABLE.
+# Note that you need to test them using gl_WARN_ADD if you want to
+# make sure your gcc understands it.
+AC_DEFUN([gl_MANYWARN_ALL_GCC],
+[
+  dnl First, check if -Wno-missing-field-initializers is needed.
+  dnl -Wmissing-field-initializers is implied by -W, but that issues
+  dnl warnings with GCC version before 4.7, for the common idiom
+  dnl of initializing types on the stack to zero, using { 0, }
+  AC_REQUIRE([AC_PROG_CC])
+  if test -n "$GCC"; then
+
+    dnl First, check -W -Werror -Wno-missing-field-initializers is supported
+    dnl with the current $CC $CFLAGS $CPPFLAGS.
+    AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
+    AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[]], [[]])],
+        [gl_cv_cc_nomfi_supported=yes],
+        [gl_cv_cc_nomfi_supported=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
+
+    if test "$gl_cv_cc_nomfi_supported" = yes; then
+      dnl Now check whether -Wno-missing-field-initializers is needed
+      dnl for the { 0, } construct.
+      AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
+      AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
+        gl_save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS -W -Werror"
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[void f (void)
+               {
+                 typedef struct { int a; int b; } s_t;
+                 s_t s1 = { 0, };
+               }
+             ]],
+             [[]])],
+          [gl_cv_cc_nomfi_needed=no],
+          [gl_cv_cc_nomfi_needed=yes])
+        CFLAGS="$gl_save_CFLAGS"
+      ])
+      AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+    fi
+  fi
+
+  gl_manywarn_set=
+  for gl_manywarn_item in \
+    -Wall \
+    -W \
+    -Wformat-y2k \
+    -Wformat-nonliteral \
+    -Wformat-security \
+    -Winit-self \
+    -Wmissing-include-dirs \
+    -Wswitch-default \
+    -Wswitch-enum \
+    -Wunused \
+    -Wunknown-pragmas \
+    -Wstrict-aliasing \
+    -Wstrict-overflow \
+    -Wsystem-headers \
+    -Wfloat-equal \
+    -Wtraditional \
+    -Wtraditional-conversion \
+    -Wdeclaration-after-statement \
+    -Wundef \
+    -Wshadow \
+    -Wunsafe-loop-optimizations \
+    -Wpointer-arith \
+    -Wbad-function-cast \
+    -Wc++-compat \
+    -Wcast-qual \
+    -Wcast-align \
+    -Wwrite-strings \
+    -Wconversion \
+    -Wsign-conversion \
+    -Wlogical-op \
+    -Waggregate-return \
+    -Wstrict-prototypes \
+    -Wold-style-definition \
+    -Wmissing-prototypes \
+    -Wmissing-declarations \
+    -Wmissing-noreturn \
+    -Wmissing-format-attribute \
+    -Wpacked \
+    -Wpadded \
+    -Wredundant-decls \
+    -Wnested-externs \
+    -Wunreachable-code \
+    -Winline \
+    -Winvalid-pch \
+    -Wlong-long \
+    -Wvla \
+    -Wvolatile-register-var \
+    -Wdisabled-optimization \
+    -Wstack-protector \
+    -Woverlength-strings \
+    -Wbuiltin-macro-redefined \
+    -Wmudflap \
+    -Wpacked-bitfield-compat \
+    -Wsync-nand \
+    ; do
+    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+  done
+  # The following are not documented in the manual but are included in
+  # output from gcc --help=warnings.
+  for gl_manywarn_item in \
+    -Wattributes \
+    -Wcoverage-mismatch \
+    -Wmultichar \
+    -Wunused-macros \
+    ; do
+    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+  done
+  # More warnings from gcc 4.6.2 --help=warnings.
+  for gl_manywarn_item in \
+    -Wabi \
+    -Wcpp \
+    -Wdeprecated \
+    -Wdeprecated-declarations \
+    -Wdiv-by-zero \
+    -Wdouble-promotion \
+    -Wendif-labels \
+    -Wextra \
+    -Wformat-contains-nul \
+    -Wformat-extra-args \
+    -Wformat-zero-length \
+    -Wformat=2 \
+    -Wmultichar \
+    -Wnormalized=nfc \
+    -Woverflow \
+    -Wpointer-to-int-cast \
+    -Wpragmas \
+    -Wsuggest-attribute=const \
+    -Wsuggest-attribute=noreturn \
+    -Wsuggest-attribute=pure \
+    -Wtrampolines \
+    ; do
+    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+  done
+
+  # Disable the missing-field-initializers warning if needed
+  if test "$gl_cv_cc_nomfi_needed" = yes; then
+    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+  fi
+
+  $1=$gl_manywarn_set
+])
diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
new file mode 100644
index 0000000..214449f
--- /dev/null
+++ b/m4/spice-compile-warnings.m4
@@ -0,0 +1,140 @@
+dnl
+dnl Enable all known GCC compiler warnings, except for those
+dnl we can't yet cope with
+dnl
+AC_DEFUN([SPICE_COMPILE_WARNINGS],[
+    dnl ******************************
+    dnl More compiler warnings
+    dnl ******************************
+
+    AC_ARG_ENABLE([werror],
+                  AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]),
+                  [set_werror="$enableval"],
+                  [if test -d $srcdir/.git; then
+                     is_git_version=true
+                     set_werror=yes
+                   else
+                     set_werror=no
+                   fi])
+
+    # List of warnings that are not relevant / wanted
+
+    # Don't care about C++ compiler compat
+    dontwarn="$dontwarn -Wc++-compat"
+    dontwarn="$dontwarn -Wabi"
+    dontwarn="$dontwarn -Wdeprecated"
+    # Don't care about ancient C standard compat
+    dontwarn="$dontwarn -Wtraditional"
+    # Don't care about ancient C standard compat
+    dontwarn="$dontwarn -Wtraditional-conversion"
+    # Ignore warnings in /usr/include
+    dontwarn="$dontwarn -Wsystem-headers"
+    # Happy for compiler to add struct padding
+    dontwarn="$dontwarn -Wpadded"
+    # GCC very confused with -O2
+    dontwarn="$dontwarn -Wunreachable-code"
+
+
+    dontwarn="$dontwarn -Wconversion"
+    dontwarn="$dontwarn -Wsign-conversion"
+    dontwarn="$dontwarn -Wvla"
+    dontwarn="$dontwarn -Wundef"
+    dontwarn="$dontwarn -Wcast-qual"
+    dontwarn="$dontwarn -Wlong-long"
+    dontwarn="$dontwarn -Wswitch-default"
+    dontwarn="$dontwarn -Wswitch-enum"
+    dontwarn="$dontwarn -Wstrict-overflow"
+    dontwarn="$dontwarn -Wunsafe-loop-optimizations"
+    dontwarn="$dontwarn -Wformat-nonliteral"
+    dontwarn="$dontwarn -Wfloat-equal"
+    dontwarn="$dontwarn -Wdeclaration-after-statement"
+    dontwarn="$dontwarn -Wcast-qual"
+    dontwarn="$dontwarn -Wconversion"
+    dontwarn="$dontwarn -Wsign-conversion"
+    dontwarn="$dontwarn -Wpacked"
+    dontwarn="$dontwarn -Wunused-macros"
+    dontwarn="$dontwarn -Woverlength-strings"
+    dontwarn="$dontwarn -Wstack-protector"
+    dontwarn="$dontwarn -Winline"
+    dontwarn="$dontwarn -Wbad-function-cast"
+    dontwarn="$dontwarn -Wshadow"
+
+    # We want to enable thse, but need to sort out the
+    # decl mess with  gtk/generated_*.c
+    dontwarn="$dontwarn -Wmissing-prototypes"
+    dontwarn="$dontwarn -Wmissing-declarations"
+
+    # Get all possible GCC warnings
+    gl_MANYWARN_ALL_GCC([maybewarn])
+
+    # Remove the ones we don't want, blacklisted earlier
+    gl_MANYWARN_COMPLEMENT([wantwarn], [$maybewarn], [$dontwarn])
+
+    # Check for $CC support of each warning
+    for w in $wantwarn; do
+      gl_WARN_ADD([$w])
+    done
+
+    # GNULIB uses '-W' (aka -Wextra) which includes a bunch of stuff.
+    # Unfortunately, this means you can't simply use '-Wsign-compare'
+    # with gl_MANYWARN_COMPLEMENT
+    # So we have -W enabled, and then have to explicitly turn off...
+    gl_WARN_ADD([-Wno-sign-compare])
+    gl_WARN_ADD([-Wno-unused-parameter])
+    # We can't enable this due to horrible spice_usb_device_get_description
+    # signature
+    gl_WARN_ADD([-Wno-format-nonliteral])
+
+
+
+    # GNULIB expects this to be part of -Wc++-compat, but we turn
+    # that one off, so we need to manually enable this again
+    gl_WARN_ADD([-Wjump-misses-init])
+
+    # GNULIB turns on -Wformat=2 which implies -Wformat-nonliteral,
+    # so we need to manually re-exclude it.
+    gl_WARN_ADD([-Wno-format-nonliteral])
+
+    # This should be < 1024 really. pixman_utils is the blackspot
+    # preventing lower usage
+    gl_WARN_ADD([-Wframe-larger-than=9216])
+
+    # Use improved glibc headers
+    AC_DEFINE([_FORTIFY_SOURCE], [2],
+      [enable compile-time and run-time bounds-checking, and some warnings])
+
+    # Extra special flags
+    dnl -fstack-protector stuff passes gl_WARN_ADD with gcc
+    dnl on Mingw32, but fails when actually used
+    case $host in
+       *-*-linux*)
+       dnl Fedora only uses -fstack-protector, but doesn't seem to
+       dnl be great overhead in adding -fstack-protector-all instead
+       dnl gl_WARN_ADD([-fstack-protector])
+       gl_WARN_ADD([-fstack-protector-all])
+       gl_WARN_ADD([--param=ssp-buffer-size=4])
+       ;;
+    esac
+    gl_WARN_ADD([-fexceptions])
+    gl_WARN_ADD([-fasynchronous-unwind-tables])
+    gl_WARN_ADD([-fdiagnostics-show-option])
+    gl_WARN_ADD([-funit-at-a-time])
+
+    # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure
+    # fire even without -O.
+    gl_WARN_ADD([-fipa-pure-const])
+
+    # We should eventually enable this, but right now there are at
+    # least 75 functions triggering warnings.
+    gl_WARN_ADD([-Wno-suggest-attribute=pure])
+    gl_WARN_ADD([-Wno-suggest-attribute=const])
+
+    if test "$set_werror" = "yes"
+    then
+      gl_WARN_ADD([-Werror])
+    fi
+
+    WARN_LDFLAGS=$WARN_CFLAGS
+    AC_SUBST([WARN_CFLAGS])
+    AC_SUBST([WARN_LDFLAGS])
+])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
new file mode 100644
index 0000000..69d05a6
--- /dev/null
+++ b/m4/warnings.m4
@@ -0,0 +1,37 @@
+# warnings.m4 serial 5
+dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_AS_VAR_APPEND(VAR, VALUE)
+# ----------------------------
+# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it.
+m4_ifdef([AS_VAR_APPEND],
+[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])],
+[m4_define([gl_AS_VAR_APPEND],
+[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
+
+# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS])
+# ------------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it.  For example,
+# gl_WARN_ADD([-Wparentheses]).
+AC_DEFUN([gl_WARN_ADD],
+dnl FIXME: gl_Warn must be used unquoted until we can assume
+dnl autoconf 2.64 or newer.
+[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
+AC_CACHE_CHECK([whether compiler handles $1], m4_defn([gl_Warn]), [
+  gl_save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="${CPPFLAGS} $1"
+  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
+                    [AS_VAR_SET(gl_Warn, [yes])],
+                    [AS_VAR_SET(gl_Warn, [no])])
+  CPPFLAGS="$gl_save_CPPFLAGS"
+])
+AS_VAR_IF(gl_Warn, [yes],
+  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])])
+AS_VAR_POPDEF([gl_Warn])dnl
+m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
+])
commit 545f4f4f1afd0d3ffd0fc4cb81901488d9a6cb75
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Tue Mar 13 13:49:08 2012 +0000

    Avoid 'goto' jumping over variable initialization
    
    When a goto statement jumps over a variable declaration with an
    initializer, the state of that variable is undefined. Move the
    declaration further up, so that the goto doesn't jump over it.
    This lets the compiler then warn, if the goto jump results in
    use of undefined values.

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index cdc86ba..c154312 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -1629,6 +1629,7 @@ static void spice_channel_recv_link_msg(SpiceChannel *channel)
 {
     SpiceChannelPrivate *c;
     int rc, num_caps, i;
+    uint32_t *caps;
 
     g_return_if_fail(channel != NULL);
     g_return_if_fail(channel->priv != NULL);
@@ -1666,7 +1667,7 @@ static void spice_channel_recv_link_msg(SpiceChannel *channel)
     /* see original spice/client code: */
     /* g_return_if_fail(c->peer_msg + c->peer_msg->caps_offset * sizeof(uint32_t) > c->peer_msg + c->peer_hdr.size); */
 
-    uint32_t *caps = (uint32_t *)((uint8_t *)c->peer_msg + c->peer_msg->caps_offset);
+    caps = (uint32_t *)((uint8_t *)c->peer_msg + c->peer_msg->caps_offset);
 
     g_array_set_size(c->remote_common_caps, c->peer_msg->num_common_caps);
     for (i = 0; i < c->peer_msg->num_common_caps; i++, caps++) {
commit 6177224a4e56720310365de57b420a77bbaf589c
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 15:13:39 2012 +0000

    Fix no-arg functions declared () to use (void)
    
    * common/quic.h, common/rop3.h, common/sw_canvas.h: s/()/(void)/

diff --git a/common/quic.h b/common/quic.h
index 74068f3..35683d2 100644
--- a/common/quic.h
+++ b/common/quic.h
@@ -60,7 +60,7 @@ int quic_decode(QuicContext *quic, QuicImageType type, uint8_t *buf, int stride)
 QuicContext *quic_create(QuicUsrContext *usr);
 void quic_destroy(QuicContext *quic);
 
-void quic_init();
+void quic_init(void);
 
 #endif
 
diff --git a/common/rop3.h b/common/rop3.h
index 0211130..cbfa940 100644
--- a/common/rop3.h
+++ b/common/rop3.h
@@ -29,6 +29,6 @@ void do_rop3_with_pattern(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, Sp
 void do_rop3_with_color(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos,
                         uint32_t rgb);
 
-void rop3_init();
+void rop3_init(void);
 #endif
 
diff --git a/common/sw_canvas.h b/common/sw_canvas.h
index 99deac8..51e594c 100644
--- a/common/sw_canvas.h
+++ b/common/sw_canvas.h
@@ -53,6 +53,6 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format, uint
                            );
 
 
-void sw_canvas_init();
+void sw_canvas_init(void);
 
 #endif
commit 09609438e0ba41338b485eea11d746a1d6dff024
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 15:03:31 2012 +0000

    Add missing includes & make some functions static
    
    A number of functions were used without prior declaration. In
    some cases this was due to missing include files. In other cases
    the functions should have just been static.
    
    Ideally this would allow -Wmissing-declarations to be enabled, but
    the files generated by spice_codegen.py will still trip up on this.

diff --git a/common/marshaller.c b/common/marshaller.c
index 8bf3427..57ca32e 100644
--- a/common/marshaller.c
+++ b/common/marshaller.c
@@ -391,7 +391,7 @@ SpiceMarshaller *spice_marshaller_get_ptr_submarshaller(SpiceMarshaller *m, int
     return m2;
 }
 
-uint8_t *lookup_ref(MarshallerRef *ref)
+static uint8_t *lookup_ref(MarshallerRef *ref)
 {
     MarshallerItem *item;
 
diff --git a/common/quic_family_tmpl.c b/common/quic_family_tmpl.c
index 5547c4d..e07596b 100644
--- a/common/quic_family_tmpl.c
+++ b/common/quic_family_tmpl.c
@@ -53,8 +53,8 @@ static void FNAME(golomb_coding)(const BYTE n, const unsigned int l, unsigned in
     }
 }
 
-unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned int bits,
-                                    unsigned int * const codewordlen)
+static unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned int bits,
+                                           unsigned int * const codewordlen)
 {
     if (bits > VNAME(family).notGRprefixmask[l]) { /*GR*/
         const unsigned int zeroprefix = cnt_l_zeroes(bits);       /* leading zeroes in codeword */
diff --git a/common/ssl_verify.c b/common/ssl_verify.c
index 02e7a20..b19a323 100644
--- a/common/ssl_verify.c
+++ b/common/ssl_verify.c
@@ -258,7 +258,7 @@ static int verify_hostname(X509* cert, const char *hostname)
     return cn_match;
 }
 
-X509_NAME* subject_to_x509_name(const char *subject, int *nentries)
+static X509_NAME* subject_to_x509_name(const char *subject, int *nentries)
 {
     X509_NAME* in_subject;
     const char *p;
@@ -343,7 +343,7 @@ fail:
     return NULL;
 }
 
-int verify_subject(X509* cert, SpiceOpenSSLVerify* verify)
+static int verify_subject(X509* cert, SpiceOpenSSLVerify* verify)
 {
     X509_NAME *cert_subject = NULL;
     int ret;
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index d728fef..152d6a7 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -549,8 +549,8 @@ static pixman_image_t* image_get_lossless(SpiceImageCache *cache, uint64_t id)
 }
 #endif
 
-SpiceCanvas *surfaces_get(SpiceImageSurfaces *surfaces,
-                          uint32_t surface_id)
+static SpiceCanvas *surfaces_get(SpiceImageSurfaces *surfaces,
+                                 uint32_t surface_id)
 {
     SpiceDisplayChannelPrivate *c =
         SPICE_CONTAINEROF(surfaces, SpiceDisplayChannelPrivate, image_surfaces);
diff --git a/gtk/display/gnome-rr.c b/gtk/display/gnome-rr.c
index 0e02d3e..b1327bd 100644
--- a/gtk/display/gnome-rr.c
+++ b/gtk/display/gnome-rr.c
@@ -195,7 +195,7 @@ screen_info_free (ScreenInfo *info)
     g_free (info);
 }
 
-gboolean
+static gboolean
 has_similar_mode (GnomeRROutput *output, GnomeRRMode *mode)
 {
     int i;
diff --git a/gtk/spice-client.c b/gtk/spice-client.c
index 443bb69..59f2918 100644
--- a/gtk/spice-client.c
+++ b/gtk/spice-client.c
@@ -17,6 +17,8 @@
 */
 #include <glib.h>
 
+#include "spice-client.h"
+
 GQuark spice_client_error_quark(void)
 {
     return g_quark_from_static_string("spice-client-error-quark");
diff --git a/gtk/spice-util.c b/gtk/spice-util.c
index 65454ef..6092a80 100644
--- a/gtk/spice-util.c
+++ b/gtk/spice-util.c
@@ -22,6 +22,7 @@
 #include <glib-object.h>
 #include "spice-util-priv.h"
 #include "spice-util.h"
+#include "spice-util-priv.h"
 
 /**
  * SECTION:spice-util
commit 8e83269bbadcf52f51dce513492824cbfdb44db2
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 14:36:27 2012 +0000

    Ensure all no-args methods are declared (void) not ()
    
    * common/quic.c, common/rop3.c, common/sw_canvas.c,
      gtk/spice-client-glib-usb-acl-helper.c: s/()/(void)/

diff --git a/common/quic.c b/common/quic.c
index e2c211d..9f2c978 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -246,7 +246,7 @@ static const unsigned int tabrand_chaos[TABRAND_TABSIZE] = {
     0x81474925, 0xa8b6c7ad, 0xee5931de, 0xb2f8158d, 0x59fb7409, 0x2e3dfaed, 0x9af25a3f, 0xe1fed4d5,
 };
 
-static unsigned int stabrand()
+static unsigned int stabrand(void)
 {
     //ASSERT( !(TABRAND_SEEDMASK & TABRAND_TABSIZE));
     //ASSERT( TABRAND_SEEDMASK + 1 == TABRAND_TABSIZE );
@@ -530,7 +530,7 @@ static int J[MELCSTATES] = {
 };
 
 /* creates the bit counting look-up table. */
-static void init_zeroLUT()
+static void init_zeroLUT(void)
 {
     int i, j, k, l;
 
@@ -1690,7 +1690,7 @@ void quic_destroy(QuicContext *quic)
     encoder->usr->free(encoder->usr, encoder);
 }
 
-void quic_init()
+void quic_init(void)
 {
     if (!need_init) {
         return;
diff --git a/common/rop3.c b/common/rop3.c
index 77f0a71..15de023 100644
--- a/common/rop3.c
+++ b/common/rop3.c
@@ -38,7 +38,7 @@ typedef void (*rop3_with_pattern_handler_t)(pixman_image_t *d, pixman_image_t *s
 typedef void (*rop3_with_color_handler_t)(pixman_image_t *d, pixman_image_t *s,
                                           SpicePoint *src_pos, uint32_t rgb);
 
-typedef void (*rop3_test_handler_t)();
+typedef void (*rop3_test_handler_t)(void);
 
 #define ROP3_NUM_OPS 256
 
@@ -63,7 +63,7 @@ static void default_rop3_withe_color_handler(pixman_image_t *d, pixman_image_t *
     WARN("not implemented 0x%x");
 }
 
-static void default_rop3_test_handler()
+static void default_rop3_test_handler(void)
 {
 }
 
@@ -134,7 +134,7 @@ static void rop3_handle_c##depth##_##name(pixman_image_t *d, pixman_image_t *s,
     }                                                                                           \
 }                                                                                               \
                                                                                                 \
-static void rop3_test##depth##_##name()                                                         \
+static void rop3_test##depth##_##name(void)                                                     \
 {                                                                                               \
     uint8_t d = 0xaa;                                                                           \
     uint8_t s = 0xcc;                                                                           \
@@ -381,7 +381,7 @@ ROP3_HANDLERS(DPSoo, *src | *pat | *dest, 0xfe);
     rop3_test_handlers_32[index] = rop3_test32_##op;             \
     rop3_test_handlers_16[index] = rop3_test16_##op;
 
-void rop3_init()
+void rop3_init(void)
 {
     static int need_init = 1;
     int i;
diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index 09b649f..34ca910 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -1278,7 +1278,7 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format,
                                 );
 }
 
-void sw_canvas_init() //unsafe global function
+void sw_canvas_init(void) //unsafe global function
 {
     if (!need_init) {
         return;
diff --git a/gtk/spice-client-glib-usb-acl-helper.c b/gtk/spice-client-glib-usb-acl-helper.c
index 4317bdc..724d62a 100644
--- a/gtk/spice-client-glib-usb-acl-helper.c
+++ b/gtk/spice-client-glib-usb-acl-helper.c
@@ -150,7 +150,7 @@ out:
     return ret;
 }
 
-static void cleanup()
+static void cleanup(void)
 {
     if (polkit_cancellable)
         g_cancellable_cancel(polkit_cancellable);
commit 75c9e2f6799afa886a35ab32e2265965878e2bcf
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 14:30:56 2012 +0000

    Add printf format annotations to all '...' functions
    
    To allow the compile to detect incorrect printf formats, any
    var-args function should have a format annotation
    
    * common/macros.h: Helper to define ATTR_PRINTF for code
      which can't depend on glib
    * common/canvas_base.c, common/lz.h, common/macros.h: Annotate
      some var-args methods

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 54de7c6..46a0cdd 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -1764,7 +1764,7 @@ static pixman_image_t *canvas_scale_surface(pixman_image_t *src, const SpiceRect
     return surface;
 }
 
-static void quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
+ATTR_PRINTF(2, 3) static void quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
 {
     QuicData *usr_data = (QuicData *)usr;
     va_list ap;
@@ -1776,7 +1776,7 @@ static void quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
     longjmp(usr_data->jmp_env, 1);
 }
 
-static void quic_usr_warn(QuicUsrContext *usr, const char *fmt, ...)
+ATTR_PRINTF(2, 3) static void quic_usr_warn(QuicUsrContext *usr, const char *fmt, ...)
 {
     QuicData *usr_data = (QuicData *)usr;
     va_list ap;
@@ -1796,7 +1796,7 @@ static void quic_usr_free(QuicUsrContext *usr, void *ptr)
     free(ptr);
 }
 
-static void lz_usr_warn(LzUsrContext *usr, const char *fmt, ...)
+ATTR_PRINTF(2, 3) static void lz_usr_warn(LzUsrContext *usr, const char *fmt, ...)
 {
     LzData *usr_data = (LzData *)usr;
     va_list ap;
@@ -1806,7 +1806,7 @@ static void lz_usr_warn(LzUsrContext *usr, const char *fmt, ...)
     va_end(ap);
 }
 
-static void lz_usr_error(LzUsrContext *usr, const char *fmt, ...)
+ATTR_PRINTF(2, 3) static void lz_usr_error(LzUsrContext *usr, const char *fmt, ...)
 {
     LzData *usr_data = (LzData *)usr;
     va_list ap;
diff --git a/common/lz.h b/common/lz.h
index 993609f..a51ccc0 100644
--- a/common/lz.h
+++ b/common/lz.h
@@ -9,14 +9,15 @@
 #include "lz_common.h"
 #include "lz_config.h"
 #include "draw.h"
+#include "macros.h"
 
 typedef void *LzContext;
 
 typedef struct LzUsrContext LzUsrContext;
 struct LzUsrContext {
-    void (*error)(LzUsrContext *usr, const char *fmt, ...);
-    void (*warn)(LzUsrContext *usr, const char *fmt, ...);
-    void (*info)(LzUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*error)(LzUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*warn)(LzUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*info)(LzUsrContext *usr, const char *fmt, ...);
     void    *(*malloc)(LzUsrContext *usr, int size);
     void (*free)(LzUsrContext *usr, void *ptr);
     int (*more_space)(LzUsrContext *usr, uint8_t **io_ptr);     // get the next chunk of the
diff --git a/common/macros.h b/common/macros.h
new file mode 100644
index 0000000..44a37e4
--- /dev/null
+++ b/common/macros.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2009 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __MACROS_H
+#define __MACROS_H
+
+#if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#define ATTR_PRINTF(a,b)                               \
+    __attribute__((format(printf,a,b)))
+#else
+#define ATTR_PRINTF(a,b)
+#endif /* __GNUC__ */
+
+
+#endif /* __MACROS_H */
diff --git a/common/quic.h b/common/quic.h
index f4ef854..74068f3 100644
--- a/common/quic.h
+++ b/common/quic.h
@@ -20,6 +20,7 @@
 #define __QUIC_H
 
 #include "quic_config.h"
+#include "macros.h"
 
 typedef enum {
     QUIC_IMAGE_TYPE_INVALID,
@@ -37,9 +38,9 @@ typedef void *QuicContext;
 
 typedef struct QuicUsrContext QuicUsrContext;
 struct QuicUsrContext {
-    void (*error)(QuicUsrContext *usr, const char *fmt, ...);
-    void (*warn)(QuicUsrContext *usr, const char *fmt, ...);
-    void (*info)(QuicUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*error)(QuicUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*warn)(QuicUsrContext *usr, const char *fmt, ...);
+    ATTR_PRINTF(2, 3) void (*info)(QuicUsrContext *usr, const char *fmt, ...);
     void *(*malloc)(QuicUsrContext *usr, int size);
     void (*free)(QuicUsrContext *usr, void *ptr);
     int (*more_space)(QuicUsrContext *usr, uint32_t **io_ptr, int rows_completed);
commit 34ccd7e4ba9fbef7b9f51ad972a35d05a4c81be4
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 14:16:52 2012 +0000

    Replace duplicated header declarations
    
    The usb-helper-acl.h header file duplicated some declarations
    already present in usb-device-manager.h
    
    The channel-display.c file declared the object init function
    which is already done by the GObject helper macros
    
    * gtk/channel-display.c: Remove duplicate decl of init function
    * gtk/usb-acl-helper.h: Remove duplicate decls

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 2473ac6..d728fef 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -97,7 +97,6 @@ enum {
 static guint signals[SPICE_DISPLAY_LAST_SIGNAL];
 
 static void spice_display_handle_msg(SpiceChannel *channel, SpiceMsgIn *msg);
-static void spice_display_channel_init(SpiceDisplayChannel *channel);
 static void spice_display_channel_up(SpiceChannel *channel);
 
 static void clear_surfaces(SpiceChannel *channel);
diff --git a/gtk/usb-acl-helper.h b/gtk/usb-acl-helper.h
index c43bdd0..2d41b68 100644
--- a/gtk/usb-acl-helper.h
+++ b/gtk/usb-acl-helper.h
@@ -35,8 +35,6 @@ G_BEGIN_DECLS
 #define SPICE_IS_USB_ACL_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_USB_ACL_HELPER))
 #define SPICE_USB_ACL_HELPER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_USB_ACL_HELPER, SpiceUsbAclHelperClass))
 
-#define SPICE_TYPE_USB_DEVICE                    (spice_usb_device_get_type())
-
 typedef struct _SpiceUsbAclHelper SpiceUsbAclHelper;
 typedef struct _SpiceUsbAclHelperClass SpiceUsbAclHelperClass;
 typedef struct _SpiceUsbAclHelperPrivate SpiceUsbAclHelperPrivate;
@@ -55,7 +53,6 @@ struct _SpiceUsbAclHelperClass
     GObjectClass parent_class;
 };
 
-GType spice_usb_device_get_type(void);
 GType spice_usb_acl_helper_get_type(void);
 
 SpiceUsbAclHelper *spice_usb_acl_helper_new(void);
commit 3b7ac60855a465b5dc4207a036fb0eda9c03efde
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 14:13:01 2012 +0000

    Remove arithmetic on void* pointers
    
    Arithmetic on void * pointers is undefined by the C standard.
    Convert the one case of this to use guint8 instead.
    
    * gtk/channel-main.c: s/void */guint8 */

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 745e954..bd64662 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -777,7 +777,7 @@ static void agent_msg_queue(SpiceMainChannel *channel, int type, int size, void
     SpiceMainChannelPrivate *c = channel->priv;
     SpiceMsgOut *out;
     VDAgentMessage msg;
-    void *payload;
+    guint8 *payload;
     guint32 paysize;
     guint8 *d = data;
 
commit 8098c36e51999567f2b1b5f66e9281c615de19d1
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 14:05:27 2012 +0000

    Fix some integer range checks which always evaluate false
    
    There are some integer range checks which always evaluate false
    due to use of unsigned integer types. One of these would prevent
    detection of encoding errors from celt. The others are simply
    no-ops.
    
    * gtk/channel-record.c: Make 'frame_size' signed to allow detection
      of celt encoding errors
    * gtk/spicy.c: nkeys is an unsigned type, so checks for nkeys < 0 are bogus
    * common/pixman_utils.c: SpiceROP is an enum & thus unsigned

diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index e1eec41..914c97e 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -315,7 +315,7 @@ void spice_pixman_fill_rect_rop(pixman_image_t *dest,
     ASSERT(height > 0);
     ASSERT(x + width <= pixman_image_get_width(dest));
     ASSERT(y + height <= pixman_image_get_height(dest));
-    ASSERT(rop >= 0 && rop < 16);
+    ASSERT(rop < 16);
 
     if (depth == 8) {
         solid_rop_8_func_t rop_func = solid_rops_8[rop];
@@ -466,7 +466,7 @@ void spice_pixman_tile_rect_rop(pixman_image_t *dest,
     ASSERT(height > 0);
     ASSERT(x + width <= pixman_image_get_width(dest));
     ASSERT(y + height <= pixman_image_get_height(dest));
-    ASSERT(rop >= 0 && rop < 16);
+    ASSERT(rop < 16);
     ASSERT(depth == spice_pixman_image_get_bpp(tile));
 
     tile_start_x = (x - offset_x) % tile_width;
diff --git a/gtk/channel-record.c b/gtk/channel-record.c
index c5aded9..fba385b 100644
--- a/gtk/channel-record.c
+++ b/gtk/channel-record.c
@@ -375,7 +375,8 @@ void spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
     p.time = time;
 
     while (bytes > 0) {
-        gsize n, frame_size;
+        gsize n;
+        int frame_size;
         SpiceMsgOut *msg;
         uint8_t *frame;
 
diff --git a/gtk/spicy.c b/gtk/spicy.c
index 8e9d051..b5b6e1d 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -626,7 +626,6 @@ static void restore_configuration(struct spice_window *win)
         return;
     }
 
-    g_return_if_fail(nkeys >= 0);
     if (nkeys > 0)
         g_return_if_fail(keys != NULL);
 
commit 4ca9b15241982327127261a1442a23541e593e7b
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 13:56:04 2012 +0000

    Avoid warnings about empty conditional statement bodies
    
    Add extra {} braces around if/else statements which only
    call SPICE_DEBUG to avoid:
    
    ../common/ssl_verify.c: In function 'verify_pubkey':
    ../common/ssl_verify.c:87:50: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    ../common/ssl_verify.c: In function 'verify_hostname':
    ../common/ssl_verify.c:254:53: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
    ../common/ssl_verify.c: In function 'verify_subject':
    ../common/ssl_verify.c:381:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]

diff --git a/common/ssl_verify.c b/common/ssl_verify.c
index 8e9bbc9..02e7a20 100644
--- a/common/ssl_verify.c
+++ b/common/ssl_verify.c
@@ -79,12 +79,13 @@ static int verify_pubkey(X509* cert, const char *key, size_t key_size)
 
     ret = EVP_PKEY_cmp(orig_pubkey, cert_pubkey);
 
-    if (ret == 1)
+    if (ret == 1) {
         SPICE_DEBUG("public keys match");
-    else if (ret == 0)
+    } else if (ret == 0) {
         SPICE_DEBUG("public keys mismatch");
-    else
+    } else {
         SPICE_DEBUG("public keys types mismatch");
+    }
 
 finish:
     if (bio)
@@ -250,8 +251,9 @@ static int verify_hostname(X509* cert, const char *hostname)
         }
     }
 
-    if (!cn_match)
+    if (!cn_match) {
         SPICE_DEBUG("warning: common name mismatch");
+    }
 
     return cn_match;
 }
@@ -375,10 +377,11 @@ int verify_subject(X509* cert, SpiceOpenSSLVerify* verify)
 
     ret = X509_NAME_cmp(cert_subject, verify->in_subject);
 
-    if (ret == 0)
+    if (ret == 0) {
         SPICE_DEBUG("subjects match");
-    else
+    } else {
         SPICE_DEBUG("subjects mismatch");
+    }
 
     return !ret;
 }
commit 1d0659b5b4fa840c7b895d9b169b850ed03f0ef6
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 13:49:01 2012 +0000

    Fix deprecation warning handling
    
    Various methods are deprecated by using the G_GNUC_DEPRECATED_FOR
    macro. Unfortunately this macro was placed in the .c file impl,
    instead of the .h file decl. Thus applications building against
    SPICE-GTK would never see the deprecation warnings. At the same
    time, building SPICE-GTK itself would trigger some of the warnings
    preventing use of -Wdeprecated-declarations to detect use of
    deprecated GTK functions.
    
    The fix is in multiple parts
    
     * Replace calls to G_GNUC_DEPRECATED_FOR with SPICE_DEPRECATED_FOR
     * Move macros from .c to .h files
     * Turn SPICE_DEPRECATED_FOR into a no-op if SPICE_NO_DEPRECATED
       is defined
     * Define SPICE_NO_DEPRECATED when building

diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 2057b5a..2f7d4ae 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -57,6 +57,7 @@ EXTRA_DIST += $(KEYMAPS)
 
 SPICE_COMMON_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\"GSpice\"       \
+	-DSPICE_NO_DEPRECATED		\
 	-DSW_CANVAS_CACHE		\
 	-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\" \
 	-DPNP_IDS=\""$(PNP_IDS)"\"\
diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index dbe78d9..745e954 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1809,7 +1809,6 @@ void spice_main_set_display(SpiceMainChannel *channel, int id,
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_grab() instead.
  **/
-G_GNUC_DEPRECATED_FOR(spice_main_clipboard_selection_grab)
 void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes)
 {
     spice_main_clipboard_selection_grab(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, types, ntypes);
@@ -1845,7 +1844,6 @@ void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint select
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_release() instead.
  **/
-G_GNUC_DEPRECATED_FOR(spice_main_clipboard_selection_release)
 void spice_main_clipboard_release(SpiceMainChannel *channel)
 {
     spice_main_clipboard_selection_release(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD);
@@ -1886,7 +1884,6 @@ void spice_main_clipboard_selection_release(SpiceMainChannel *channel, guint sel
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_notify() instead.
  **/
-G_GNUC_DEPRECATED_FOR(spice_main_clipboard_selection_notify)
 void spice_main_clipboard_notify(SpiceMainChannel *channel,
                                  guint32 type, const guchar *data, size_t size)
 {
@@ -1926,7 +1923,6 @@ void spice_main_clipboard_selection_notify(SpiceMainChannel *channel, guint sele
  *
  * Deprecated: 0.6: use spice_main_clipboard_selection_request() instead.
  **/
-G_GNUC_DEPRECATED_FOR(spice_main_clipboard_selection_request)
 void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type)
 {
     spice_main_clipboard_selection_request(channel, VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD, type);
diff --git a/gtk/channel-main.h b/gtk/channel-main.h
index ae3f241..197c8d5 100644
--- a/gtk/channel-main.h
+++ b/gtk/channel-main.h
@@ -73,9 +73,13 @@ void spice_main_set_display(SpiceMainChannel *channel, int id,
 void spice_main_set_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled);
 gboolean spice_main_send_monitor_config(SpiceMainChannel *channel);
 
+SPICE_DEPRECATED_FOR(spice_main_clipboard_selection_grab)
 void spice_main_clipboard_grab(SpiceMainChannel *channel, guint32 *types, int ntypes);
+SPICE_DEPRECATED_FOR(spice_main_clipboard_selection_release)
 void spice_main_clipboard_release(SpiceMainChannel *channel);
+SPICE_DEPRECATED_FOR(spice_main_clipboard_selection_notify)
 void spice_main_clipboard_notify(SpiceMainChannel *channel, guint32 type, const guchar *data, size_t size);
+SPICE_DEPRECATED_FOR(spice_main_clipboard_selection_request)
 void spice_main_clipboard_request(SpiceMainChannel *channel, guint32 type);
 
 void spice_main_clipboard_selection_grab(SpiceMainChannel *channel, guint selection, guint32 *types, int ntypes);
diff --git a/gtk/spice-audio.c b/gtk/spice-audio.c
index 3d6e34c..30c2920 100644
--- a/gtk/spice-audio.c
+++ b/gtk/spice-audio.c
@@ -204,7 +204,6 @@ static void session_enable_audio(GObject *gobject, GParamSpec *pspec,
  * Returns: a new #SpiceAudio instance or %NULL if no backend or failed.
  * Deprecated: 0.8: Use spice_audio_get() instead
  **/
-G_GNUC_DEPRECATED_FOR(spice_audio_get)
 SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context,
                             const char *name)
 {
diff --git a/gtk/spice-audio.h b/gtk/spice-audio.h
index 1709227..ab8a1be 100644
--- a/gtk/spice-audio.h
+++ b/gtk/spice-audio.h
@@ -73,6 +73,7 @@ struct _SpiceAudioClass {
 
 GType spice_audio_get_type(void);
 
+SPICE_DEPRECATED_FOR(spice_audio_get)
 SpiceAudio* spice_audio_new(SpiceSession *session, GMainContext *context, const char *name);
 
 SpiceAudio* spice_audio_get(SpiceSession *session, GMainContext *context);
diff --git a/gtk/spice-util.h b/gtk/spice-util.h
index aace4b6..5bd24d3 100644
--- a/gtk/spice-util.h
+++ b/gtk/spice-util.h
@@ -39,6 +39,13 @@ gulong spice_g_signal_connect_object(gpointer instance,
 
 #define SPICE_RESERVED_PADDING 44
 
+#ifndef SPICE_NO_DEPRECATED
+#define SPICE_DEPRECATED_FOR(f) \
+    G_GNUC_DEPRECATED_FOR(f)
+#else
+#define SPICE_DEPRECATED_FOR(f)
+#endif
+
 G_END_DECLS
 
 #endif /* SPICE_UTIL_H */
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index c502732..fb40d1a 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1900,7 +1900,6 @@ void spice_display_mouse_ungrab(SpiceDisplay *display)
  *
  * Deprecated: 0.8: Use spice_gtk_session_copy_to_guest() instead
  **/
-G_GNUC_DEPRECATED_FOR(spice_gtk_session_copy_to_guest)
 void spice_display_copy_to_guest(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
@@ -1918,7 +1917,6 @@ void spice_display_copy_to_guest(SpiceDisplay *display)
  *
  * Deprecated: 0.8: Use spice_gtk_session_paste_from_guest() instead
  **/
-G_GNUC_DEPRECATED_FOR(spice_gtk_session_paste_from_guest)
 void spice_display_paste_from_guest(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
diff --git a/gtk/spice-widget.h b/gtk/spice-widget.h
index 4ea0976..b7f185f 100644
--- a/gtk/spice-widget.h
+++ b/gtk/spice-widget.h
@@ -72,7 +72,9 @@ GType	        spice_display_get_type(void);
 
 SpiceDisplay* spice_display_new(SpiceSession *session, int id);
 void spice_display_mouse_ungrab(SpiceDisplay *display);
+SPICE_DEPRECATED_FOR(spice_gtk_session_copy_to_guest)
 void spice_display_copy_to_guest(SpiceDisplay *display);
+SPICE_DEPRECATED_FOR(spice_gtk_session_paste_from_guest)
 void spice_display_paste_from_guest(SpiceDisplay *display);
 void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq);
 SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display);
commit fb413b74fe45c1af636577a59a31c827ef5af996
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 13:31:39 2012 +0000

    Fix old style declaration where 'inline' came after return type
    
    Fix a case of 'static int inline' to be 'static inline int'

diff --git a/common/lines.c b/common/lines.c
index 1a14c18..ee52a46 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -82,7 +82,7 @@ typedef struct lineGC *GCPtr;
 #define miWideDash spice_canvas_wide_dash_line
 #define miWideLine spice_canvas_wide_line
 
-static int inline
+static inline int
 ICEIL (double x)
 {
     int _cTmp = (int)x;
commit 1b43f3134275256c46ea309029fac8291bb5c2b3
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 13:19:10 2012 +0000

    Fix const-correctness of functions & add explicit casts
    
    Some functions should be declared to take const char * instead
    of plain char *. In other places we intentionally cast away
    const-ness, so we should add explicit casts to stop compiler
    warnings

diff --git a/gtk/snappy.c b/gtk/snappy.c
index 32bd0fb..f7d0f04 100644
--- a/gtk/snappy.c
+++ b/gtk/snappy.c
@@ -25,7 +25,7 @@
 #include "spice-cmdline.h"
 
 /* config */
-static char *outf      = "snappy.ppm";
+static const char *outf      = "snappy.ppm";
 static gboolean version = FALSE;
 
 /* state */
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index a960d87..cdc86ba 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -530,7 +530,7 @@ void *spice_msg_in_raw(SpiceMsgIn *in, int *len)
     return in->data;
 }
 
-static void hexdump(char *prefix, unsigned char *data, int len)
+static void hexdump(const char *prefix, unsigned char *data, int len)
 {
     int i;
 
diff --git a/gtk/spicy.c b/gtk/spicy.c
index aa00582..8e9d051 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -79,8 +79,8 @@ struct spice_connection {
     SpiceGtkSession  *gtk_session;
     spice_window     *wins[4];
     SpiceAudio       *audio;
-    char             *mouse_state;
-    char             *agent_state;
+    const char       *mouse_state;
+    const char       *agent_state;
     gboolean         agent_connected;
     int              channels;
     int              disconnecting;
@@ -515,9 +515,9 @@ static void menu_cb_about(GtkAction *action, void *data)
 {
     char *comments = _("gtk test client app for the\n"
         "spice remote desktop protocol");
-    static char *copyright = "(c) 2010 Red Hat";
-    static char *website = "http://www.spice-space.org";
-    static char *authors[] = { "Gerd Hoffmann <kraxel at redhat.com>",
+    static const char *copyright = "(c) 2010 Red Hat";
+    static const char *website = "http://www.spice-space.org";
+    static const char *authors[] = { "Gerd Hoffmann <kraxel at redhat.com>",
                                "Marc-André Lureau <marcandre.lureau at redhat.com>",
                                NULL };
     struct spice_window *win = data;
@@ -1302,9 +1302,9 @@ static void recent_add(SpiceSession *session)
 {
     GtkRecentManager *recent;
     GtkRecentData meta = {
-        .mime_type    = "application/x-spice",
-        .app_name     = "spicy",
-        .app_exec     = "spicy --uri=%u",
+        .mime_type    = (char*)"application/x-spice",
+        .app_name     = (char*)"spicy",
+        .app_exec     = (char*)"spicy --uri=%u",
     };
     char *uri;
 
diff --git a/gtk/usb-acl-helper.c b/gtk/usb-acl-helper.c
index 6a459c5..12596d0 100644
--- a/gtk/usb-acl-helper.c
+++ b/gtk/usb-acl-helper.c
@@ -194,7 +194,7 @@ void spice_usb_acl_helper_open_acl(SpiceUsbAclHelper *self,
     GIOStatus status;
     GPid helper_pid;
     gsize bytes_written;
-    gchar *argv[] = { ACL_HELPER_PATH"/spice-client-glib-usb-acl-helper", NULL };
+    gchar *argv[] = { (char*) ACL_HELPER_PATH"/spice-client-glib-usb-acl-helper", NULL };
     gint in, out;
     gchar buf[128];
 
commit dea13f3a40d3e0e6fd41924bbea72b7b41d736c8
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 12:59:36 2012 +0000

    Remove non-existant include directories from CFLAGS

diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index ed40ce8..2057b5a 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -63,8 +63,6 @@ SPICE_COMMON_CPPFLAGS = \
 	-DUSB_IDS=\""$(USB_IDS)"\"\
 	\
 	-I$(COMMON_DIR)			\
-	-I$(CLIENT_DIR)			\
-	-I$(CLIENT_DIR)/x11		\
 	\
 	$(PROTOCOL_CFLAGS)		\
 	$(PIXMAN_CFLAGS)		\
commit 9d69b2c5d73563601c2322f0f6b570bbdb59dddf
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Feb 10 12:57:37 2012 +0000

    Don't delete gtk-doc.make in distclean
    
    gtk-doc.make is created by autogen.sh, therefore it should
    not be deleted in distclean, only maintainerclean

diff --git a/Makefile.am b/Makefile.am
index 73b5531..8ab020a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,6 @@ DISTCLEANFILES = $(pkgconfig_DATA)		\
 		 intltool-merge			\
 		 intltool-update		\
 		 gnome-doc-utils.make		\
-		 gtk-doc.make			\
 		 po/.intltool-merge-cache	\
 		 $(NULL)
 
@@ -55,6 +54,7 @@ MAINTAINERCLEANFILES =				\
 	build-aux/missing			\
 	build-aux/mkinstalldirs			\
 	po/Makefile.in.in			\
+	gtk-doc.make				\
 	$(NULL)
 
 # Generate the ChangeLog file (with all entries since the switch to git)


More information about the Spice-commits mailing list