The NetBSD Project

CVS log for src/usr.bin/indent/indent.h

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / indent

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.112 / (download) - annotate - [select for diffs], Sat Apr 23 06:43:22 2022 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.111: +8 -4 lines
Diff to previous 1.111 (colored)

indent: group global variables related to output control

No functional change.

Revision 1.111 / (download) - annotate - [select for diffs], Sun Feb 13 12:43:26 2022 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.110: +10 -7 lines
Diff to previous 1.110 (colored)

indent: rename parser_state.p_l_follow and paren_level

The previous variable names were misleading.

Paren_level is not the current level of parentheses but the one from the
beginning of the current output line.  For better accuracy, rename it to
line_start_paren_level.

P_l_follow is not the level of parentheses that will be active at some
point in the future, as the previous name suggested.  Instead, it is the
level of parentheses right now.  For better accuracy, rename it to
nparen.  This nicely matches its main usage, which is as index to the
parser_state.paren array.

No binary change.

Revision 1.110 / (download) - annotate - [select for diffs], Sun Feb 13 12:20:09 2022 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.109: +13 -11 lines
Diff to previous 1.109 (colored)

indent: replace bitmasking code with struct

The struct directly represents the properties of a pair of parentheses,
without forcing the human reader to decode any bitset.  This makes it
easier to find the remaining bugs in the heuristic for determining the
kind of parentheses.

No functional change outside debug mode.

Revision 1.109 / (download) - annotate - [select for diffs], Sun Feb 13 12:09:19 2022 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored)

indent: change parser_state.cast_mask to 0-based indexing

Having 1-based indexing was completely unexpected, and it didn't match
the 0-based indexing of parser_state.paren_indents.

No functional change.

Revision 1.108 / (download) - annotate - [select for diffs], Sat Feb 12 19:56:52 2022 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.107: +7 -1 lines
Diff to previous 1.107 (colored)

indent: fix indentation of enum constants in typedef (since 2019-04-04)

The solution is not elegant since it adds a small state machine inside
the parser state, but at least these states only depend on the sequence
of token types and not on any other part of the parser state.

Reported in PR#55453.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Nov 28 14:29:03 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.106: +1 -2 lines
Diff to previous 1.106 (colored)

indent: treat L"string" as a single token

There is never whitespace between the 'L' and the string literal or the
character constant. There might be a backslash-newline between them, but
that case was not handled before either.

No functional change.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Nov 28 11:49:10 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

indent: clean up and document input handling

The transformation of moving comments from after an 'if (expr)' after
the following brace has a large implementation cost (about 300 lines of
code) and makes input handling quite complicated. Document the overall
idea to save future readers some time.

No functional change.

Revision 1.105 / (download) - annotate - [select for diffs], Sat Nov 27 21:15:58 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

indent: accept a few formatting suggestions from indent

The remaining issues are still that the conditions look ambiguous even
with -eei, and that __attribute__ is broken into a separate line.

No functional change.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Nov 27 18:37:17 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

indent: rename dump functions to output

No functional change.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Nov 26 15:18:18 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.102: +3 -1 lines
Diff to previous 1.102 (colored)

indent: add buf_add_range for adding characters to a buffer

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Nov 25 18:48:37 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

indent: rename ps.in_function_parameters to match reality

This flag is only set while parsing the parameters of a function
definition, but not for a function declaration. See buffer_add in the
test fmt_decl.

No functional change.

Revision 1.101 / (download) - annotate - [select for diffs], Thu Nov 25 07:47:55 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored)

indent: fix comment for ps.in_decl

In C, there are no declaration statements. There are declarations and
statements, but no combination thereof.

Revision 1.100 / (download) - annotate - [select for diffs], Thu Nov 25 07:45:32 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.99: +3 -4 lines
Diff to previous 1.99 (colored)

indent: rename ps.in_stmt to in_stmt_or_decl

The previous name didn't match reality.

No functional change.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Nov 25 07:41:13 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

