RFC: small syscons and kbd patch

Andriy Gapon avg at icyb.net.ua
Fri Dec 5 03:35:57 PST 2008


on 05/12/2008 09:22 Ed Schouten said the following:
> * Maksim Yevmenkin <maksim.yevmenkin at gmail.com> wrote:
>> the idea was to ensure that kbd->kb_locked variable only takes values
>> 0 (zero) and 1 (one).
> 
> I often use constructs like these to do that:
> 
> 	foo = bar ? 1 : 0;
> 
> Maybe !!bar is a lot shorter to write, I think the line above is a lot
> easier to read.

Another variation is:
foo = (bar != 0);

I think that this is something in the middle.
BTW, gcc 4.2 produces exactly the same assembly for all 3 forms.

-- 
Andriy Gapon


More information about the freebsd-current mailing list