httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject RE: cvs commit: apache-2.0/src/main http_protocol.c
Date Sun, 08 Oct 2000 17:11:48 GMT
Same true/false arguments we always have... we can't really
rely on the platform TRUE result to be a 1 (could be ~0 or !0),
and the compiler should optimize away if it is truly ANSI.

It's the only thing I eyeballed in the 15 minutes before 
services that could have broken this last night... but I'm 
back to reviewing now... seems David is on to another clue.

Bill

> -----Original Message-----
> From: Jim Jagielski [mailto:jim@jaguNET.com]
> Sent: Sunday, October 08, 2000 11:51 AM
> To: new-httpd@apache.org
> Subject: Re: cvs commit: apache-2.0/src/main http_protocol.c
> 
> 
> rbb@locus.apache.org wrote:
> > 
> >                length = toss - temp + 1;
> >   -            e->split(e, length + (temp[length] == 0));
> >   +            e->split(e, length + (temp[length] == '\0' ? 1 : 0));
> >                apr_cpystrn(pos, temp, length + 1);
> >    	    
> 
> certainly the above is clearer, but couldn't that reduce to
> 
> 	e->split(e, length + (temp[length] == '\0'));
> 
> By ANSI definition, the results of '==' are either 1 or 0, so
> the '? 1 : 0' is redundant...
> 
> Or maybe I'm missing something :)
> -- 
> ==============================================================
> =============
>    Jim Jagielski   [|]   jim@jaguNET.com   [|]   
> http://www.jaguNET.com/
>                 "Are you suggesting coconuts migrate??"
> 

Mime
View raw message