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 630731 - gtk_adjustment_new() should return a GtkAdjustment* instead a Gobject*
gtk_adjustment_new() should return a GtkAdjustment* instead a Gobject*
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.90.x
Other All
: Normal normal
: 3.0
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-09-27 13:18 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-09-29 00:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk_adjustment_new() should return a GtkAdjustment* instead a Gobject* (13.70 KB, patch)
2010-09-27 13:20 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Remove unneded casts (24.09 KB, patch)
2010-09-27 13:20 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Javier Jardón (IRC: jjardon) 2010-09-27 13:18:58 UTC
Patch following
Comment 1 Javier Jardón (IRC: jjardon) 2010-09-27 13:20:18 UTC
Created attachment 171205 [details] [review]
gtk_adjustment_new() should return a GtkAdjustment* instead a Gobject*
Comment 2 Javier Jardón (IRC: jjardon) 2010-09-27 13:20:45 UTC
Created attachment 171206 [details] [review]
Remove unneded casts
Comment 3 Matthias Clasen 2010-09-27 15:08:15 UTC
Review of attachment 171205 [details] [review]:

::: gtk/gtkadjustment.c
@@ +322,3 @@
 gtk_adjustment_new (gdouble value,
 		    gdouble lower,
 		    gdouble upper,

You need to add a cast in the return statement here. g_object_new just gives you a GObject *
Comment 4 Matthias Clasen 2010-09-27 15:08:49 UTC
Review of attachment 171206 [details] [review]:

Looks good
Comment 5 Javier Jardón (IRC: jjardon) 2010-09-28 01:28:33 UTC
Thanks for the review

(In reply to comment #3)
> Review of attachment 171205 [details] [review]:
> 
> ::: gtk/gtkadjustment.c
> @@ +322,3 @@
>  gtk_adjustment_new (gdouble value,
>              gdouble lower,
>              gdouble upper,
> 
> You need to add a cast in the return statement here. g_object_new just gives
> you a GObject *

Are you sure about this? Other object like gtkrecentfilter, gtktreeviewcolumn or gtkfilefilter don't need that casts.
Comment 6 Emmanuele Bassi (:ebassi) 2010-09-28 06:52:39 UTC
(In reply to comment #3)
> Review of attachment 171205 [details] [review]:
> 
> ::: gtk/gtkadjustment.c
> @@ +322,3 @@
>  gtk_adjustment_new (gdouble value,
>              gdouble lower,
>              gdouble upper,
> 
> You need to add a cast in the return statement here. g_object_new just gives
> you a GObject *

no: g_object_new() returns a gpointer exactly for this case.
Comment 7 Matthias Clasen 2010-09-28 13:30:24 UTC
My bad. I blame my age...

So, go ahead then.
Comment 8 Javier Jardón (IRC: jjardon) 2010-09-29 00:32:06 UTC
Comment on attachment 171205 [details] [review]
gtk_adjustment_new() should return a GtkAdjustment* instead a Gobject*

commit 42f480a537da89eac587a5a67fbf64ab248cd931
Comment 9 Javier Jardón (IRC: jjardon) 2010-09-29 00:32:22 UTC
Comment on attachment 171206 [details] [review]
Remove unneded casts

commit b072ea220cb938471c3ce5cb2fbd1e750112938b