Re: [patch] constify g_simple_async_result_set_from_error

2009-09-11 Thread Richard Hughes
2009/9/10 Alexander Larsson al...@redhat.com: Yeah, please commit. Done, thanks. Richard. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-10 Thread Alexander Larsson
On Wed, 2009-09-09 at 13:05 -0400, Matthias Clasen wrote: On Sat, Sep 5, 2009 at 3:21 PM, Richard Hughes hughsi...@gmail.com wrote: 2009/9/3 Michael Natterer mi...@gimp.org: I'd say just go ahead and make it const. Okay to commit? I concur with mitch here. There is even some precedent

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-09 Thread Matthias Clasen
On Sat, Sep 5, 2009 at 3:21 PM, Richard Hughes hughsi...@gmail.com wrote: 2009/9/3 Michael Natterer mi...@gimp.org: I'd say just go ahead and make it const. Okay to commit? I concur with mitch here. There is even some precedent for const GError * in the glib api...

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-05 Thread Richard Hughes
2009/9/3 Michael Natterer mi...@gimp.org: I'd say just go ahead and make it const. Okay to commit? Richard. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-03 Thread Michael Natterer
On Wed, 2009-09-02 at 14:53 -0400, Morten Welinder wrote: With this change, it won't break (or add warnings) to any program. It just removes a warning for programs that do not do the explicit cast, and get given a const GError. Really? Take the program below and notice that the

[patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Richard Hughes
In PackageKit, I have to explicitly cast in my finish function: static void pk_package_sack_merge_state_finish (PkPackageSackState *state, const GError *error) { ... g_simple_async_result_set_from_error (state-res, (GError*) error); ... } The finish function is passed a const

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread David Zeuthen
On Wed, 2009-09-02 at 19:17 +0100, Richard Hughes wrote: In PackageKit, I have to explicitly cast in my finish function: static void pk_package_sack_merge_state_finish (PkPackageSackState *state, const GError *error) { ... g_simple_async_result_set_from_error (state-res,

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Sven Neumann
On Wed, 2009-09-02 at 14:28 -0400, David Zeuthen wrote: Mmmm, wouldn't this break the API? E.g. cause compilation of existing apps to spew warnings. If so, we can't do it. How is the introduction of a compiler warning an API break? Every gcc update introduces some more compiler warnings in

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Steve Frécinaux
David Zeuthen wrote: On Wed, 2009-09-02 at 19:17 +0100, Richard Hughes wrote: In PackageKit, I have to explicitly cast in my finish function: static void pk_package_sack_merge_state_finish (PkPackageSackState *state, const GError *error) { ...

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Richard Hughes
2009/9/2 David Zeuthen da...@fubar.dk: Mmmm, wouldn't this break the API? E.g. cause compilation of existing apps to spew warnings. If so, we can't do it. No, the API doesn't change. g_simple_async_result_set_from_error doesn't ever free the passed error, and the only function that

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread David Zeuthen
On Wed, 2009-09-02 at 20:42 +0200, Sven Neumann wrote: On Wed, 2009-09-02 at 14:28 -0400, David Zeuthen wrote: Mmmm, wouldn't this break the API? E.g. cause compilation of existing apps to spew warnings. If so, we can't do it. How is the introduction of a compiler warning an API break?

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Richard Hughes
2009/9/2 Steve Frécinaux nudr...@gmail.com: I don't think it would make the ABI change... No, it won't If anything it makes the ABI more permissive, not less permissive, as const GError will accept either a GError or const GError parameter. Richard.

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Morten Welinder
With this change, it won't break (or add warnings) to any program. It just removes a warning for programs that do not do the explicit cast, and get given a const GError. Really? Take the program below and notice that the constified prototype introduces a warning. If used from C++, that would

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Steve Frécinaux
Richard Hughes wrote: 2009/9/2 Steve Frécinaux nudr...@gmail.com: I don't think it would make the ABI change... No, it won't If anything it makes the ABI more permissive, not less permissive, as const GError will accept either a GError or const GError parameter. Well this doesn't change the

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Richard Hughes
2009/9/2 Morten Welinder mort...@gnome.org:  void (*f1) (char *) = foo; Why would you ever do that for g_simple_async_result_set_from_error? If you're doing things like that with g_simple_async_result_set_from_error then you're doing it wrong... Richard.

Re: [patch] constify g_simple_async_result_set_from_error

2009-09-02 Thread Cody Russell
On Wed, 2009-09-02 at 14:28 -0400, David Zeuthen wrote: Unfortunately there's a lot of const incorrectness in the GLib and GTK + stack - maybe we should fix this in GLib3/GTK3 since it's going to be a new ABI. Just a very minor correction, but at the moment there are no plans for GLib 3.