indent: rename ps.ind_stmt to in_stmt_cont

This makes a comment redundant.

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Fri Nov 19 20:23:17 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.97: +26 -1 lines
Diff to previous 1.97 (colored)

indent: reduce casts to unsigned char for character classification

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Nov 19 19:55:15 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.96: +2 -5 lines
Diff to previous 1.96 (colored)

indent: replace ps.procname with ps.is_function_definition

Omly the first character of ps.procname was ever read, and it was only
compared to '\0'.  Using a bool for this means simpler code, less
memory and fewer wasted CPU cycles due to the removed strncpy.

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Fri Nov 19 18:25:50 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.95: +1 -15 lines
Diff to previous 1.95 (colored)

indent: unexport inbuf

No functional change.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Nov 19 18:23:59 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.94: +2 -1 lines
Diff to previous 1.94 (colored)

indent: use character input API from pr_comment.c

No functional change.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Nov 19 18:14:18 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.93: +8 -1 lines
Diff to previous 1.93 (colored)

indent: remove all references to inbuf from indent.c

No functional change.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Nov 19 17:59:16 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.92: +4 -1 lines
Diff to previous 1.92 (colored)

indent: move character input handling from indent.c to io.c

No functional change.

Revision 1.92 / (download) - annotate - [select for diffs], Fri Nov 19 17:42:45 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.91: +12 -1 lines
Diff to previous 1.91 (colored)

indent: move character input from indent.c to io.c

No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Nov 19 17:30:10 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.90: +3 -1 lines
Diff to previous 1.90 (colored)

indent: use character input API from the tokenizer

No functional change.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Nov 19 17:20:57 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.89: +2 -1 lines
Diff to previous 1.89 (colored)

indent: move character input handling from lexi.c to io.c

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Nov 19 17:11:46 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.88: +3 -1 lines
Diff to previous 1.88 (colored)

indent: replace direct access to the input buffer

This is a preparation for abstracting away all the low-level details of
handling the input.  The goal is to fix the current bugs regarding line
number counting, out of bounds memory access, and generally unreadable
code.

No functional change.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Nov 19 15:32:13 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.87: +5 -8 lines
Diff to previous 1.87 (colored)

indent: rename input buffer variables

From reading the names 'save_com' and 'sc_end', it was not obvious
enough that these two variables are the limits of the same buffer, the
names were just too unrelated.

No functional change.

Revision 1.87 / (download) - annotate - [select for diffs], Fri Nov 19 15:28:32 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.86: +15 -14 lines
Diff to previous 1.86 (colored)

indent: group variables for input handling

No functional change.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Nov 7 18:26:17 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.85: +15 -7 lines
Diff to previous 1.85 (colored)

indent: various cleanups

Make several comments more precise.

Rename process_end_of_file to process_eof to match the token name.

Change the order of assignments in analyze_comment to keep the com_ind
computations closer together.

In copy_comment_wrap, use pointer difference instead of pointer addition
to stay away from undefined behavior.

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Nov 7 15:18:25 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.84: +3 -2 lines
Diff to previous 1.84 (colored)

indent: rename ps.decl_nest to decl_level

This better matches the comment.

No functional change.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Nov 7 14:00:35 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.83: +3 -2 lines
Diff to previous 1.83 (colored)

indent: reduce negations in process_else, clean up comments

No functional change.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Nov 7 13:43:11 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.82: +4 -2 lines
Diff to previous 1.82 (colored)

indent: document the comment buffer more accurately

Revision 1.82 / (download) - annotate - [select for diffs], Sun Nov 7 08:24:50 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.81: +3 -2 lines
Diff to previous 1.81 (colored)

indent: split copy_comment into wrapping and non-wrapping

These two cases are processed in an almost entirely different way. In
particular, copy_comment_nowrap should copy the comment verbatim, which
is not obvious from the current code, due to the many conditions and the
complex control flow.

No functional change.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Nov 7 07:44:59 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

