The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.172 / (download) - annotate - [select for diffs], Sun Feb 13 12:43:26 2022 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.171: +16 -16 lines
Diff to previous 1.171 (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.171 / (download) - annotate - [select for diffs], Sun Feb 13 12:20:09 2022 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.170: +41 -11 lines
Diff to previous 1.170 (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.170 / (download) - annotate - [select for diffs], Sun Feb 13 12:09:19 2022 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.169: +5 -5 lines
Diff to previous 1.169 (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.169 / (download) - annotate - [select for diffs], Sat Feb 12 19:56:52 2022 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.168: +13 -3 lines
Diff to previous 1.168 (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.168 / (download) - annotate - [select for diffs], Sat Feb 12 15:50:14 2022 UTC (11 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.167: +18 -7 lines
Diff to previous 1.167 (colored)

indent: extend debug logging for the parser state

The member names in struct parser_state are not trustworthy, for example
in_decl does not correspond to the intuitive definition of "inside a
declaration".  To cope with this uncertainty, output the full state of
the parser state to the debug log, not only the changes.  This helps to
track the inner state for small differences in the input, such as
between 'typedef enum { TA, TB } TT' and 'enum { EA, EB } ET'.

This hopefully helps in fixing PR#55453.

No functional change outside debug mode.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Nov 28 14:29:03 2021 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +14 -7 lines
Diff to previous 1.166 (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.166 / (download) - annotate - [select for diffs], Sat Nov 27 20:58:16 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.165: +14 -8 lines
Diff to previous 1.165 (colored)

indent: illustrate probably_looking_at_definition with examples

No functional change.

Revision 1.165 / (download) - annotate - [select for diffs], Sat Nov 27 20:33:39 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.164: +12 -6 lines
Diff to previous 1.164 (colored)

indent: fix out of bounds memory access (since 2021-11-25)

Revision 1.164 / (download) - annotate - [select for diffs], Thu Nov 25 18:48:37 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.163: +6 -6 lines
Diff to previous 1.163 (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.163 / (download) - annotate - [select for diffs], Thu Nov 25 18:36:30 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.162: +14 -4 lines
Diff to previous 1.162 (colored)

indent: improve heuristic for spaces around '*' in declarations

Revision 1.162 / (download) - annotate - [select for diffs], Thu Nov 25 17:50:00 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.161: +8 -9 lines
Diff to previous 1.161 (colored)

indent: eliminate 3 negations in tokenizer

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Thu Nov 25 17:46:51 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.160: +31 -26 lines
Diff to previous 1.160 (colored)

indent: extract lex_asterisk_unary into separate function

No functional change.

Revision 1.160 / (download) - annotate - [select for diffs], Thu Nov 25 17:35:46 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.159: +24 -56 lines
Diff to previous 1.159 (colored)

indent: condense code for building tokens from characters

No functional change.

Revision 1.159 / (download) - annotate - [select for diffs], Thu Nov 25 17:28:13 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.158: +32 -30 lines
Diff to previous 1.158 (colored)

indent: in lexi, assign lsym and next_unary in consistent order

No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Thu Nov 25 17:10:53 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.157: +25 -5 lines
Diff to previous 1.157 (colored)

indent: fix heuristic for declaration/definition to post-1990 reality

Revision 1.157 / (download) - annotate - [select for diffs], Thu Nov 25 16:51:24 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored)

indent: fix space after function name for option '-pcs'

Revision 1.156 / (download) - annotate - [select for diffs], Thu Nov 25 16:41:33 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.155: +4 -3 lines
Diff to previous 1.155 (colored)

indent: fix spacing for unknown type names in declarations

Revision 1.155 / (download) - annotate - [select for diffs], Thu Nov 25 16:09:02 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.154: +17 -11 lines
Diff to previous 1.154 (colored)

indent: extract probably_looking_at_definition to separate function

This heuristic guesses wrong in many cases and will some cleanups.

No functional change.

Revision 1.154 / (download) - annotate - [select for diffs], Thu Nov 25 08:08:28 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.153: +5 -8 lines
Diff to previous 1.153 (colored)

indent: merge duplicate code for parsing 'struct s *'

No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Thu Nov 25 08:03:08 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.152: +7 -3 lines
Diff to previous 1.152 (colored)

indent: fix formatting of a few declarations involving unknown types

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

indent: rename ps.in_stmt to in_stmt_or_decl

The previous name didn't match reality.

No functional change.

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

indent: rename ps.ind_stmt to in_stmt_cont

This makes a comment redundant.

No functional change.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Nov 20 09:59:53 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.149: +2 -3 lines
Diff to previous 1.149 (colored)

indent: clean up lint annotation and tests

Revision 1.149 / (download) - annotate - [select for diffs], Sat Nov 20 09:43:03 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.148: +10 -12 lines
Diff to previous 1.148 (colored)

indent: fix tokenizing of word-like tokens (since 2019-04-04)

After a backslash-newline, the first character of the next line is only
part of the identifier if it is an identifier character.

indent-2000.10.11.14.46.04
| int             var \
|                +name = 4;
indent-2012.11.20.03.02.57

indent-2014.09.04.04.06.07
| int 		var \
|                +name = 4;
indent-2019.02.03.03.19.29

indent-2019.04.04.15.27.35
| int		var+name = 4;
indent-2021.11.19.20.23.17

indent
| int		var + name = 4;

Revision 1.148 / (download) - annotate - [select for diffs], Fri Nov 19 20:23:17 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.147: +9 -11 lines
Diff to previous 1.147 (colored)

indent: reduce casts to unsigned char for character classification

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Fri Nov 19 19:55:15 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.146: +5 -6 lines
Diff to previous 1.146 (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.146 / (download) - annotate - [select for diffs], Fri Nov 19 19:37:13 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.145: +18 -6 lines
Diff to previous 1.145 (colored)

indent: fix formatting of function definitions (since 2019-04-04)

In the definition of a function with a pointer return type, the
formatting depended on the name of the function.  Function names
matching [A-Za-z+] were formatted correctly, those containing [$0-9_]
weren't.

Revision 1.145 / (download) - annotate - [select for diffs], Fri Nov 19 19:15:55 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.144: +13 -9 lines
Diff to previous 1.144 (colored)

indent: merge duplicate code into is_identifier_part

No functional change.

Revision 1.144 / (download) - annotate - [select for diffs], Fri Nov 19 18:52:32 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.143: +9 -14 lines
Diff to previous 1.143 (colored)

indent: fix lost function name (since 2019-04-04)

When indent searched for an identifier followed by a '(', to see whether
the identifier is a function name, it didn't care that the input buffer
could be resized due to a long line, which had made the pointer 'tp'
invalid.  Fix this by stopping the search at the end of the line.  A
better approach would be to have an unlimited lookahead buffer for
situations like these.  The code that deals with character input has
already been extracted to io.c, so it's possible to implement that now.

While here, fix another access to undefined memory, after the loop.

There is still the issue of overwriting procname[0] with a blank, which
results in inconsistent formatting depending on the function name,
probably another case of accessing undefined memory, although the
results have been reproducible, but that may have been pure luck.

The formatted code looks clearly broken, but that's still better than
losing a token and destroying the whole file.

Revision 1.143 / (download) - annotate - [select for diffs], Fri Nov 19 17:30:10 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.142: +7 -9 lines
Diff to previous 1.142 (colored)

indent: use character input API from the tokenizer

No functional change.

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

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

No functional change.

Revision 1.141 / (download) - annotate - [select for diffs], Fri Nov 19 17:11:46 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.140: +34 -34 lines
Diff to previous 1.140 (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.140 / (download) - annotate - [select for diffs], Fri Nov 19 15:28:32 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.139: +48 -48 lines
Diff to previous 1.139 (colored)

indent: group variables for input handling

No functional change.

Revision 1.139 / (download) - annotate - [select for diffs], Thu Nov 18 23:26:58 2021 UTC (14 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.138: +7 -3 lines
Diff to previous 1.138 (colored)

indent: prevent use-after-free bug

Triggered by the following artificial program:

---- snip ----
int *
f
(                                                             void)
{
}
---- snap ----

Revision 1.138 / (download) - annotate - [select for diffs], Sun Nov 7 18:26:17 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.137: +4 -4 lines
Diff to previous 1.137 (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.137 / (download) - annotate - [select for diffs], Sun Nov 7 15:18:25 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

indent: rename ps.decl_nest to decl_level

This better matches the comment.

No functional change.

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

indent: move ps.p_l_follow closer to lsym_type_outside_parentheses

This makes it easier to see the relation between these two.

No functional change.

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

indent: rename type_at_paren_level_0 to type_outside_parentheses

For symmetry with type_in_parentheses.

No functional change.

Revision 1.134 / (download) - annotate - [select for diffs], Sun Nov 7 07:35:06 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.133: +16 -19 lines
Diff to previous 1.133 (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.133 / (download) - annotate - [select for diffs], Sun Nov 7 07:06:00 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.132: +23 -23 lines
Diff to previous 1.132 (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.132 / (download) - annotate - [select for diffs], Fri Nov 5 22:06:43 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.131: +9 -12 lines
Diff to previous 1.131 (colored)

indent: consistently use token.e[-1] for the last added character

No functional change.

Revision 1.131 / (download) - annotate - [select for diffs], Fri Nov 5 21:08:04 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.130: +10 -4 lines
Diff to previous 1.130 (colored)

indent: add debug output for remaining members of parser_status

Revision 1.130 / (download) - annotate - [select for diffs], Fri Nov 5 19:33:28 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.129: +7 -7 lines
Diff to previous 1.129 (colored)

indent: rename ps.curr_newline to next_col_1

For symmetry with ps.curr_col_1.

No functional change.

Revision 1.129 / (download) - annotate - [select for diffs], Mon Nov 1 23:44:08 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.128: +4 -3 lines
Diff to previous 1.128 (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.128 / (download) - annotate - [select for diffs], Sun Oct 31 22:38:12 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.127: +3 -6 lines
Diff to previous 1.127 (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.127 / (download) - annotate - [select for diffs], Sun Oct 31 20:59:26 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.126: +51 -49 lines
Diff to previous 1.126 (colored)

indent: remove redundant keyword.is_type

It is still confusing that not all type keywords end up as lsym_type.
Those that occur inside parentheses end up as identifiers instead. To
see whether an identifier is a typename, query ps.curr_is_type and
ps.prev_is_type.

No functional change.

Revision 1.126 / (download) - annotate - [select for diffs], Sun Oct 31 20:40:42 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.125: +55 -70 lines
Diff to previous 1.125 (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.125 / (download) - annotate - [select for diffs], Sun Oct 31 19:57:44 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.124: +50 -73 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Sun Oct 31 19:20:52 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.123: +6 -6 lines
Diff to previous 1.123 (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.123 / (download) - annotate - [select for diffs], Sun Oct 31 19:13:41 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.122: +2 -6 lines
Diff to previous 1.122 (colored)

indent: remove support for pre-1978 variable initialization

Revision 1.122 / (download) - annotate - [select for diffs], Sun Oct 31 17:22:47 2021 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.121: +6 -4 lines
Diff to previous 1.121 (colored)

indent: in debug log, print token subtype in same line

The keyword 'void' is parsed as lsym_type in some cases and lsym_ident
in others. Its corresponding keyword is always kw_type though. Put the
subtype into the same line as the other token information.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Oct 31 10:09:43 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.120: +4 -2 lines
Diff to previous 1.120 (colored)

indent: add separate lexer symbol for offsetof

No functional change.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Oct 31 10:00:37 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.119: +4 -2 lines
Diff to previous 1.119 (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.119 / (download) - annotate - [select for diffs], Sun Oct 31 09:52:37 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.118: +15 -16 lines
Diff to previous 1.118 (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.118 / (download) - annotate - [select for diffs], Sun Oct 31 09:41:48 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.117: +27 -47 lines
Diff to previous 1.117 (colored)

indent: condense lexi_alnum

No functional change.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Oct 30 22:36:07 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.116: +9 -9 lines
Diff to previous 1.116 (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.116 / (download) - annotate - [select for diffs], Sat Oct 30 22:25:11 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.115: +4 -5 lines
Diff to previous 1.115 (colored)

indent: in debug output, list the new token first

Revision 1.115 / (download) - annotate - [select for diffs], Sat Oct 30 22:15:51 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.114: +13 -18 lines
Diff to previous 1.114 (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.114 / (download) - annotate - [select for diffs], Fri Oct 29 23:48:50 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored)

indent: remove redundant comments, remove punctuation from debug log

The comment about 'null stmt' between braces probably meant 'no
statements between braces'.

The comments at psym_switch_expr only repeated what the code says or had
been outdated 29 years ago already since opt.case_indent does not have
to be 'one level down'.

In the debug log, the quotes around the symbol names are not necessary
after a ':'. The parse stack also does not need this much punctuation.

Reducing a do-while loop to nothing instead of a statement saves a few
CPU cycles. It works because after each lbrace, a stmt is pushed to the
parser stack. This stmt can only ever be reduced to a stmt_list but
never be removed.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Oct 29 21:31:29 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.112: +15 -6 lines
Diff to previous 1.112 (colored)

indent: in debug mode, log only differences for most ps members

Revision 1.112 / (download) - annotate - [select for diffs], Fri Oct 29 21:22:05 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.111: +50 -8 lines
Diff to previous 1.111 (colored)

indent: add detailed debug logging for the parser state

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

indent: merge isblank and is_hspace into ch_isblank

No functional change.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Oct 29 17:50:37 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.109: +17 -18 lines
Diff to previous 1.109 (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.109 / (download) - annotate - [select for diffs], Fri Oct 29 16:59:35 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.108: +5 -5 lines
Diff to previous 1.108 (colored)

indent: keep p_l_follow nonnegative, use consistent comparison

No functional change.

Revision 1.108 / (download) - annotate - [select for diffs], Fri Oct 29 16:54:51 2021 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

indent: spell 'parentheses' properly in messages and comments

Revision 1.107 / (download) - annotate - [select for diffs], Thu Oct 28 22:06:23 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.106: +63 -67 lines
Diff to previous 1.106 (colored)

indent: remove unused local variable in lexi

Since the previous commit, lexi is always called with the same argument,
so remove that parameter.

The previous commit broke the debug logging by not printing "transient
state" anymore. Replace this with "rolled back parser state" at the
caller's site.

No functional change.

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

indent: reduce negations in search_stmt_lookahead

No functional change.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Oct 26 20:43:35 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.104: +12 -11 lines
Diff to previous 1.104 (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.104 / (download) - annotate - [select for diffs], Tue Oct 26 20:17:42 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.103: +14 -11 lines
Diff to previous 1.103 (colored)

indent: fix debug logging

The parser state is not always 'ps', so the debug logging must use the
correct state as well.

Revision 1.103 / (download) - annotate - [select for diffs], Tue Oct 26 19:36:30 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.102: +8 -8 lines
Diff to previous 1.102 (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.102 / (download) - annotate - [select for diffs], Tue Oct 26 18:36:25 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.101: +7 -9 lines
Diff to previous 1.101 (colored)

indent: merge duplicate code in lexi_alnum

Revision 1.101 / (download) - annotate - [select for diffs], Mon Oct 25 21:33:24 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.100: +43 -11 lines
Diff to previous 1.100 (colored)

indent: improve debug logging

Output the various details in chronological order.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Oct 25 00:54:37 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.99: +98 -77 lines
Diff to previous 1.99 (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.99 / (download) - annotate - [select for diffs], Sun Oct 24 22:44:13 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.98: +4 -4 lines
Diff to previous 1.98 (colored)

indent: rename form_feed to tt_lex_form_feed

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Oct 24 22:38:20 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.97: +14 -8 lines
Diff to previous 1.97 (colored)

indent: split kw_for_or_if_or_while into separate constants

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Sun Oct 24 22:28:06 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.96: +12 -8 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Sun Oct 24 20:47:00 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.95: +5 -5 lines
Diff to previous 1.95 (colored)

indent: define lexi_end as function instead of macro

Revision 1.95 / (download) - annotate - [select for diffs], Sun Oct 24 19:14:33 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.94: +7 -7 lines
Diff to previous 1.94 (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.94 / (download) - annotate - [select for diffs], Sun Oct 24 11:19:25 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.93: +5 -5 lines
Diff to previous 1.93 (colored)

indent: rename nitems to array_length

Revision 1.93 / (download) - annotate - [select for diffs], Sun Oct 24 10:54:12 2021 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

indent: sort includes

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

indent: rename ps.last_u_d to match its comment

No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Oct 11 20:31:06 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.90: +6 -5 lines
Diff to previous 1.90 (colored)

indent: use separate variables for lexi_alnum and lexi

These two uses of the variable are independent of each other.

No functional change.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Oct 11 20:13:46 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.89: +15 -23 lines
Diff to previous 1.89 (colored)

indent: clean up comments in lexi and lexi_alnum

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Oct 11 19:55:35 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.88: +118 -114 lines
Diff to previous 1.88 (colored)

indent: extract lexi_alnum from lexi

No functional change.

Revision 1.88 / (download) - annotate - [select for diffs], Sat Oct 9 20:07:37 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.87: +4 -5 lines
Diff to previous 1.87 (colored)

indent: fix lint warning about bsearch discarding 'const'

lexi.c(433): warning: call to 'bsearch' effectively discards 'const'
    from argument [346]

Revision 1.87 / (download) - annotate - [select for diffs], Fri Oct 8 23:55:44 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.86: +17 -18 lines
Diff to previous 1.86 (colored)

indent: merge duplicate code in lexer

No functional change.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Oct 8 23:43:33 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

indent: rename in_or_st to init_or_struct

This makes a few comments redundant.

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Oct 8 23:40:08 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.84: +2 -3 lines
Diff to previous 1.84 (colored)

indent: remove 'global' from the list of keywords

Since 1978, 'global' has not been a keyword in C. Moreover, it was
declared as a type while its name would rather suggest a storage class.

Removing the keyword fixes the formatting of variables named 'global'.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Oct 8 21:24:40 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.83: +31 -44 lines
Diff to previous 1.83 (colored)

indent: clean up typename handling

Unexport typenames list.

Replace standard binary search with custom binary search that returns
the inserting position.

In is_typename, take advantage of the buffer type instead of using
the standard C recipe for str_ends_with.

No functional change.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Oct 8 21:18:43 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.82: +18 -18 lines
Diff to previous 1.82 (colored)

indent: enhance comments for lex_number state machine

No functional change.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Oct 8 21:16:23 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.81: +9 -9 lines
Diff to previous 1.81 (colored)

indent: improve local variable names

No functional change.

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

indent: rename fill_buffer to inbuf_read_line

No functional change.

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

indent: constify detection of function names

No functional change.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Oct 8 16:20:33 2021 UTC (15 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.78: +9 -7 lines
Diff to previous 1.78 (colored)

indent: rename tokens lparen and rparen to be more precise

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Oct 7 23:15:15 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.77: +47 -47 lines
Diff to previous 1.77 (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.77 / (download) - annotate - [select for diffs], Thu Oct 7 22:52:13 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.76: +4 -7 lines
Diff to previous 1.76 (colored)

indent: clean up code, remove outdated wrong comments

No functional change.

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

indent: use braces around multi-line statements

No functional change.

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

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

No functional change.

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

indent: fix wrong or outdated comments

No functional change.

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

indent: raise WARNS from the default 5 up to 6

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

indent: use buffer type in debug_print_buf

That function had been created before 'struct buffer' was invented,
therefore it used two pointers as parameters. Remove this redundancy.

No functional change.

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

indent: run indent on lexi.c, with manual corrections

The variables 'keywords' and 'typenames' were indented using 8 spaces,
even though -di0 was in effect, which should result in a single space,
and -ut was in effect, which should result in a single tab instead of 8
spaces.

The option -eei does not work as advertised, the controlling expressions
are only indented by the normal amount, which easily leads to confusion
as to whether the code belongs to the condition or the following
statement.

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

indent: untangle complicated condition in probably_typedef

No functional change.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Oct 5 06:15:24 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: use proper escape sequence for form feed

This escape sequence has been available since at least 1978.

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

indent: merge duplicate code into is_hspace

No functional change.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Oct 5 05:56:49 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: 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.66 / (download) - annotate - [select for diffs], Tue Oct 5 05:39: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: merge duplicate code for reading from input buffer

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Oct 3 20:35:59 2021 UTC (15 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

indent: fix lint warning about signed '>>'

Lint couldn't infer that indent's list of type names will practically
never contain more that 2 billion entries and that the result of '>>'
would be the same in all cases.

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

indent: use binary instead of linear search when adding types

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Sep 27 17:33:07 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.62: +18 -9 lines
Diff to previous 1.62 (colored)

indent: extract is_typename from lexi

No functional change.

Revision 1.62 / (download) - annotate - [select for diffs], Mon Sep 27 16:56:35 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.61: +72 -74 lines
Diff to previous 1.61 (colored)

indent: rename rwcode to keyword_kind, various cleanup

No idea what the 'rw' in 'rwcode' meant, it had been imported that way
28 years ago. Since rwcode specifies the kind of a keyword, the prefix
'kw_' makes sense.

No functional change.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Sep 26 21:23:31 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.60: +5 -5 lines
Diff to previous 1.60 (colored)

indent: unexport global variables

The variable match_state was write-only and was thus removed.

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Sep 26 21:05:48 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.59: +11 -23 lines
Diff to previous 1.59 (colored)

indent: unexport keyword table, clean up

No functional change.

Revision 1.59 / (download) - annotate - [select for diffs], Sun Sep 26 19:37:11 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.58: +22 -20 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Sat Sep 25 22:14:21 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.57: +4 -11 lines
Diff to previous 1.57 (colored)

indent: merge duplicate code for token buffers

No functional change.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Sep 25 20:05:55 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.56: +17 -14 lines
Diff to previous 1.56 (colored)

indent: extract probably_typedef into separate function

This condition is complicated enough that it warrants being split into
several clauses, maybe even with an explanation.

No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Sep 25 19:49:13 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.55: +48 -44 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Sat Sep 25 17:36:51 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored)

indent: convert remaining ibool to bool

No functional change intended.

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

indent: remove ifdef for lint

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

Revision 1.52 / (download) - annotate - [select for diffs], Sat Sep 25 10:24:10 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.51: +17 -23 lines
Diff to previous 1.51 (colored)

indent: make lex_char_or_string simpler

The previous code was so tricky that every second line needed a comment
that explains what's going on.  Replace the complicated code with the
usual straight-forward string-copying patterns.

No functional change.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Sep 25 08:23:31 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.50: +8 -18 lines
Diff to previous 1.50 (colored)

indent: add nonnull memory allocation functions

The only functional change is a single error message.

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

indent: group global variables for token buffer

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Sep 25 07:59:52 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.48: +7 -7 lines
Diff to previous 1.48 (colored)

indent: inline macro 'token'

No functional change.

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

indent: group global variables for code buffer

No functional change.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Sep 25 07:46:41 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.46: +36 -52 lines
Diff to previous 1.46 (colored)

indent: rename variables of type token_type

The previous variable name 'code' conflicts with the buffer of the same
name.

No functional change.

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

indent: group global variables for label buffer into struct

No functional change.

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

indent: group global variables for the comment buffer

No functional change.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Sep 24 06:23:35 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

indent: fix space-tab in indentation

Revision 1.43 / (download) - annotate - [select for diffs], Thu Aug 26 07:03:00 2021 UTC (17 months ago) by rillig
Branch: MAIN
Changes since 1.42: +74 -56 lines
Diff to previous 1.42 (colored)

indent: extract lex_number, lex_word, lex_char_or_string

No functional change.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Aug 25 22:26:30 2021 UTC (17 months ago) by rillig
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored)

indent: fix lint warnings about type conversions on ilp32

No functional change.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Mar 14 00:22:16 2021 UTC (22 months, 2 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.40: +3 -3 lines
Diff to previous 1.40 (colored)

indent: fix lint warnings

No functional change.

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

indent: remove redundant parentheses

No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Mar 13 09:21:57 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.38: +8 -18 lines
Diff to previous 1.38 (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.38 / (download) - annotate - [select for diffs], Fri Mar 12 23:10:18 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.37: +9 -12 lines
Diff to previous 1.37 (colored)

indent: use consistent indentation for 'else'

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

No functional change.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Mar 12 18:11:50 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

indent: fix misleading indentation in indent's own code

No functional change.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 12 17:46:48 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.35: +18 -18 lines
Diff to previous 1.35 (colored)

indent: move code for tokenizing numbers further up

Having it directly below the table makes it easier understandable.

I also tried to omit this function entirely by moving the code into the
initializer itself, but that made the code redundant and furthermore
increased the size of the resulting binary, probably because of the new
relocation records.

No functional change.

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

indent: reduce indentation of check_size functions

No functional change.

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

indent: remove redundant cast after allocation functions

No functional change.

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

indent: use consistent array indexing

No functional change.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Mar 11 21:47:36 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.31: +37 -38 lines
Diff to previous 1.31 (colored)

indent: merge duplicate code for reading from the input buffer

No functional change.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Mar 9 19:23:08 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.30: +16 -16 lines
Diff to previous 1.30 (colored)

indent: rename a few more token types

The previous names were either too short or ambiguous.

No functional change.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Mar 9 19:14:39 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.29: +9 -9 lines
Diff to previous 1.29 (colored)

indent: make token names more precise

The previous 'casestmt' was wrong since a case label is not a statement
at all.

The previous 'swstmt' was overly short, and wrong as well, since it
represents only the 'switch (expr)' part, which is not a complete switch
statement.  Same for 'ifstmt', 'whilestmt', 'forstmt'.

The previous word 'head' was not precise enough since it didn't specify
exactly where the head ends and the body starts.  Especially for
handling the dangling else, this distinction is important.

No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Mar 9 18:28:10 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 (colored)

indent: rename a few tokens to be more obvious

For casual readers it is not obvious whether the 'sp' meant 'special' or
'space' or something entirely different.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Mar 9 16:48:28 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Mon Mar 8 21:13:33 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.26: +15 -12 lines
Diff to previous 1.26 (colored)

indent: split bsearch comparison function

It may have been a clever trick to use the same memory layout for struct
templ and a string pointer, but it's not worth the extra comment and
difficulty in understanding the code.

No functional change.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 8 20:20:11 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

indent: inline macro for backslash

No functional change.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Mar 8 20:15:42 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.24: +24 -9 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Sun Mar 7 22:11:01 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

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

Revision 1.23 / (download) - annotate - [select for diffs], Sun Mar 7 20:47:13 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

indent: remove redundant parentheses around return value

No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Mar 7 20:40:18 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.21: +8 -8 lines
Diff to previous 1.21 (colored)

lint: move keyword 'continue' over to the other control flow keywords

No functional change since neither rw_jump nor rw_inline_or_restrict is
mentioned in any switch statement, and lint didn't find any other
suspicious enum operations.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Mar 7 20:30:48 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.20: +58 -60 lines
Diff to previous 1.20 (colored)

indent: use named constants for the different types of keywords

This reduces the magic numbers in the code.  Most of these had their
designated constant name written in a nearby comment anyway.

The one instance where arithmetic was performed on this new enum type
(in indent.c) was a bit tricky to understand.

The combination rw_continue_or_inline_or_restrict looks strange, the
'continue' should intuitively belong to the other control flow keywords
in rw_break_or_goto_or_return.

No functional change.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Mar 7 11:32:05 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.19: +74 -17 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Sun Mar 7 10:56:18 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.18: +5 -5 lines
Diff to previous 1.18 (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.18 / (download) - annotate - [select for diffs], Sun Mar 7 10:42:48 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.17: +2 -4 lines
Diff to previous 1.17 (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.14.16.2 / (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.14.16.1: +3 -3 lines
Diff to previous 1.14.16.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.17 / (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.16: +3 -3 lines
Diff to previous 1.16 (colored)

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

Revision 1.14.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.14: +577 -545 lines
Diff to previous 1.14 (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, 9 months ago) by kamil
Branch: FREEBSD, CSRG
CVS Tags: r340138
Changes since 1.1.1.1: +339 -245 lines
Diff to previous 1.1.1.1 (colored)

FreeBSD indent r340138

Revision 1.16 / (download) - annotate - [select for diffs], Thu Apr 4 15:22:13 2019 UTC (3 years, 9 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
Changes since 1.15: +577 -547 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Sun Feb 3 03:19:29 2019 UTC (3 years, 11 months ago) by mrg
Branch: MAIN
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored)

- add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jun 5 18:35:32 2016 UTC (6 years, 7 months ago) by dholland
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.13: +3 -3 lines
Diff to previous 1.13 (colored)

Fix CSRG-era typo: typedef, not typdef. Spotted by Piotr Stefaniak.

Revision 1.12.42.1 / (download) - annotate - [select for diffs], Wed May 13 19:19:52 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.12: +9 -10 lines
Diff to previous 1.12 (colored) next main 1.13 (colored)

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html

Revision 1.13 / (download) - annotate - [select for diffs], Sun Apr 12 11:09:49 2009 UTC (13 years, 9 months ago) by lukem
Branch: MAIN
CVS Tags: 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, 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, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Changes since 1.12: +9 -10 lines
Diff to previous 1.12 (colored)

Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare)

Revision 1.12 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:09 2003 UTC (19 years, 5 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, 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, 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-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-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, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: jym-xensuspend
Changes since 1.11: +29 -2 lines
Diff to previous 1.11 (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.11 / (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.10: +4 -6 lines
Diff to previous 1.10 (colored)

Remove #ifndef'd __STDC__ code. ANSIfy.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 22 22:30:02 2002 UTC (20 years, 10 months ago) by kristerw
Branch: MAIN
CVS Tags: 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
Changes since 1.9: +25 -10 lines
Diff to previous 1.9 (colored)

Recognize all C9x integer constants (ISO/IEC 9899:1999 section 6.4.4.1)
Patch taken from FreeBSD.

Fixes PR bin/9219.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Mar 15 20:28:45 1999 UTC (23 years, 10 months ago) by kristerw
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, 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, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.8: +13 -3 lines
Diff to previous 1.8 (colored)

Made indent recognize the [fF], [uU], [lL], [uU][lL], [lL][lL], and
[uU][lL][lL] constant suffixes. (PR bin/6516 by Brian Ginsbach)

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 19 17:00:08 1998 UTC (24 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.7: +9 -7 lines
Diff to previous 1.7 (colored)

char -> unsigned char, braces for gcc-2.8.1

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 25 20:59:38 1998 UTC (24 years, 5 months ago) by ross
Branch: MAIN
Changes since 1.6: +11 -6 lines
Diff to previous 1.6 (colored)

Add { and } to shut up egcs. Reformat the more questionable code.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Oct 19 03:17:25 1997 UTC (25 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: 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
Changes since 1.5: +457 -449 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:49 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], Tue Sep 9 09:28:19 1997 UTC (25 years, 4 months ago) by agc
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Bump number of elements in specials array from 100 to 1000.
Typedefs are added to this array, and it silently ignores
any attempts to enter more elements when the array is full.

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

RCS ID police

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:14:31 1993 UTC (29 years, 6 months ago) by mycroft
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.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:33 1993 UTC (29 years, 7 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:15 1993 UTC (29 years, 9 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>