Re: cygwin source question

2007-01-22 Thread Yitzchak Scott-Thoennes
Dave Korn writes: On 21 January 2007 14:38, Christopher Layne wrote: I notice in some places, there are double-negates, like: me-read_ready |= ret || !!(events (FD_READ | FD_ACCEPT | FD_CLOSE)); What's the rationale for these? To enforce either a 0 or 1, to be directly in line

RE: cygwin source question

2007-01-22 Thread Dave Korn
On 22 January 2007 08:19, Yitzchak Scott-Thoennes wrote: Some people prefer (expr) ? 1 : 0, which looks a lot worse to me than !!(expr). Compiles to the exact same thing at -O0 and at -O2, as it happens... /tmp $ gcc -x c -S -o - - int foo (int argc) { return (argc == 23) ? 1 : 0; }

Re: cygwin source question

2007-01-22 Thread Christopher Layne
On Mon, Jan 22, 2007 at 10:42:19AM -, Dave Korn wrote: ... so no reason not to choose whichever you like the best. cheers, DaveK I prefer the idiom that doesn't resemble perl :). Also, if it were me, I'd just be checking for zero or non-zero. The rest seems like a lot of

Re: cygwin source question

2007-01-22 Thread Igor Peshansky
On Mon, 22 Jan 2007, Yitzchak Scott-Thoennes wrote: Dave Korn writes: On 21 January 2007 14:38, Christopher Layne wrote: I notice in some places, there are double-negates, like: me-read_ready |= ret || !!(events (FD_READ | FD_ACCEPT | FD_CLOSE)); What's the rationale for these?

cygwin source question

2007-01-21 Thread Christopher Layne
I notice in some places, there are double-negates, like: me-read_ready |= ret || !!(events (FD_READ | FD_ACCEPT | FD_CLOSE)); What's the rationale for these? To enforce either a 0 or 1, to be directly in line with boolean, rather than a zero or non-zero result? -cl -- Unsubscribe info:

RE: cygwin source question

2007-01-21 Thread Dave Korn
On 21 January 2007 14:38, Christopher Layne wrote: I notice in some places, there are double-negates, like: me-read_ready |= ret || !!(events (FD_READ | FD_ACCEPT | FD_CLOSE)); What's the rationale for these? To enforce either a 0 or 1, to be directly in line with boolean, rather than a