indent: rename type_at_paren_level_0 to type_outside_parentheses

For symmetry with type_in_parentheses.

No functional change.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Nov 7 07:35:06 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.79: +3 -4 lines
Diff to previous 1.79 (colored)

indent: distinguish between typename in parentheses and other words

This gets rid of two members of parser_state. No functional change for
well-formed programs. The sequence of '++int' or '--size_t' may be
formatted differently than before, but no program is expected to contain
that sequence.

Rename lsym_ident to lsym_word since 'ident' was too specific. This
token type is used for constants and string literals as well. Strictly
speaking, a string literal is not a word, but at least it's better than
before.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Nov 7 07:06:00 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.78: +4 -4 lines
Diff to previous 1.78 (colored)

indent: rename 'inbuf' functions to 'inp'

The variable 'inp' used to be named 'inbuf'. Make the function names
correspond to the variable name again.

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Fri Nov 5 21:39:12 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (colored)

indent: the '+ 1' in dump_line_code is not an off-by-one error

Revision 1.77 / (download) - annotate - [select for diffs], Fri Nov 5 19:33:28 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

indent: rename ps.curr_newline to next_col_1

For symmetry with ps.curr_col_1.

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Nov 3 21:47:35 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.75: +2 -3 lines
Diff to previous 1.75 (colored)

indent: inline indentation_after, shorten function name to ind_add

There were only few calls to indentation_after, so inlining it spares
the need to look at yet another function definition. Another effect is
that code.s and code.e appear in the code as a pair now, instead of a
single code.s, making the scope of the function call obvious.

In ind_add, there is no need to check for '\0' anymore since none of the
buffers can ever contain a null character, these are filtered out by
inbuf_read_line.

No functional change.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Nov 1 23:44:08 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

indent: fix missing blank after 'return' (since 2021-10-31)

In indent.c 1.200 from 2021-10-31, the subtypes of identifier tokens
were removed since they were redundant. An unintended side effect was
that a parenthesized expression after 'return' was no longer separated
by a blank.

Before that change, 'return' was tokenized as an lsym_ident with subtype
kw_other, and want_space_before_lparen handled this case in the last
line. After the change, 'return' was treated as an ordinary identifier,
and unless the option '-pcs' (blank after function call) was given, the
blank was removed.

The other keywords that had kw_other are not affected since they do not
expect a '(' afterwards. These keywords are 'break', 'continue', 'goto',
'inline' and 'restrict'.

Curiously, there was not a single test case that covered 'return(expr)'.

While here, remove the trailing ',' from the enum lexer_symbol, which is
not allowed in standard C, it is a GNU extension. Lint doesn't complain
about this since the default LINTFLAGS include '-g' for GCC mode.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Oct 31 22:38:12 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (colored)

indent: clean up

Initialize buffers in reading order, make comments more expressive,
rename add_typename to register_typename, remove unused macro.

No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Oct 31 20:40:42 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.72: +3 -10 lines
Diff to previous 1.72 (colored)

indent: replace kw_tag with lsym_tag

This leaves only one special type of token, which is lsym_ident, which
in some cases represents a type name and in other cases an identifier,
constant or string literal.

No functional change.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Oct 31 19:57:44 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.71: +2 -14 lines
Diff to previous 1.71 (colored)

indent: replace simple cases of keyword_kind with lexer_symbol

The remaining keyword kinds 'tag' and 'type' require a bit more thought,
so do them in a separate step.

No functional change.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Oct 31 19:20:52 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

indent: rename lsym_type to better reflect reality

Type names that occur in parentheses are parsed as lsym_ident having the
subtype kw_type instead.

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Oct 31 10:09:43 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.69: +2 -1 lines
Diff to previous 1.69 (colored)

indent: add separate lexer symbol for offsetof

No functional change.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Oct 31 10:00:37 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.68: +2 -1 lines
Diff to previous 1.68 (colored)

indent: add separate lexer symbol for sizeof

