Re: Pango Performance (was: Re: --gtk-unbuffered)



Hans Breuer wrote:
> 
> At 20:51 01.03.01 +0100, egger suse de wrote:
> >On  1 Mar, Tor Lillqvist wrote:
> >
> >>  > +  return (1 == has_glyph);
> >
> >> It would be preferrable if all of Pango used the same coding style
> >> conventions. While I certainly understand the rationale for this style
> >> of writing equality tests, it is nonetheless not used in any of the
> >> other code, which can be confusing. Or what do others think?
> >
> > Just curious: Whats the rationale for this "strange way to code"?
> >
> Experience :-) The compiler will obviously catch the problem of an
> assignment, where a comparsion was intended. I even can't see a violation
> of GNU/Pango coding styles with it, but have learned, that it is never a
> good idea to contribute a patch hacked after a whole day of work with a
> totally differnt coding style ...

I have a perfect solution :)

#define G_IS_EQUAL(a,b)  b == a

Then you can write

if (G_IS_EQUAL (thing->val, 1))



Yummy.

John




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