In message <[EMAIL PROTECTED]>
Denis Oliver Kropp <[EMAIL PROTECTED]> wrote:
> Quoting Simon Willcocks:
[snip]
> > I'd rather type
> > flags = DFBSurfaceDescriptionFlags( flags | DSDESC_WIDTH );
> >
> > than
> > DFB_ADD_SURFACE_DESC( flags, DSDESC_WIDTH );
> >
> > event though it's a bit longer, there's just one name to remember!
>
> Your version looks better, as it still directly shows the assignment.
>
> Something shorter might be:
>
> #define DSDESC(x) ((DFBSurfaceDescriptionFlags) (x))
>
> flags = DSDESC( flags | DSDESC_WIDTH );
I like that, too, since it gives an immediate visual check on the type of
the flags (of course it's still not checked by the compiler).
You could get away with
#define DSDESC DFBSurfaceDescriptionFlags
for the macro, of course, but that may be asking for trouble.
Regards,
Simon
--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with
"unsubscribe directfb-dev" as subject.