The plan is to get rid of the type keyword_kind, which largely overlaps
with lexer_symbol.

No functional change.

Revision 1.68 / (download) - annotate - [select for diffs], Sun Oct 31 09:52:37 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.67: +3 -4 lines
Diff to previous 1.67 (colored)

indent: clean up definition of keywords

Rename kw_struct_or_union_or_enum to the shorter kw_tag.

Merge kw_jump with kw_inline_or_restrict since they are handled in the
same way.

No functional change.

Revision 1.67 / (download) - annotate - [select for diffs], Sat Oct 30 22:41:18 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.66: +8 -10 lines
Diff to previous 1.66 (colored)

indent: move debugging functions to a separate section

Revision 1.66 / (download) - annotate - [select for diffs], Sat Oct 30 22:36:07 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.65: +4 -5 lines
Diff to previous 1.65 (colored)

indent: rename prev_newline and prev_col_1 to curr

These two flags describe the token that is currently processed.

In process_binary_op, curr_newline can never be true since newline is
not a binary operator, so remove that condition.

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Oct 30 22:15:51 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

indent: clean up lexical analyzer

Use traditional type for small unsigned numbers instead of uint8_t; the
required header was not included.

Remove assertion for debug mode; lint takes care of ensuring that the
enum constants match the length of the names array.

Constify a name array.

Move the comparison function for bsearch closer to its caller.

No functional change.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Oct 30 11:49:38 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.63: +1 -3 lines
Diff to previous 1.63 (colored)

indent: inline macro label_offset

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Oct 29 21:56:36 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored)

indent: fix missing blank before binary operator

Revision 1.62 / (download) - annotate - [select for diffs], Fri Oct 29 20:27:42 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

indent: merge isblank and is_hspace into ch_isblank

No functional change.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Oct 29 18:18:03 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.60: +16 -10 lines
Diff to previous 1.60 (colored)

indent: reorder global variables to be more intuitive

The buffer 'inp' comes first. From there, a single token is read into
the buffer 'token'. From there, it usually ends up in 'code'. The buffer
'token' does not belong to the group of the other 3 buffers, which
together make up a line of formatted output.

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Oct 29 17:50:37 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.59: +8 -7 lines
Diff to previous 1.59 (colored)

indent: use prev/curr/next to refer to the current token

The word 'last' just didn't match with 'next'.

No functional change.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Oct 29 17:41:56 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.58: +51 -39 lines
Diff to previous 1.58 (colored)

indent: group members of parser_state by topic

No functional change.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Oct 29 17:32:22 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored)

indent: rename ps.dumped_decl_indent and indent_declaration

The word 'dump' in 'ps.dumped_decl_indent' was too close to dump_line,
which led to confusion since the variable controls whether the
indentation has been added to the code buffer, which happens way before
actually dumping the current line to the output file.

The function name 'indent_declaration' was too unspecific, it did not
reveal where the indentation of the declaration actually happened.

No functional change.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Oct 29 16:59:35 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

indent: keep p_l_follow nonnegative, use consistent comparison

No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Fri Oct 29 16:54:51 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.55: +8 -7 lines
Diff to previous 1.55 (colored)

indent: spell 'parentheses' properly in messages and comments

Revision 1.55 / (download) - annotate - [select for diffs], Thu Oct 28 22:20:08 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

indent: clean up indentation, comments, reduce

No functional change.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Oct 28 21:56:26 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

indent: reduce negations in search_stmt_lookahead

No functional change.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Oct 28 21:51:43 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored)

indent: clean up comments and function names

Having accurate names for the lexer symbols and the parser symbols makes
most of the comments redundant. Remove these.

Rename process_decl to process_type, to match the name of the
corresponding lexer symbol. In this phase, it's just a single type
token, not a whole declaration.

No functional change.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Oct 26 20:43:35 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.51: +3 -2 lines
Diff to previous 1.51 (colored)

indent: make ps.keyword easier to understand

Previously, ps.keyword did not have any documentation and was not
straight-forward. In some cases it was reset to kw_0, in others it was
set to an interesting value. The idea behind it was to remember the kind
of word of the previous token, to decide whether to have a space between
sizeof or offsetof and a following '('.

No functional change.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 26 19:36:30 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

indent: run indent on its own source code

With manual corrections afterwards, to compensate for the remaining bugs
in indent.

Without the type definitions in .indent.pro, the opening braces of the
functions kw_name and lexi_alnum would not be at the beginning of the
line.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 25 19:56:03 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.49: +4 -4 lines
Diff to previous 1.49 (colored)

indent: rename search_brace to search_stmt

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Oct 25 00:54:37 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.48: +65 -49 lines
Diff to previous 1.48 (colored)

indent: split type token_type into 3 separate types

Previously, token_type was used for 3 different purposes:

1. symbol types from the lexer
2. symbol types on the parser stack
3. kind of control statement for 'if (expr)' and similar statements

Splitting the 41 constants into separate types makes it immediately
clear that the parser stack never handles comments, preprocessing lines,
newlines, form feeds, the inner structure of expressions.

Previously, the constant switch_expr was especially confusing since it
was used for 3 different purposes: when returned from lexi, it
represented the keyword 'switch', in the parser stack it represented
'switch (expr)', and it was used for a statement head as well.

The only overlap between the lexer symbols and the parser symbols are
'{' and '}', and the keywords 'do' and 'else'. To increase confusion,
the constants of the previous token_type were in apparently random
order and before 2021, they had cryptic, highly abbreviated names.

No functional change.

Revision 1.48 / (download) - annotate - [select for diffs], Sun Oct 24 22:44:13 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

indent: rename form_feed to tt_lex_form_feed

No functional change.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Oct 24 22:38:20 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.46: +7 -3 lines
Diff to previous 1.46 (colored)

indent: split kw_for_or_if_or_while into separate constants

No functional change.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Oct 24 22:28:06 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.45: +7 -5 lines
Diff to previous 1.45 (colored)

indent: split kw_do_or_else into separate constants

It was unnecessarily confusing to have the token types keyword_do_else,
keyword_do and keyword_else at the same time, without any hint in what
they differed.

Some of the token types seem to be used by the lexer while others are
used in the parse stack. Maybe all token types can be partitioned into
these groups, which would suggest to use two different types for them.
And if not, it's still clearer to have this distinction in the names of
the constants.

No functional change.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Oct 24 11:19:25 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.44: +2 -4 lines
Diff to previous 1.44 (colored)

indent: rename nitems to array_length

Revision 1.44 / (download) - annotate - [select for diffs], Sun Oct 24 11:17:05 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.43: +2 -3 lines
Diff to previous 1.43 (colored)

indent: replace global variable use_ff with function parameter

Revision 1.43 / (download) - annotate - [select for diffs], Wed Oct 20 05:41:57 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

indent: add reminder to make the code understandable for humans

Revision 1.42 / (download) - annotate - [select for diffs], Wed Oct 20 05:37:21 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

indent: rename ps.last_u_d to match its comment

No functional change.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Oct 20 05:26:46 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.40: +7 -5 lines
Diff to previous 1.40 (colored)

indent: rename parser stack variables

No functional change.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Oct 20 05:14:21 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

indent: rename blankline_requested variables

The words 'prefix' and 'postfix' sounded too much like horizontal
concepts, like in operators. The actual purpose of these variables is to
add blank lines before and after the current line, so use the same
wording as in the command line options.

No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Oct 20 05:00:37 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

indent: rename next_blank_lines to blank_lines_to_output

The previous name was already an improvement over the name before that
(n_real_blanklines), but didn't express the intended purpose clearly
enough, so try another name.

No functional change.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Oct 9 11:00:27 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.37: +7 -1 lines
Diff to previous 1.37 (colored)

indent: extract common code for advancing a single tab

No functional change.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Oct 8 23:43:33 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

indent: rename in_or_st to init_or_struct

This makes a few comments redundant.

No functional change.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Oct 8 22:17:35 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.35: +1 -4 lines
Diff to previous 1.35 (colored)

indent: convert ps.box_com to local variable

This variable is only used in a single function, and that function does
not call any other function that could replace the parser state or
install a temporary parser state.

No functional change.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Oct 8 21:13:58 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

indent: rename fill_buffer to inbuf_read_line

No functional change.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Oct 8 19:03:34 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.33: +168 -171 lines
Diff to previous 1.33 (colored)

indent: run indent on indent.h

The formatting looks mostly OK.

Some struct members had excessively long names, leaving no space for
their corresponding comments. Renamed some of them using well-known
abbreviations.

The formatting for debug_vis_range is messed up, no idea why. It is
clearly a function declaration, not a function definition, so there is
no need to place the function name in column 1.

No functional change.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 8 17:19:49 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.32: +2 -3 lines
Diff to previous 1.32 (colored)

indent: replace column calculations with indent, part 4/4

Revision 1.32 / (download) - annotate - [select for diffs], Fri Oct 8 16:20:33 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

indent: rename tokens lparen and rparen to be more precise

No functional change.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Oct 8 16:16:54 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.30: +298 -3 lines
Diff to previous 1.30 (colored)

indent: merge headers into a single file

No functional change.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Oct 7 19:42:41 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

indent: remove global variable option_source

It is only needed at startup, while parsing the options. The string "?"
was not needed at all.

No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Oct 5 06:09:42 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.28: +7 -1 lines
Diff to previous 1.28 (colored)

indent: merge duplicate code into is_hspace

No functional change.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Oct 5 05:39:14 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

indent: merge duplicate code for reading from input buffer

No functional change.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Oct 3 18:44:51 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

indent: rename functions

There was no good reason for using the different verbs 'scan' and 'set'
for two functions that essentially do the same.

No functional change.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Sep 27 18:21:47 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

indent: use binary instead of linear search when adding types

No functional change.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Sep 25 22:14:21 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.24: +3 -1 lines
Diff to previous 1.24 (colored)

indent: merge duplicate code for token buffers

No functional change.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Sep 25 21:42:43 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

indent: clean up argument handling

No functional change.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Sep 25 19:49:13 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.22: +1 -2 lines
Diff to previous 1.22 (colored)

indent: reduce code and data size for lexing of numbers

Instead of having a table of strings (121 pointers + 121 data
relocations), reduce that table to the actual character data and use a
secondary table for looking up the correct row in the main table.

No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Sep 25 17:36:51 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.21: +1 -7 lines
Diff to previous 1.21 (colored)

indent: convert remaining ibool to bool

No functional change intended.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Sep 25 17:11:23 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.20: +7 -1 lines
Diff to previous 1.20 (colored)

indent: prepare for lint's strict bool mode

Before C99, C had no boolean type. Instead, indent used int for that,
just like many other programs. Even with C99, bool and int can be used
interchangeably in many situations, such as querying '!i' or '!ptr' or
'cond == 0'.

Since January 2021, lint provides the strict bool mode, which makes bool
a non-arithmetic type that is incompatible with any other type. Having
clearly separate types helps in understanding the code.

To migrate indent to strict bool mode, the first step is to apply all
changes that keep the resulting binary the same. Since sizeof(bool) is
1 and sizeof(int) is 4, the type ibool serves as an intermediate type.
For now it is defined to int, later it will become bool.

The current code compiles cleanly in C99 and C11 mode, as well as in
lint's strict bool mode. There are a few tricky places:

In args.c in 'struct pro', there are two types of options: boolean and
integer. Boolean options point to a bool variable, integer options
point to an int variable. To keep the current structure of the code,
the pointer has been changed to 'void *'. To ensure type safety, the
definition of the options is done via preprocessor magic, which in C11
mode ensures the correct pointer types. (Add CFLAGS+=-std=gnu11 at the
very bottom of the Makefile.)

