The NetBSD Project

CVS log for src/usr.bin/indent/pr_comment.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.128 / (download) - annotate - [select for diffs], Mon May 9 21:41:49 2022 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.127: +10 -9 lines
Diff to previous 1.127 (colored)

indent: clean up control flow, remove Capsicum

No functional change.

Revision 1.127 / (download) - annotate - [select for diffs], Sat Apr 23 06:43:22 2022 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (colored)

indent: group global variables related to output control

No functional change.

Revision 1.126 / (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.125: +13 -13 lines
Diff to previous 1.125 (colored)

indent: rename dump functions to output

No functional change.

Revision 1.125 / (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.124: +4 -7 lines
Diff to previous 1.124 (colored)

indent: add buf_add_range for adding characters to a buffer

No functional change.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Nov 25 21:01:32 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.123: +5 -5 lines
Diff to previous 1.123 (colored)

indent: make fits_in_one_line independent of ps

This makes it easier to understand the function. Having the dependency
to the input line handling is already complicated enough.

No functional change.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Nov 25 20:44:09 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.122: +2 -10 lines
Diff to previous 1.122 (colored)

indent: fix accidentally joined and broken comments (since 2019-04-04)

The fixed version is not perfect as it gets the indentation of the last
line of the first comment wrong, but at least indent doesn't generate
malformed output anymore.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Nov 25 20:14:00 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.121: +14 -2 lines
Diff to previous 1.121 (colored)

tests/indent: demonstrate bugs in comment processing

Revision 1.121 / (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.120: +3 -4 lines
Diff to previous 1.120 (colored)

indent: reduce casts to unsigned char for character classification

No functional change.

Revision 1.120 / (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.119: +10 -19 lines
Diff to previous 1.119 (colored)

indent: use character input API from pr_comment.c

No functional change.

Revision 1.119 / (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.118: +14 -14 lines
Diff to previous 1.118 (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.118 / (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.117: +6 -5 lines
Diff to previous 1.117 (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.117 / (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.116: +25 -23 lines
Diff to previous 1.116 (colored)

indent: group variables for input handling

No functional change.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Nov 7 18:26:17 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.115: +11 -13 lines
Diff to previous 1.115 (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.115 / (download) - annotate - [select for diffs], Sun Nov 7 13:38:32 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.114: +2 -4 lines
Diff to previous 1.114 (colored)

indent: remove code that accessed out-of-bounds data from buffer

Saving and restoring the exact buffer position had been necessary before
NetBSD pr_comment.c 1.114. The code accessed the buffer data out of the
bounds of [com.s, com.e), which was rather surprising. More
specifically, it accessed com.e[-1] in a case where com.e == com.s,
relying on com.e[-1] being ' ' in most cases and '*' in the case where
the comment delimiter was written to a separate output line.

Make the code easier understandable by only ever accessing the buffer
data in the bounds [buf.s, buf.e).

No functional change.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Nov 7 13:30:15 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.113: +4 -4 lines
Diff to previous 1.113 (colored)

indent: only access buffer data in the range [buf.s, buf.e)

No functional change.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Nov 7 12:29:58 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.112: +3 -3 lines
Diff to previous 1.112 (colored)

indent: do not expand comment buffer unnecessarily

This may have been a simple typo or a really tricky optimization that
isn't obvious even after studying the code for several months. Either of
these is bad, so use the standard form of resetting the buffer.

No functional change.

Revision 1.112 / (download) - annotate - [select for diffs], Sun Nov 7 11:30:45 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.111: +5 -9 lines
Diff to previous 1.111 (colored)

indent: remove dead code in analyze_comment

The case of an otherwise empty line is already handled further above.

Revision 1.111 / (download) - annotate - [select for diffs], Sun Nov 7 11:08:25 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.110: +5 -11 lines
Diff to previous 1.110 (colored)

indent: remove dead code from copy_comment_wrap

C99 comments are not wrapped, therefore there is no need to check for
them in copy_comment_wrap.

No functional change.

Revision 1.110 / (download) - annotate - [select for diffs], Sun Nov 7 10:56:06 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.109: +8 -16 lines
Diff to previous 1.109 (colored)

indent: move documentation from process_comment to copy_comment_wrap

Revision 1.109 / (download) - annotate - [select for diffs], Sun Nov 7 10:49:31 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.108: +9 -12 lines
Diff to previous 1.108 (colored)

indent: clean up process_comment

The assignments to the variables were redundant, they are already done
by analyze_comment.

No functional change.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Nov 7 10:42:58 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.107: +2 -3 lines
Diff to previous 1.107 (colored)

indent: remove redundant assignment

At that point, ps.next_col_1 is already false.

No functional change.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Nov 7 10:34:03 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.106: +3 -5 lines
Diff to previous 1.106 (colored)

indent: make end of comment detection of nowrap comments simpler

No functional change.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Nov 7 10:31:12 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.105: +6 -12 lines
Diff to previous 1.105 (colored)

indent: clean up overcomplicated conditions in copy_comment_nowrap

No functional change.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Nov 7 10:26:43 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.104: +10 -13 lines
Diff to previous 1.104 (colored)

indent: skip redundant conditions in copy_comment_nowrap

No functional change.

Revision 1.104 / (download) - annotate - [select for diffs], Sun Nov 7 10:17:39 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.103: +7 -16 lines
Diff to previous 1.103 (colored)

indent: clean up copy_comment_nowrap

The action for '\f' was the same as the default action.

Replacing 'switch' with 'if' makes the code shorter.

No functional change.

Revision 1.103 / (download) - annotate - [select for diffs], Sun Nov 7 10:13:26 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.102: +7 -23 lines
Diff to previous 1.102 (colored)

indent: make copy_comment_nowrap simpler

Since a nowrap comment is copied unmodified, it need not depend on any
maximum line length.

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Nov 7 08:41:13 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.101: +4 -12 lines
Diff to previous 1.101 (colored)

indent: remove dead code from process_comment_nowrap

In comments that are preserved, no additional leading ' * ' is inserted.

No functional change.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Nov 7 08:38:27 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.100: +23 -32 lines
Diff to previous 1.100 (colored)

indent: remove dead code from copy_comment_wrap

No functional change.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Nov 7 08:31:46 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.99: +10 -71 lines
Diff to previous 1.99 (colored)

indent: remove dead code from copy_comment_nowrap

No functional change.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Nov 7 08:24:50 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.98: +145 -4 lines
Diff to previous 1.98 (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.98 / (download) - annotate - [select for diffs], Sun Nov 7 07:06:00 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.97: +9 -9 lines
Diff to previous 1.97 (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.97 / (download) - annotate - [select for diffs], Fri Nov 5 19:33:28 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.96: +5 -5 lines
Diff to previous 1.96 (colored)

indent: rename ps.curr_newline to next_col_1

For symmetry with ps.curr_col_1.

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Nov 4 18:38:37 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (colored)

indent: fix parsing of C99 comments containing '*/'

Revision 1.95 / (download) - annotate - [select for diffs], Thu Nov 4 17:37:03 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.94: +50 -32 lines
Diff to previous 1.94 (colored)

indent: split process_comments into separate functions

No functional change.

Revision 1.94 / (download) - annotate - [select for diffs], Wed Nov 3 21:47:35 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.93: +7 -7 lines
Diff to previous 1.93 (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.93 / (download) - annotate - [select for diffs], Sat Oct 30 22:36:07 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.92: +6 -6 lines
Diff to previous 1.92 (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.92 / (download) - annotate - [select for diffs], Sat Oct 30 18:23:17 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.91: +3 -6 lines
Diff to previous 1.91 (colored)

indent: fix bounds check for sc_buf

Some years ago, save_com was an array of characters, used as temporary
storage. When sc_buf was added, this code was forgotten. The bounds
check must be on the array itself, not on an iterator that points
somewhere in that array.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Oct 30 16:57:18 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.90: +3 -4 lines
Diff to previous 1.90 (colored)

indent: fix assertion in fits_in_one_line

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

indent: merge isblank and is_hspace into ch_isblank

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Oct 29 19:12:48 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.88: +8 -5 lines
Diff to previous 1.88 (colored)

indent: fix undefined behavior in buffer handling

Adding an arbitrary integer to a pointer may result in an out of bounds
pointer, so replace the addition with a pointer subtraction.

In the buffer handling functions, handle 'buf' and 'l' before 's' and
'e', since they are pairs.

In inbuf_read_line, use 's' instead of 'buf' to make the code easier to
understand for human readers.

No functional change.

Revision 1.88 / (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.87: +7 -7 lines
Diff to previous 1.87 (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.87 / (download) - annotate - [select for diffs], Tue Oct 26 21:37:27 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.86: +4 -4 lines
Diff to previous 1.86 (colored)

indent: clean up process_comment

There is no undefined behavior since the compared characters are always
from the basic execution character set. All other cases are covered by
the condition above for now_len.

Fix debug logging for non-ASCII characters, previously a character was
output as \xffffffc3.

Revision 1.86 / (download) - annotate - [select for diffs], Tue Oct 26 21:23:52 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.85: +18 -19 lines
Diff to previous 1.85 (colored)

indent: reduce indentation in process_comment

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Oct 26 21:04:03 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.84: +6 -20 lines
Diff to previous 1.84 (colored)

indent: make reformatting of comments simpler

No functional change.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Oct 25 00:54:37 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.83: +4 -3 lines
Diff to previous 1.83 (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.83 / (download) - annotate - [select for diffs], Sun Oct 24 19:14:33 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored)

indent: run indent on its own source code

With manual corrections afterwards. Indent still does not get
extra_expr_indent correctly, it also indents global variables after
tagged declarations too deep.

No functional change.

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

indent: replace global variable use_ff with function parameter

Revision 1.81 / (download) - annotate - [select for diffs], Sun Oct 24 11:08:46 2021 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.80: +5 -6 lines
Diff to previous 1.80 (colored)

indent: clean up comments

Revision 1.80 / (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.79: +3 -3 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Thu Oct 14 20:23:43 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.78: +4 -5 lines
Diff to previous 1.78 (colored)

indent: clarify that 25 is a magic number

The extra line width for comments to the very right is just that, an
arbitrarily chosen number. It neither has to be a multiple of 8, nor of
the tabsize nor of the indentation. Since 25 is neither of these, this
makes it a perfect choice, allowing these extreme comments to have 22
characters per line with -sc (leading asterisks in comment
continuations, the default) or 25 without.

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Oct 14 20:15:18 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.77: +14 -11 lines
Diff to previous 1.77 (colored)

indent: turn ps.com_ind into local variable

This makes it immediately clear that ps.com_ind is computed in the first
part of process_comment and then only used from there.

No functional change.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Oct 13 22:38:02 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.76: +21 -17 lines
Diff to previous 1.76 (colored)

indent: extract fits_in_one_line from process_comment

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Tue Oct 12 22:22:35 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.75: +5 -4 lines
Diff to previous 1.75 (colored)

indent: in process_comment, migrate int variable to bool

No functional change.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Oct 12 22:20:22 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.74: +16 -20 lines
Diff to previous 1.74 (colored)

indent: in process_comment, negate box_com to may_wrap

In the new line 213, may_wrap could only be true and was therefore a
redundant condition.

No functional change.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Oct 12 22:04:03 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.73: +8 -5 lines
Diff to previous 1.73 (colored)

indent: negate a few condition in process_comment

No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 12 21:08:37 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.72: +4 -3 lines
Diff to previous 1.72 (colored)

indent: fix formatting of single-line comments (since today)

The change in pr_comment.c 1.70 from 3 hours ago did not cover all edge
cases correctly. Now it works for comments that are aligned with tabs.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Oct 12 19:57:53 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.71: +3 -4 lines
Diff to previous 1.71 (colored)

indent: replace unreachable code with assertion

Revision 1.71 / (download) - annotate - [select for diffs], Tue Oct 12 19:56:07 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.70: +57 -40 lines
Diff to previous 1.70 (colored)

indent: use high-level buffer API for processing comments

Document the trickery of copying the last word from the previous line
since that it not obvious at all.

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Oct 12 18:22:01 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.69: +10 -15 lines
Diff to previous 1.69 (colored)

indent: fix wrapping for comments in otherwise empty lines

The comment above the code was wrong. The leading 3 characters were
indeed ignored, but the first of them was '/', not ' '. Of the trailing
3 characters, 2 were not ignored. The start and end of the comment would
not cancel out, they would rather sum up.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Oct 9 11:00:27 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored)

indent: extract common code for advancing a single tab

No functional change.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Oct 8 22:37:33 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.67: +6 -5 lines
Diff to previous 1.67 (colored)

indent: replace unreachable code with assertions

The input buffer is always supposed to be terminated with a newline. The
function inbuf_read_line silently skips null characters. Since the input
buffer is redirected to a temporary buffer in some cases, do not simply
remove this supposed dead code, but replace it with assertions.

In any case, if the code for calling inbuf_read_line had been reachable
and actually allocated a different buffer, continuing to use the pointer
p would have invoked undefined behavior anyway.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Oct 8 22:27:52 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

indent: use standard error handling for unterminated comment

Just writing it to stdout is bad, especially when indent is used in
filter mode. Silently continuing after such an error is bad as well.

echo '/*' | indent

Revision 1.66 / (download) - annotate - [select for diffs], Fri Oct 8 22:22:14 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.65: +5 -5 lines
Diff to previous 1.65 (colored)

indent: remove redundant conditions

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Oct 8 22:17:35 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.64: +18 -24 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Fri Oct 8 21:13:58 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

indent: rename fill_buffer to inbuf_read_line

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Oct 8 19:03:34 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Fri Oct 8 18:29:36 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.61: +6 -7 lines
Diff to previous 1.61 (colored)

indent: fix formatting of C99 comments

The first attempt at formatting C99 comments was conceptually wrong. It
accessed the next token in dump_line, even though that function should
only ever look at the buffers for the label, the code and the current
comment. (Understanding that part of the code was difficult at that time
due to the sheer number of global variables.) The complicated and
ever-growing condition for whether to output the token was a hack and in
retrospect doesn't make sense at all, that's why it only came close to
the intended effect.

Some unintended side effects were that the C99 comments had an
additional space in front of them, and that in some cases an empty line
followed the comment, and that the comments were not aligned.

Previously, the newline that terminates the C99 comment was included in
the comment. Separating the newline from the comment fixed all these
unintended side effects. The only downside is that the multi-line
statement is not indented, but that should be easy to fix.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Oct 8 17:26:56 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.60: +14 -15 lines
Diff to previous 1.60 (colored)

indent: reduce scope of t_ptr in process_comment

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Oct 8 17:19:49 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.59: +15 -15 lines
Diff to previous 1.59 (colored)

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

Revision 1.59 / (download) - annotate - [select for diffs], Fri Oct 8 17:12:08 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.58: +8 -8 lines
Diff to previous 1.58 (colored)

indent: replace column calculations with indent, part 3

No functional change.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Oct 7 23:15:15 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.57: +23 -23 lines
Diff to previous 1.57 (colored)

indent: group variables for the input buffer

The input buffer follows the same concept as the intermediate buffers
for label, code, comment and token, so use the same type for it.

No functional change.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Oct 7 21:57:21 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.56: +4 -3 lines
Diff to previous 1.56 (colored)

indent: use braces around multi-line statements

No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Oct 7 21:52:54 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.55: +22 -2 lines
Diff to previous 1.55 (colored)

indent: let the code breathe a bit by inserting empty lines

No functional change.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Oct 7 21:43:20 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.54: +4 -8 lines
Diff to previous 1.54 (colored)

indent: clean up comments

No functional change.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Oct 7 21:38:25 2021 UTC (15 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.53: +5 -6 lines
Diff to previous 1.53 (colored)

indent: remove redundant comments

No functional change.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Oct 5 19:58:38 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

indent: fix outdated comment, add 'const'

Revision 1.52 / (download) - annotate - [select for diffs], Tue Oct 5 06:49:19 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.51: +7 -8 lines
Diff to previous 1.51 (colored)

indent: fix spelling in comments

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 5 06:15:24 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.50: +4 -4 lines
Diff to previous 1.50 (colored)

indent: use proper escape sequence for form feed

This escape sequence has been available since at least 1978.

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

indent: merge duplicate code into is_hspace

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Oct 5 05:56:49 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.48: +7 -8 lines
Diff to previous 1.48 (colored)

indent: clean up code for appending to buffers

Use *e++ for appending and e[-1] for testing the previously appended
character, like in other places in the code.

No functional change.

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

indent: merge duplicate code for reading from input buffer

No functional change.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Sep 26 19:37:11 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.46: +25 -24 lines
Diff to previous 1.46 (colored)

indent: let indent format its own code -- in supervised mode

After running indent on the code, I manually selected each change that
now looks better than before. The remaining changes are left for later.
All in all, indent did a pretty good job, except for syntactic additions
from after 1990, but that was to be expected. Examples for such
additions are GCC's __attribute__ and C99 designated initializers.

Indent has only few knobs to tune the indentation. The knob for the
continuation indentation applies to function declarations as well as to
expressions. The knob for indentation of local variable declarations
applies to struct members as well, even if these are members of a
top-level struct.

Several code comments crossed the right margin in column 78. Several
other code comments were correctly broken though. The cause for this
difference was not obvious.

No functional change.

Revision 1.46 / (download) - annotate - [select for diffs], Sat Sep 25 22:14:21 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.45: +4 -13 lines
Diff to previous 1.45 (colored)

indent: merge duplicate code for token buffers

No functional change.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Sep 25 20:23:42 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.44: +3 -8 lines
Diff to previous 1.44 (colored)

indent: remove dead code for printing comments after empty lines

This code has been commented out for at least 29 years.

No functional change.

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

indent: convert remaining ibool to bool

No functional change intended.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Sep 25 17:11:23 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.42: +7 -7 lines
Diff to previous 1.42 (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.42 / (download) - annotate - [select for diffs], Sat Sep 25 13:38:32 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.41: +2 -6 lines
Diff to previous 1.41 (colored)

indent: remove ifdef for lint

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

Revision 1.41 / (download) - annotate - [select for diffs], Sat Sep 25 10:41:03 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

indent: move statistical values into a separate struct

No functional change.

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

indent: add nonnull memory allocation functions

The only functional change is a single error message.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Sep 25 08:04:13 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.38: +6 -6 lines
Diff to previous 1.38 (colored)

indent: group global variables for token buffer

No functional change.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Sep 25 07:55:24 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.37: +5 -5 lines
Diff to previous 1.37 (colored)

indent: group global variables for code buffer

No functional change.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Sep 24 18:47:29 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (colored)

indent: group global variables for label buffer into struct

No functional change.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Sep 24 18:14:06 2021 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.35: +53 -53 lines
Diff to previous 1.35 (colored)

indent: group global variables for the comment buffer

No functional change.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Mar 14 05:26:42 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.34: +24 -35 lines
Diff to previous 1.34 (colored)

indent: clean up check_size_comment

The additional parameter last_bl_ptr was only necessary because the last
blank was stored as a pointer into the buffer.  By storing the index in
the buffer instead, it doesn't need to be updated all the time.

No functional change.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Mar 14 04:52:10 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored)

indent: remove trailing whitespace

Revision 1.33 / (download) - annotate - [select for diffs], Sun Mar 14 04:42:17 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.32: +8 -7 lines
Diff to previous 1.32 (colored)

indent: clean up target column computation in process_comment

No functional change.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 14 01:34:13 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.31: +8 -3 lines
Diff to previous 1.31 (colored)

indent: fix off-by-one error in comment wrapping

The manual page says that the default maximum length of a comment line
is 78.  The test 'comments.0' wrongly assumed that this 78 would refer
to the maximum _column_ allowed, which is off by one.

Fix the wording in the test 'comments.0' and remove the (now satisfied)
expectation comments in the test 'token-comment.0'.

Several other tests just happened to hit that limit, fix these as well.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Mar 14 00:22:16 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

indent: fix lint warnings

No functional change.

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

indent: remove the '+ 1' from right margin calculation in comment

No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Mar 13 13:51:08 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 (colored)

indent: distinguish between 'column' and 'indentation'

column == 1 + indentation.

In addition, indentation is a relative distance while column is an
absolute position.  Therefore, don't confuse these two concepts, to
prevent off-by-one errors.

No functional change.

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

indent: rename pr_comment to process_comment, clean up documentation

No functional change.

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

indent: remove redundant parentheses

No functional change.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Mar 13 11:19:43 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.25: +18 -14 lines
Diff to previous 1.25 (colored)

indent: fix confusing variable names

The word 'col' should only be used for the 1-based column number.  This
name is completely inappropriate for a line length since that provokes
off-by-one errors.  The name 'cols' would be acceptable although
confusing since it sounds so similar to 'col'.

Therefore, rename variables that are related to the maximum line length
to 'line_length' since that makes for obvious code and nicely relates to
the description of the option in the manual page.

No functional change.

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

indent: document undefined behavior in processing of comments

No functional change.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Mar 13 10:32:25 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.23: +7 -7 lines
Diff to previous 1.23 (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.23 / (download) - annotate - [select for diffs], Sat Mar 13 10:06:47 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (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.22 / (download) - annotate - [select for diffs], Sat Mar 13 09:54:11 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Sat Mar 13 00:26:56 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (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.20 / (download) - annotate - [select for diffs], Fri Mar 12 23:16:00 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

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

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

No functional change.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Mar 12 23:10:18 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.18: +10 -18 lines
Diff to previous 1.18 (colored)

indent: use consistent indentation for 'else'

Half of the code used -ce, the other half the opposite -nce.

No functional change.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Mar 11 22:32:06 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.17: +16 -19 lines
Diff to previous 1.17 (colored)

indent: reduce indentation of check_size functions

No functional change.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Mar 11 22:28:30 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

indent: remove redundant cast after allocation functions

No functional change.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Mar 11 22:15:44 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

indent: use consistent array indexing

No functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Mar 9 16:48:28 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored)

indent: manually indent comments

It's strange that indent's own code is not formatted by indent itself,
which would be a good demonstration of its capabilities.

In its current state, I don't trust indent to get even the tokenization
correct, therefore the only safe way is to format the code manually.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Mar 8 20:15:42 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.13: +29 -7 lines
Diff to previous 1.13 (colored)

indent: convert big macros to functions

Each of these buffers is only modified in a single file.  This makes it
unnecessary to declare the macros in the global header.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 7 22:11:01 2021 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.12: +13 -6 lines
Diff to previous 1.12 (colored)

indent: fix handling of '//' end-of-line comments

Revision 1.12 / (download) - annotate - [select for diffs], Sun Mar 7 10:42:48 2021 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (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.10.16.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:20 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.10: +276 -374 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

Sync with HEAD

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

FreeBSD indent r340138

Revision 1.11 / (download) - annotate - [select for diffs], Thu Apr 4 15:22:13 2019 UTC (3 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, 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, is-mlppp-base, is-mlppp
Changes since 1.10: +276 -374 lines
Diff to previous 1.10 (colored)

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.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 25 13:23:27 2016 UTC (6 years, 11 months ago) by ginsbach
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi
Changes since 1.9: +6 -6 lines
Diff to previous 1.9 (colored)

Fix obvious contraction spelling mistakes by adding missing apostrophes.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:09 2003 UTC (19 years, 6 months ago) by agc
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, mjf-devfs2-base, mjf-devfs2, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, cherry-xenmp-base, cherry-xenmp, chap-midi-nbase, chap-midi-base, chap-midi, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.8: +29 -2 lines
Diff to previous 1.8 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 19 15:45:22 2003 UTC (19 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.7: +8 -5 lines
Diff to previous 1.7 (colored)

PR/21645: Mishka: Localized comments don't work with indent.

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 26 22:53:38 2002 UTC (20 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

Remove #ifndef'd __STDC__ code. ANSIfy.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Oct 19 03:17:29 1997 UTC (25 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.5: +331 -325 lines
Diff to previous 1.5 (colored)

WARNSify, fix .Nm usage, deprecate register, use <err.h>, KNFify (with indent!;)

Revision 1.5 / (download) - annotate - [select for diffs], Sat Oct 18 16:04:56 1997 UTC (25 years, 3 months ago) by mrg
Branch: MAIN
Changes since 1.4: +9 -5 lines
Diff to previous 1.4 (colored)

merge lite-2.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jan 9 20:20:19 1997 UTC (26 years, 1 month ago) by tls
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

RCS ID police

Revision 1.3 / (download) - annotate - [select for diffs], Sat Aug 7 06:56:51 1993 UTC (29 years, 6 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1, netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored)

do block commenting, if comment begins with slash-star-newline.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:14:28 1993 UTC (29 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Jun 6 21:52:46 1993 UTC (29 years, 8 months ago) by mrg
Branch: FREEBSD, CSRG
CVS Tags: lite-2
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

4.4BSD-Lite2

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 9 12:59:18 1993 UTC (29 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8

added, from net/2 (patch 124).

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>