On Wed, May 09, 2012 at 10:05:51PM -0700, Keith Packard wrote:
> On Thu, 10 May 2012 14:25:25 +1000, Peter Hutterer <[email protected]>
> wrote:
>
> > +#define BUG_RETURN(cond) \
> > + do { __BUG_WARN_MSG(cond, 0, NULL); return; } while(0)
>
> I'm not a huge fan of macros hiding control flow...
these are bug macros. their only point is to scream BUG! into the log for
things that really shouldn't have happened.
right now we have a few of these:
BUG_WARN(foo);
if (foo)
return FALSE;
so we check the condition twice. That now becomes
BUG_RETURN_VAL(foo, FALSE)
which is less clutter, but fulfills the same purpose.
Cheers,
Peter
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel