Re: g_object_[add|remove]_weak_pointer needs an explicit cast



Hi,

Owen Taylor <otaylor redhat com> writes:

> Tim Janik <timj gtk org> writes:
> 
> > On 19 Aug 2001, Sven Neumann wrote:
> > 
> > >  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.
> 
> Making something a 'gpointer' just to avoid casting makes me
> uncomfortable...  you've thrown away useful information,
> and people have enough trouble understanding & and ** without
> hiding things behind 'gpointer'.
> 
> I'd rather see it as GObject **.

this question is still undecided. I don't think GObject ** is the
correct solution since the code does not require a pointer to a 
GObject location at all (although I have to assume that this will
be the most common usage case). How do we decide this? At the 
moment it's Tim and me for (gpointer *), Owen for (GObject **).
Any other votes?


Salut, Sven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]