In indent.c in process_preprocessing, a boolean variable is
post-incremented. That variable is only assigned to another variable,
and that variable is only used in a boolean context. To provoke a
different behavior between the '++' and the '= true', the source code
to be indented would need 1 << 32 preprocessing directives, which is
unlikely to happen in practice.

In io.c in dump_line, the variables ps.in_stmt and ps.in_decl only ever
get the values 0 and 1. For these values, the expressions 'a & ~b' and
'a && !b' are equivalent, in all versions of C. The compiler may
generate different code for them, though.

In io.c in parse_indent_comment, the assignment to inhibit_formatting
takes place in integer context. If the compiler is smart enough to
detect the possible values of on_off, it may generate the same code
before and after the change, but that is rather unlikely.

The second step of the migration will be to replace ibool with bool,
step by step, just in case there are any hidden gotchas in the code,
such as sizeof or pointer casts.

No change to the resulting binary.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 25 14:38:31 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

indent: use standard definition for bool, true, false

Revision 1.19 / (download) - annotate - [select for diffs], Sat Sep 25 14:16:06 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.18: +1 -2 lines
Diff to previous 1.18 (colored)

indent: clean up initialization of options

The default values in 'struct pro' were redundant but all consistent,
even with the commented defaults in main_parse_command_line.

No functional change.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Sep 25 13:38:32 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.17: +1 -3 lines
Diff to previous 1.17 (colored)

indent: remove ifdef for lint

NetBSD lint does not need them anymore, FreeBSD does not have lint.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Sep 25 08:23:31 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.16: +5 -1 lines
Diff to previous 1.16 (colored)

indent: add nonnull memory allocation functions

The only functional change is a single error message.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Mar 14 00:33:25 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.15: +25 -24 lines
Diff to previous 1.15 (colored)

indent: give indent a try at formatting its own code

Formatting indent.h required the following manual corrections
afterwards:

The first tab in the comment in line 1 was replaced with a space but
shouldn't be.

The spacing around the '...' in function prototypes was completely
wrong.  It looked like 'const char *,...)__printflike', without any
spaces.

The '*' of the return type 'const char *' was tied to the function name,
even though this declaration was only for a single function.  In such a
case, it's more appropriate to line up the function names.

The function-like macros were not indented to -di.  This is something
that I would not expect from indent, so it's ok to do that manually.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 13 23:42:23 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.14: +2 -4 lines
Diff to previous 1.14 (colored)

indent: remove disabled duplicate RCS ID from header

By convention, headers don't record their RCS ID.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 13 13:25:23 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

indent: rename pr_comment to process_comment, clean up documentation

No functional change.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Mar 13 10:32:25 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.12: +2 -4 lines
Diff to previous 1.12 (colored)

indent: inline calls to count_spaces and count_spaces_until

These two functions operated on column numbers instead of indentation,
which required adjustments of '+ 1' and '- 1'.  Their names were
completely wrong since these functions did not count anything, instead
they computed the column.

No functional change.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 13 10:20:54 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.11: +4 -2 lines
Diff to previous 1.11 (colored)

indent: replace column computation with indentation computation

No functional change.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Mar 13 10:06:47 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

indent: replace compute_code_column with compute_code_indent

The goal is to only ever be concerned about the _indentation_ of a
token, never the _column_ it appears in.  Having only one of these
avoids off-by-one errors.

No functional change.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Mar 13 09:54:11 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

indent: replace compute_label_column with compute_label_indent

Using the invariant 'column == 1 + indent'.  This removes several overly
complicated '+ 1' from the code that are not needed conceptually.

No functional change.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Mar 13 09:21:57 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.8: +9 -2 lines
Diff to previous 1.8 (colored)

indent: add debug logging for actually writing to the output file

