You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1997/09/16 02:51:58 UTC

Re: indent, line splitting?

>Oh yeah, and one more gotcha to watch out for:  It doesn't understand
>mismatched {} caused by #ifdef grunginess.  i.e. there used to be code
>in http_main.c:
>
>#ifdef MPE
>    if (blah blah blah) {
>	if (bluh bluh bluh) {
>#else
>    if (feh foh fee) {
>#endif
>	whatever;
>    }
>#ifdef MPE
>    }
>#endif
>
>It got really confused by that.

Yep, same thing was in http_request.c, so I fixed the code and committed
the fix before running indent.  The above is certainly legal C, but I
consider it totally unreadable; I'd rather just duplicate the shared code.

We definitely need to hand edit a file after it has been indent'd.
I spent about two hours per non-header file doing that the other night,
but that was mostly because I think the core files need extra attention
to readability.

....Roy

Re: indent, line splitting?

Posted by Dean Gaudet <dg...@arctic.org>.
I'll side with ya Ben.  It don't matter to me either way ;)

Dean

On Tue, 16 Sep 1997, Ben Laurie wrote:

> Dean Gaudet wrote:
> > I notice it's also taking one line things:
> > 
> >     if (blat) break;
> > 
> > and making them two lines.  But I'm not touching these, there are so
> > many of them.
> 
> I can't remember if we discussed this one, but IMO they should be two
> lines. Which probably means that the group will want them one line,
> since I seem to be diametrically opposed to the norm on style :-)
> 
> Cheers,
> 
> Ben.
> 
> -- 
> Ben Laurie            |Phone: +44 (181) 994 6435|Apache Group member
> Freelance Consultant  |Fax:   +44 (181) 994 6472|http://www.apache.org
> and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
> A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
> London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache
> 


Re: indent, line splitting?

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:
> I notice it's also taking one line things:
> 
>     if (blat) break;
> 
> and making them two lines.  But I'm not touching these, there are so
> many of them.

I can't remember if we discussed this one, but IMO they should be two
lines. Which probably means that the group will want them one line,
since I seem to be diametrically opposed to the norm on style :-)

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 994 6435|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 994 6472|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: indent, line splitting?

Posted by Dean Gaudet <dg...@arctic.org>.

On Mon, 15 Sep 1997, Roy T. Fielding wrote:

> We definitely need to hand edit a file after it has been indent'd.
> I spent about two hours per non-header file doing that the other night,
> but that was mostly because I think the core files need extra attention
> to readability.

I've been using "cvs diff" after the indent then studying that.  The main
things I've had to tweak I posted about ... others include:

- improper comment indenting:

    /* foo
       * bar
       * baf
     */

- indenting non-preprocessor stuff 5 spaces after a #ifdef/#endif:

#ifdef blue
     extern int black ();
     extern void white ();
#endif

    I dunno where it came up with 5 spaces ...

- other random 5 space indentations

- it gets confused by API_EXPORT sometimes and indents subsequent lines

I notice it's also taking one line things:

    if (blat) break;

and making them two lines.  But I'm not touching these, there are so
many of them.

Anything else you're noticing Roy?

GNU indent has the "-l" option to limit line length.  I haven't tried it
though ... I'm scared of it given the other brutality I've seen it commit.

Dean