After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341857 - warning fix for glade-xml.c
warning fix for glade-xml.c
Status: RESOLVED FIXED
Product: libglade
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: James Henstridge
James Henstridge
Depends on:
Blocks:
 
 
Reported: 2006-05-15 13:39 UTC by Kjartan Maraas
Modified: 2006-07-11 13:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.05 KB, patch)
2006-05-15 13:40 UTC, Kjartan Maraas
none Details | Review
updated patch (1.03 KB, patch)
2006-05-15 13:50 UTC, Kjartan Maraas
accepted-commit_now Details | Review

Description Kjartan Maraas 2006-05-15 13:39:45 UTC
Trying to get rid of warnings of this type:

glade-xml.c: In function 'glade_xml_set_value_from_string':
glade-xml.c:1519: warning: implicit declaration of function 'gtk_object_sink'
Comment 1 Kjartan Maraas 2006-05-15 13:40:06 UTC
Created attachment 65501 [details] [review]
proposed patch
Comment 2 Kjartan Maraas 2006-05-15 13:50:33 UTC
Created attachment 65502 [details] [review]
updated patch

Remove some unneeded casts.
Comment 3 James Henstridge 2006-07-11 12:57:08 UTC
Comment on attachment 65502 [details] [review]
updated patch

>Index: glade-xml.c
>===================================================================
>RCS file: /cvs/gnome/libglade/glade/glade-xml.c,v
>retrieving revision 1.111
>diff -u -p -r1.111 glade-xml.c
>--- glade-xml.c	29 Nov 2004 11:05:16 -0000	1.111
>+++ glade-xml.c	15 May 2006 13:50:13 -0000
>@@ -121,8 +121,7 @@ glade_xml_init (GladeXML *self)
>     priv->tree = NULL;
>     priv->tooltips = gtk_tooltips_new();
>     gtk_tooltips_enable(priv->tooltips);
>-    g_object_ref(priv->tooltips);
>-    gtk_object_sink(GTK_OBJECT(priv->tooltips));
>+    g_object_ref_sink(priv->tooltips);
>     priv->name_hash = g_hash_table_new(g_str_hash, g_str_equal);
>     priv->signals = g_hash_table_new(g_str_hash, g_str_equal);
>     priv->toplevel = NULL;

This looks fine.

>@@ -1517,7 +1516,7 @@ glade_xml_set_value_from_string (GladeXM
> 	    adj->page_size = g_strtod(ptr, &ptr);
> 
> 	    g_value_set_object(value, adj);
>-	    gtk_object_sink(GTK_OBJECT(adj));
>+	    g_object_ref_sink(adj);
> 	} else if (G_VALUE_HOLDS(value, GDK_TYPE_PIXBUF)) {
> 	    gchar *filename;
> 	    GError *error = NULL;

This will leak.  You need a g_object_unref(adj); call after ref_sink() to get equivalent behaviour.

With that fixed, you can commit (with an appropriate changelog).
Comment 4 Kjartan Maraas 2006-07-11 13:18:49 UTC
Commited with that change. Thanks.