Re: gtktextchild.c, another one



Am Sam, 2002-02-09 um 21.28 schrieb Havoc Pennington:
> 
> Daniel Elstner <daniel elstner gmx net> writes:
> > 
> >   g_return_if_fail (widget_segment->type = &gtk_text_child_type);
> > 
> > Maybe I'm missing something, but the assignment isn't there by
> > intention, is it?  This occurs several times in the file.
> > 
> > Since there's no way that the check ever fails, I guess it's just a
> > typo.  If so, I'd be happy to commit the attached patch.
> > 
> 
> Yes, please go ahead. (I guess gcc didn't warn about that because the
> return_if_fail macro adds parens?)

Yes, because it negates the expression:

    if (!(expr)) ...

However, one could replace it by

    if (expr) {} else ...

I just tried it out and it didn't reveal any other mistakes of
this kind :)

> Do you get the feeling you're the first person to try to use child
> widgets in GtkTextView? ;-)

Probably I would, if I weren't just trying to get gtk-demo working ;-)

Cheers,
--Daniel




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