|
Re: Indenting the source: msg#00035lang.nasm.devel
H. Peter Anvin wrote: Okay, I personally find the style used in outbin.c (and quite possibly other files) to be atrocious; it's hard to read and even harder to make emacs not to butcher. About 3.5 years ago, I proposed something very similar and still think it's worthwhile. At that time, (see http://groups.yahoo.com/group/nasm-devel/message/759 ) I advocated: indent -i4 -br -brs -npsl -npcs -nut -c33 -ce -cd33 -nlp -ci8 *.c Some of these (-i4 and -nut) are the same; the others are as follows: -br -- braces on if line -brs -- braces on struct declaration line -c33 -- comment indentation of 33 spaces -ce -- cuddle else and preceding '}' -cd33 -- declaration comment column = 33 -ci8 -- continuation indentation of 8 spaces -nlp -- don't line up parentheses -npcs -- no space after function call names -npsl -- don't break procedure type Also note that -kr is basically just an abbreviation for: -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss The net effect, therefore of HPA's line is: -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -ts8 -nut -sob -ss -ncs And the net effect of mine would be: -br -brs -ci8 -i4 -c33 -ce -cd33 -npsl -npcs -nut -nlp 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. Ed ------------------------------------------------------- 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> |
|---|---|---|
| Previous by Date: | Indenting the source: 00035, H. Peter Anvin |
|---|---|
| Next by Date: | Re: Indenting the source: 00035, H. Peter Anvin |
| Previous by Thread: | Indenting the sourcei: 00035, H. Peter Anvin |
| Next by Thread: | Re: Indenting the source: 00035, H. Peter Anvin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |