logo       

Re: Indenting the source: msg#00036

lang.nasm.devel

Subject: Re: Indenting the source

Ed Beroset wrote:

Therefore, while HPA's line specifies more (which is a good thing, IMHO) the only actual *differences* are as follows:

Ed: -ci8 -nlp
HPA: -ci4 -lp

To borrow an example from the indent man pages, the difference would look like this with -ci8 -nlp:

p1 = first_procedure (second_procedure (p2, p3),
third_procedure (p4, p5));

With -ci4 -lp in effect the code looks like this:

p1 = first_procedure (second_procedure (p2, p3),
third_procedure (p4, p5));


Because these are minor differences, I could endorse either, but I would very much like to have one consistently applied style throughout, no matter what that style.


OK, both of those I feel fairly strongly about. I really want the difference between statements like if, for, and while and function calls, and NASM, like most compilers, is really way too nested to be well handled by an indentation level of 8 and still have space for comments.

Linus doesn't believe in comments, so he advocates indentation by 8. To quote Andrew Morton, "however, I do."

I actually like spaces around the parens in if, for, and while statements ONLY, but it doesn't seem to be doable with GNU indent.

If this is OK with everyone else, I'll run indent over the sources and check those in as a separate checkin. It's still a flag day -- you effectively lose all change tracking across the reformat -- but at least there are no other changes involved.

I think I've effectively decided to rewrite a big chunk of the outbin file. There is way too much in there that has to be sanitized, I fear. The new design I'm sketching on has a major advantage, though: it should allow "hanging sections" (sections aligned from the top down), which very few linkers can generate.

-hpa


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise