Re: RFC: small syscons and kbd patch

2008-12-05 Thread Nate Eldredge
On Fri, 5 Dec 2008, Stephen Montgomery-Smith wrote: Nate Eldredge wrote: int bangbang(int x) { return !!x; } int ternary(int x) { return x ? 1 : 0; } Stylewise, I prefer int notzero(int x) { return x!=0; } icc -O0 compiles notzero the same as bangbang (better than ternary). tcc produces

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Stephen Montgomery-Smith
Nate Eldredge wrote: int bangbang(int x) { return !!x; } int ternary(int x) { return x ? 1 : 0; } Stylewise, I prefer int notzero(int x) { return x!=0; } ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Nate Eldredge
On Fri, 5 Dec 2008, Garrett Cooper wrote: On Fri, Dec 5, 2008 at 1:11 AM, Christoph Mallon <[EMAIL PROTECTED]> wrote: Garrett Cooper schrieb: (I feel like I'm getting off on a bikeshed topic, but...) 1. What dialect of C was it defined in? Is it still used in the standard dialect (honestly,

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Eygene Ryabinkin
Garret, Fri, Dec 05, 2008 at 12:50:38AM -0800, Garrett Cooper wrote: > 1. What dialect of C was it defined in? Is it still used in the > standard dialect (honestly, this is the first time I've ever seen it > before, but then again I am a younger generation user)? It is the standard negation opera

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Andriy Gapon
on 05/12/2008 10:50 Garrett Cooper said the following: > On Fri, Dec 5, 2008 at 12:44 AM, Erik Trulsson <[EMAIL PROTECTED]> wrote: >> On Fri, Dec 05, 2008 at 12:35:31AM -0800, Garrett Cooper wrote: >>> On Thu, Dec 4, 2008 at 11:22 PM, Ed Schouten <[EMAIL PROTECTED]> wrote: * Maksim Yevmenkin <

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Dag-Erling Smørgrav
Christoph Mallon <[EMAIL PROTECTED]> writes: > Don't try to argue about style(9). IMO it's horribly outdated, but > there are conservative forces, which would prefer to cling to K&R. At > least we got function prototypes! If there's something specific in style(9) you don't like, you are welcome to

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Dag-Erling Smørgrav
"Garrett Cooper" <[EMAIL PROTECTED]> writes: > If you really want to split hairs, ! only negates the logic value, > whereas ~ actually negates the bits. So technically, you're not > flipping 0 to make 1 and vice versa, but instead flipping 0 to make > non-zero, etc. There is a clear distinction in

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Christoph Mallon
Garrett Cooper schrieb: On Fri, Dec 5, 2008 at 1:11 AM, Christoph Mallon <[EMAIL PROTECTED]> wrote: Garrett Cooper schrieb: (I feel like I'm getting off on a bikeshed topic, but...) 1. What dialect of C was it defined in? Is it still used in the standard dialect (honestly, this is the first ti

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 1:11 AM, Christoph Mallon <[EMAIL PROTECTED]> wrote: > Garrett Cooper schrieb: >> >> (I feel like I'm getting off on a bikeshed topic, but...) >> >> 1. What dialect of C was it defined in? Is it still used in the >> standard dialect (honestly, this is the first time I've ever

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Erik Trulsson
On Fri, Dec 05, 2008 at 12:50:38AM -0800, Garrett Cooper wrote: > On Fri, Dec 5, 2008 at 12:44 AM, Erik Trulsson <[EMAIL PROTECTED]> wrote: > > On Fri, Dec 05, 2008 at 12:35:31AM -0800, Garrett Cooper wrote: > >> On Thu, Dec 4, 2008 at 11:22 PM, Ed Schouten <[EMAIL PROTECTED]> wrote: > >> > * Maksi

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Christoph Mallon
Garrett Cooper schrieb: (I feel like I'm getting off on a bikeshed topic, but...) 1. What dialect of C was it defined in? Is it still used in the standard dialect (honestly, this is the first time I've ever seen it before, but then again I am a younger generation user)? Dialect? The ! operator

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Garrett Cooper
On Fri, Dec 5, 2008 at 12:44 AM, Erik Trulsson <[EMAIL PROTECTED]> wrote: > On Fri, Dec 05, 2008 at 12:35:31AM -0800, Garrett Cooper wrote: >> On Thu, Dec 4, 2008 at 11:22 PM, Ed Schouten <[EMAIL PROTECTED]> wrote: >> > * Maksim Yevmenkin <[EMAIL PROTECTED]> wrote: >> >> the idea was to ensure that

Re: RFC: small syscons and kbd patch

2008-12-05 Thread Erik Trulsson
On Fri, Dec 05, 2008 at 12:35:31AM -0800, Garrett Cooper wrote: > On Thu, Dec 4, 2008 at 11:22 PM, Ed Schouten <[EMAIL PROTECTED]> wrote: > > * Maksim Yevmenkin <[EMAIL PROTECTED]> wrote: > >> the idea was to ensure that kbd->kb_locked variable only takes values > >> 0 (zero) and 1 (one). > > > > I