Re: g_object_[add|remove]_weak_pointer needs an explicit cast
- From: Tim Janik <timj gtk org>
- To: Sven Neumann <sven gimp org>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: g_object_[add|remove]_weak_pointer needs an explicit cast
- Date: Mon, 20 Aug 2001 14:38:50 +0200 (CEST)
On 19 Aug 2001, Sven Neumann wrote:
> Hi,
>
> I've added this code myself, but have now found that to use
> g_object_[add|remove]_weak_pointer() one has to write code
> like
>
> g_object_add_weak_pointer (G_OBJECT (foo->object),
> (gpointer *) &foo->object);
>
> since gcc doesn't seem to like the simpler
>
> g_object_add_weak_pointer (G_OBJECT (foo->object),
> &foo->object);
>
> I propose we apply the attached simple patch to remove the
> need to insert an explicit cast. The name weak_pointer_location
> should be clear enough to outline that we expect a pointer to
> a pointer location here. Any objections?
>
> void g_object_add_weak_pointer (GObject *object,
> - gpointer *weak_pointer_location);
> + gpointer weak_pointer_location);
nope, that's fine. the same thing should be done for:
gboolean g_module_symbol (GModule *module,
const gchar *symbol_name,
gpointer *symbol);
as in its current incarnation, it requires casting for
the symbol location in 95% usage cases.
>
> Salut, Sven
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]