httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilt, Paul" <paul.w...@bellhowell.infolearning.com>
Subject RE: cvs commit: apache-2.0/mpm/src/modules/mpm/prefork prefork.c
Date Tue, 27 Jul 1999 19:56:11 GMT
This, of course, assumes that NULL evaulates to zero.  I used to have a
software manager who would change the value of NULL, rebuild the whole
runtime library and see who had not been checking return values!

Paul E Wilt 
Principal Software Engineer
____________________________________________________
Bell & Howell Information and Learning (Formerly UMI)
http://www.bellhowell.infolearning.com
mailto:Paul.Wilt@bellhowell.infolearning.com
mailto:pwilt@umi.com
300 North Zeeb Rd			Phone: (734) 975-6021
Ann Arbor, MI 48106		Fax:    (734) 973-0737
____________________________________________________


-----Original Message-----
From: Ben Laurie [mailto:ben@algroup.co.uk]
Sent: Tuesday, July 27, 1999 3:51 PM
To: new-httpd@apache.org
Subject: Re: cvs commit: apache-2.0/mpm/src/modules/mpm/prefork
prefork.c


Eli Marmor wrote:
> 
> Ben Laurie wrote:
> >
> > "Ralf S. Engelschall" wrote:
> > >
> > > In article <19990727133121.1636.qmail@hyperreal.org> you wrote:
> > >
> > > >   Fix a warning.
> > > >
> > > >   -    one_process = getenv("ONE_PROCESS");
> > > >   +    one_process = !!getenv("ONE_PROCESS");
> > >
> > > <grin> A very interesting solution variant... :-)
> >
> > :-) I hope it didn't offend anyone... its actually quite a useful
> > technique where you definitely want a boolean as a result.
> 
> The "technique" is:
>         one_process = (NULL != getenv("ONE_PROCESS"));
> (I know that the "(" and ")" can be omitted).

<RELIGION>
But !! works for arbitrary data types, and is shorter, and captures the
prevailing opinion, in AG, at least, that if(x) is better than if(x !=
NULL) (or, for IBM devotees, if(NULL != x)). I'm almost tempted to add
this one to the style guide (after due process, of course. Hell, that
reminds me, I promised to do due process on style for OpenSSL).
</RELIGION>

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

Mime
View raw message