[systemd-devel] [RFC 06/12] gfx: add keyboard layer

Lennart Poettering lennart at poettering.net
Tue Dec 10 16:45:11 PST 2013


On Thu, 28.11.13 09:36, David Herrmann (dh.herrmann at gmail.com) wrote:

> 
> Hi
> 
> On Wed, Nov 27, 2013 at 11:17 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Wed, 27.11.13 19:48, David Herrmann (dh.herrmann at gmail.com) wrote:
> >
> >> +
> >> +enum {
> >> +        SD_GFX__LED_NUML,
> >> +        SD_GFX__LED_CAPSL,
> >> +        SD_GFX__LED_SCROLLL,
> >> +        SD_GFX__LED_COUNT,
> >> +};
> >
> > Double underscores?
> 
> Yes.

Why?

> > If these are bools, then make them bools! C99 bools (i.e. the type
> > "bool" from stdbool.h) are awesome for bit fields! [ Please use C99 bools
> > everywhere in internal code, and "int" as bool type for public APIs,
> > since that's what pre-C99 code usually did, despite the stupidity this
> > results in when people use bit fields ]
> 
> You can use "_Bool/bool" for bitfields? 

Yes, that's what makes them so useful! Otherwise C99 bools are just
meh. But in bitfields, yuppideefuckindoo!

> Didn't know that. I always use "bool" for boolean values, I only
> thought they don't work for bitfields. Will fix that up.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list