Together with the results of the tokenizer and the 4 buffers for token,
label, code and comment, the debug log now provides a good high-level
view on how the indentation happens and where to look for the many
remaining bugs.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Mar 13 00:26:56 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

indent: replace pad_output with output_indent

Calculating the indentation is simpler than calculating the column,
since that saves the constant addition and subtraction of the 1.

No functional change.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Mar 12 23:27:41 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

indent: add 'const', rename variables, reorder formula for tab width

Column counting starts at 1.  This 1 should rather be at the beginning
of the formula since it is thought of being added at the very beginning
of the line, not at the end.

When adding a tab, the newly added tab is added at the end of the
string, therefore that '+ 1' should be at the end of the formula as
well.

No functional change.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Mar 12 23:16:00 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

indent: replace 'target' with 'indent' in function names

The word 'target' was not as specific as possible.

No functional change.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Mar 7 11:32:05 2021 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.4: +5 -2 lines
Diff to previous 1.4 (colored)

indent: in debug mode, output detailed token information

The main ingredient for understanding how indent works is the tokenizer
and the 4 buffers in which the text is collected.

Inspecting this debug log for the test comment-line-end makes it obvious
why indent messes up code that contains '//' comments.  The cause is
that indent interprets '//' as an operator, just like '&&' or '||'.  The
sequence '/////' is interpreted as a single operator as well, by the
way.

Since '//' is interpreted as an ordinary operator, any words following
it are plain identifiers, usually several of them in a row, which is a
syntax error.  Depending on the context, the operator '//' is either a
unary operator (no space around) or a binary operator (space around).
This explains why the word 'line-end' is expanded to 'line - end'.

No functional change outside of debug mode.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Mar 7 10:56:18 2021 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.3: +4 -4 lines
Diff to previous 1.3 (colored)

indent: for the token types, use enum instead of #define

This makes it easier to step through the code in a debugger.

No functional change.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Mar 7 10:42:48 2021 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.2: +5 -2 lines
Diff to previous 1.2 (colored)

indent: use all headers in all files

This is a prerequisite for converting the token types to an enum instead
of a preprocessor define, since the return type of lexi will become
token_type.  Having the enum will make debugging easier.

There was a single naming collision, which forced the variable in
scan_profile to be renamed.  All other token names are used nowhere
else.

No change to the resulting binary.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:43 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.1.2.2: +3 -5 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.2 / (download) - annotate - [select for diffs], Sat Oct 19 15:44:31 2019 UTC (3 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp
Changes since 1.1: +3 -5 lines
Diff to previous 1.1 (colored)

use stdarg, annotate function as __printflike and fix broken formats.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:20 2019 UTC (3 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.1.2.1: +60 -0 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

Sync with HEAD

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Thu Apr 4 20:39:17 2019 UTC (3 years, 10 months ago) by kamil
Branch: FREEBSD
CVS Tags: r340138
Changes since 1.1: +0 -10 lines
Diff to previous 1.1 (colored)

FreeBSD indent r340138

Revision 1.1.2.1, Thu Apr 4 15:27:35 2019 UTC (3 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.1: +0 -60 lines
FILE REMOVED

file indent.h was added on branch phil-wifi on 2019-06-10 22:10:20 +0000

Revision 1.1 / (download) - annotate - [select for diffs], Thu Apr 4 15:27:35 2019 UTC (3 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Branch point for: phil-wifi

Upgrade indent(1)

Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.

FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.

Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.

Major chages in this import:

 - Added an option -ldi<N> to control indentation of local variable names.
 - Added option -P for loading user-provided files as profiles
 - Added -tsn for setting tabsize
 - Rename -nsac/-sac ("space after cast") to -ncs/-cs
 - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines.
 - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
 - Group global option variables into an options structure
 - Use bsearch() for looking up type keywords.
 - Don't produce unneeded space character in function declarators
 - Don't unnecessarily add a blank before a comment ends.
 - Don't ignore newlines after comments that follow braces.

Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.

Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.

Part II, checkin new files.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>