Received: from eggs.gnu.org ([2001:4830:134:3::10]:47497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uolg9-00068L-Po for qemu-devel@nongnu.org; Mon, 17 Jun 2013 22:29:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uolg8-0001k3-P1 for qemu-devel@nongnu.org; Mon, 17 Jun 2013 22:29:53 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:41396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uolg8-0001jx-HQ for qemu-devel@nongnu.org; Mon, 17 Jun 2013 22:29:52 -0400 Message-ID: <51BFC61E.9000801@msgid.tls.msk.ru> Date: Tue, 18 Jun 2013 06:29:50 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1371391987-10795-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1371391987-10795-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] gtk: Fix compiler warning (GTK 3 deprecated function) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel 16.06.2013 18:13, Stefan Weil wrote: > With GTK 3, the function gdk_cursor_unref is deprecated: >=20 > qemu/ui/gtk.c: In function =E2=80=98gd_cursor_define=E2=80=99: > qemu/ui/gtk.c:380:5: error: > =E2=80=98gdk_cursor_unref=E2=80=99 is deprecated (declared at /usr/inc= lude/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=3D= deprecated-declarations] >=20 > Fix the gcc compiler warning by using conditional compilation. >=20 > Signed-off-by: Stefan Weil > --- > ui/gtk.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/ui/gtk.c b/ui/gtk.c > index 50a6993..7310e20 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -377,7 +377,11 @@ static void gd_cursor_define(DisplayChangeListener= *dcl, > pixbuf, c->hot_x, c->hot_y); > gdk_window_set_cursor(gtk_widget_get_window(s->drawing_area), curs= or); > g_object_unref(pixbuf); > +#if !GTK_CHECK_VERSION(3, 0, 0) > gdk_cursor_unref(cursor); > +#else > + g_object_unref(cursor); > +#endif > } It's fun that this very change - to use cursor_unref instead of object_un= ref - that caused this warning to appear was a fix for a bug, see 171392406d8e2= . Oh well. /mjt