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.242 / (download) - annotate - [select for diffs], Sun Dec 3 21:44:42 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.241: +57 -57 lines
Diff to previous 1.241 (colored) to selected 1.32 (colored)

indent: inline input-related macros

No binary change.

Revision 1.241 / (download) - annotate - [select for diffs], Sun Dec 3 21:03:58 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.240: +6 -5 lines
Diff to previous 1.240 (colored) to selected 1.32 (colored)

indent: use line number of the token start in diagnostics

Previously, the line number of the end of the token was used, which was
confusing in debug mode.

Revision 1.240 / (download) - annotate - [select for diffs], Sun Dec 3 20:42:31 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.239: +4 -2 lines
Diff to previous 1.239 (colored) to selected 1.32 (colored)

indent: fix line number counting in function definition

In a function definition that is split on two lines, if the first line
ends with a '*', the following line break didn't include the line
number.

Revision 1.239 / (download) - annotate - [select for diffs], Mon Jun 26 20:23:40 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.238: +8 -2 lines
Diff to previous 1.238 (colored) to selected 1.32 (colored)

indent: improve heuristics for '*' as pointer in for loops

Revision 1.238 / (download) - annotate - [select for diffs], Mon Jun 26 20:10:23 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.237: +4 -3 lines
Diff to previous 1.237 (colored) to selected 1.32 (colored)

indent: improve heuristics for '*' as a pointer type

Revision 1.237 / (download) - annotate - [select for diffs], Mon Jun 26 10:23:59 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.236: +5 -5 lines
Diff to previous 1.236 (colored) to selected 1.32 (colored)

indent: clean up indentation

Revision 1.236 / (download) - annotate - [select for diffs], Sun Jun 25 19:35:45 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.235: +9 -15 lines
Diff to previous 1.235 (colored) to selected 1.32 (colored)

indent: move cast detection from the lexer to the main processor

It is not the job of the lexer to modify the parser state.

Revision 1.235 / (download) - annotate - [select for diffs], Sun Jun 25 19:29:57 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.234: +6 -6 lines
Diff to previous 1.234 (colored) to selected 1.32 (colored)

indent: treat 'complex' and 'imaginary' as type modifiers, not as types

Revision 1.234 / (download) - annotate - [select for diffs], Sun Jun 25 19:19:42 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.233: +44 -11 lines
Diff to previous 1.233 (colored) to selected 1.32 (colored)

indent: fix formatting of parenthesized name in function definition

Revision 1.233 / (download) - annotate - [select for diffs], Sun Jun 25 18:41:03 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.232: +6 -3 lines
Diff to previous 1.232 (colored) to selected 1.32 (colored)

indent: don't use strspn on inp_p, as it is not null-terminated

No functional change.

Revision 1.232 / (download) - annotate - [select for diffs], Sat Jun 17 23:03:20 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.231: +23 -19 lines
Diff to previous 1.231 (colored) to selected 1.32 (colored)

indent: clean up

Extract duplicate code for handling line continuations.

Prevent theoretic undefined behavior in strspn, as inp.s is not
null-terminated.

Remove adding extra space characters when processing comments, as these
are not necessary to force a line of output.

No functional change.

Revision 1.231 / (download) - annotate - [select for diffs], Sat Jun 17 22:28:49 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.230: +38 -38 lines
Diff to previous 1.230 (colored) to selected 1.32 (colored)

indent: miscellaneous cleanups

No binary change.

Revision 1.230 / (download) - annotate - [select for diffs], Fri Jun 16 23:51:32 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.229: +7 -10 lines
Diff to previous 1.229 (colored) to selected 1.32 (colored)

indent: merge lexer symbols for type in/outside parentheses

Revision 1.229 / (download) - annotate - [select for diffs], Wed Jun 14 16:14:30 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.228: +3 -3 lines
Diff to previous 1.228 (colored) to selected 1.32 (colored)

indent: clean up array indexing for parser symbols

With 'top' pointing to the actual top element, the array was indexed in
the closed range from 0 to top. All other arrays are indexed by the
usual half-open interval from 0 to len.

No functional change.

Revision 1.228 / (download) - annotate - [select for diffs], Wed Jun 14 14:11:28 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.227: +12 -10 lines
Diff to previous 1.227 (colored) to selected 1.32 (colored)

indent: allow more than 20 nested parentheses or brackets

Revision 1.227 / (download) - annotate - [select for diffs], Wed Jun 14 08:36:51 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.226: +2 -4 lines
Diff to previous 1.226 (colored) to selected 1.32 (colored)

indent: remove another flag from parser state

When processing a comment, the flag ps.next_col_1 was not used for the
next token, but for a line within a comment.  As its scope was limited
to a single comment, there is no need to store it any longer than that

No functional change.

Revision 1.226 / (download) - annotate - [select for diffs], Wed Jun 14 08:25:15 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.225: +4 -6 lines
Diff to previous 1.225 (colored) to selected 1.32 (colored)

indent: remove a redundant flag from the parser state

No functional change.

Revision 1.225 / (download) - annotate - [select for diffs], Sat Jun 10 16:43:56 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.224: +61 -80 lines
Diff to previous 1.224 (colored) to selected 1.32 (colored)

indent: miscellaneous cleanups

Revision 1.224 / (download) - annotate - [select for diffs], Sat Jun 10 13:03:17 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.223: +8 -8 lines
Diff to previous 1.223 (colored) to selected 1.32 (colored)

indent: clean up function names, fix blank lines in debug output

Revision 1.223 / (download) - annotate - [select for diffs], Sat Jun 10 12:59:31 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.222: +4 -4 lines
Diff to previous 1.222 (colored) to selected 1.32 (colored)

indent: in debug mode, null-terminate buffers

Revision 1.222 / (download) - annotate - [select for diffs], Sat Jun 10 07:42:41 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.221: +4 -4 lines
Diff to previous 1.221 (colored) to selected 1.32 (colored)

indent: clean up function and variable names

Revision 1.221 / (download) - annotate - [select for diffs], Sat Jun 10 06:38:21 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.220: +9 -9 lines
Diff to previous 1.220 (colored) to selected 1.32 (colored)

indent: rename and sort variables in parser state

No functional change.

Revision 1.220 / (download) - annotate - [select for diffs], Fri Jun 9 19:50:51 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.219: +52 -52 lines
Diff to previous 1.219 (colored) to selected 1.32 (colored)

indent: clean up lexer

No functional change.

Revision 1.219 / (download) - annotate - [select for diffs], Fri Jun 9 09:49:07 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.218: +5 -2 lines
Diff to previous 1.218 (colored) to selected 1.32 (colored)

indent: improve heuristics for function declaration vs. definition

Revision 1.218 / (download) - annotate - [select for diffs], Fri Jun 9 07:20:30 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.217: +3 -3 lines
Diff to previous 1.217 (colored) to selected 1.32 (colored)

indent: format its own code

Revision 1.217 / (download) - annotate - [select for diffs], Thu Jun 8 21:18:54 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.216: +3 -3 lines
Diff to previous 1.216 (colored) to selected 1.32 (colored)

indent: remove fragile heuristic for detecting cast expressions

The assumption that in an expression of the form '(a * anything)', the
'*' marks a pointer type was too simple-minded.

For now, fix the obvious cases and leave the others for later.  If
needed, they can be worked around using the '-T' option.

Revision 1.216 / (download) - annotate - [select for diffs], Wed Jun 7 15:46:12 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.215: +3 -3 lines
Diff to previous 1.215 (colored) to selected 1.32 (colored)

indent: extract the stack of parser symbols to a separate struct

No functional change.

Revision 1.215 / (download) - annotate - [select for diffs], Tue Jun 6 05:11:11 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.214: +3 -2 lines
Diff to previous 1.214 (colored) to selected 1.32 (colored)

indent: sort functions in call order

No functional change.

Revision 1.214 / (download) - annotate - [select for diffs], Sun Jun 4 22:57:18 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.213: +8 -7 lines
Diff to previous 1.213 (colored) to selected 1.32 (colored)

indent: do not parse '&&&&&&&' as a single binary operator

Revision 1.213 / (download) - annotate - [select for diffs], Sun Jun 4 22:36:10 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.212: +8 -9 lines
Diff to previous 1.212 (colored) to selected 1.32 (colored)

indent: fix '*=' to be a binary operator, not a unary one

Revision 1.212 / (download) - annotate - [select for diffs], Sun Jun 4 20:51:19 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.211: +59 -59 lines
Diff to previous 1.211 (colored) to selected 1.32 (colored)

indent: remove read pointer from buffers that don't need it

The only buffer that needs a read pointer is the current input line in
'inp'.

No functional change.

Revision 1.211 / (download) - annotate - [select for diffs], Sun Jun 4 14:20:00 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.210: +17 -17 lines
Diff to previous 1.210 (colored) to selected 1.32 (colored)

indent: rename struct field, for better symmetry

No binary change outside debug mode.

Revision 1.210 / (download) - annotate - [select for diffs], Sun Jun 4 12:46:57 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.209: +4 -4 lines
Diff to previous 1.209 (colored) to selected 1.32 (colored)

lint: use separate lexer symbols for 'case' and 'default'

It's not strictly necessary since these tokens behave in the same way,
still, the code is more straight-forward when there are separate tokens.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Jun 4 11:45:00 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.208: +10 -11 lines
Diff to previous 1.208 (colored) to selected 1.32 (colored)

indent: classify 'inline' as a modifier rather than a word

Revision 1.208 / (download) - annotate - [select for diffs], Sun Jun 4 11:33:36 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.207: +11 -3 lines
Diff to previous 1.207 (colored) to selected 1.32 (colored)

indent: use separate lexer symbols for the different kinds of ':'

Revision 1.207 / (download) - annotate - [select for diffs], Sun Jun 4 10:23:36 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.206: +10 -8 lines
Diff to previous 1.206 (colored) to selected 1.32 (colored)

indent: separate code for handling parentheses and brackets

Handling parentheses is more complicated than for brackets.

Revision 1.206 / (download) - annotate - [select for diffs], Tue May 23 18:16:28 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.205: +3 -13 lines
Diff to previous 1.205 (colored) to selected 1.32 (colored)

indent: separate code for handling enums from the lexer

The lexer's responsibility is to generate tokens, it's not supposed to
update the parser state.  Centralize the state transitions that control
indentation of enum constants to keep the lexer code clean.

Skip comments, newlines and preprocessing lines when updating the parser
state for enum constants and for '*' in declarations.

Revision 1.205 / (download) - annotate - [select for diffs], Tue May 23 12:12:29 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.204: +3 -6 lines
Diff to previous 1.204 (colored) to selected 1.32 (colored)

indent: split debug output into paragraphs

The paragraphs separate the different processing steps: getting a token
from the lexer, processing the token, updating the parser state, sending
a finished line to the output.

Revision 1.204 / (download) - annotate - [select for diffs], Tue May 23 06:35:01 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.203: +4 -2 lines
Diff to previous 1.203 (colored) to selected 1.32 (colored)

indent: fix spacing in declarations in for loops

Revision 1.203 / (download) - annotate - [select for diffs], Mon May 22 22:09:45 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.202: +15 -15 lines
Diff to previous 1.202 (colored) to selected 1.32 (colored)

indent: adjust indentation in lexer

No binary change.

Revision 1.202 / (download) - annotate - [select for diffs], Sat May 20 11:53:53 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.201: +3 -3 lines
Diff to previous 1.201 (colored) to selected 1.32 (colored)

indent: extract the output state from the parser state

The parser state depends on the preprocessing lines, the output state
shouldn't.

Revision 1.201 / (download) - annotate - [select for diffs], Sat May 20 01:28:14 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.200: +15 -16 lines
Diff to previous 1.200 (colored) to selected 1.32 (colored)

indent: clean up lexing of word tokens

No functional change.

Revision 1.200 / (download) - annotate - [select for diffs], Sat May 20 00:17:56 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.199: +20 -17 lines
Diff to previous 1.199 (colored) to selected 1.32 (colored)

indent: separate detection of function definitions from lexing '*'

No functional change.

Revision 1.199 / (download) - annotate - [select for diffs], Thu May 18 05:33:27 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.198: +40 -36 lines
Diff to previous 1.198 (colored) to selected 1.32 (colored)

indent: manually wrap overly long lines

No functional change.

Revision 1.198 / (download) - annotate - [select for diffs], Thu May 18 04:23:03 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.197: +445 -443 lines
Diff to previous 1.197 (colored) to selected 1.32 (colored)

indent: switch to standard code style

Taken from share/misc/indent.pro.

Indent does not wrap code to fit into the line width, it only does so
for comments.  The 'INDENT OFF' sections and too long lines will be
addressed in a follow-up commit.

No functional change.

Revision 1.197 / (download) - annotate - [select for diffs], Tue May 16 13:26:26 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.196: +49 -49 lines
Diff to previous 1.196 (colored) to selected 1.32 (colored)

indent: directly access the input buffer

No functional change.

Revision 1.196 / (download) - annotate - [select for diffs], Tue May 16 12:46:43 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.195: +3 -3 lines
Diff to previous 1.195 (colored) to selected 1.32 (colored)

indent: allow comments in column 1 to be formatted

Revision 1.195 / (download) - annotate - [select for diffs], Tue May 16 11:32:01 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.194: +2 -8 lines
Diff to previous 1.194 (colored) to selected 1.32 (colored)

indent: remove support for form feed characters inside a line

Form feeds are occasionally used to split code into pages, and this use
is still supported.  Having a form feed in the middle of a line is
exotic.

Revision 1.194 / (download) - annotate - [select for diffs], Tue May 16 08:04:03 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.193: +11 -8 lines
Diff to previous 1.193 (colored) to selected 1.32 (colored)

indent: fix handling of INDENT OFF/ON comments

Previously, the 'INDENT OFF' comments were interpreted when the newline
token from the line above the comment was processed, which was earlier
than could be reasonably expected.

The 'INDENT ON' comments were interpreted equally early, which led to
the situation that the 'INDENT OFF' comments were preserved literally
but the 'INDENT ON' comments weren't.

Revision 1.193 / (download) - annotate - [select for diffs], Tue May 16 07:13:05 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.192: +52 -2 lines
Diff to previous 1.192 (colored) to selected 1.32 (colored)

indent: move parsing of 'INDENT OFF/ON' comments to the lexer

No functional change.

Revision 1.192 / (download) - annotate - [select for diffs], Mon May 15 22:52:21 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.191: +4 -4 lines
Diff to previous 1.191 (colored) to selected 1.32 (colored)

indent: clean up detection of whether parentheses form a cast

No functional change.

Revision 1.191 / (download) - annotate - [select for diffs], Mon May 15 18:22:40 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.190: +7 -5 lines
Diff to previous 1.190 (colored) to selected 1.32 (colored)

indent: improve type guessing, fix formatting of declarations

Revision 1.190 / (download) - annotate - [select for diffs], Mon May 15 17:28:14 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.189: +12 -5 lines
Diff to previous 1.189 (colored) to selected 1.32 (colored)

indent: remove backslash line continuation outside preprocessing

The indenter did not handle these backslashes well, interpreting them as
unary operators, and they are an edge case anyway.  Line continuations
in string literals and character constants are kept.

Revision 1.189 / (download) - annotate - [select for diffs], Mon May 15 13:37:16 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.188: +4 -4 lines
Diff to previous 1.188 (colored) to selected 1.32 (colored)

indent: indent multi-line conditions

No functional change.

Revision 1.188 / (download) - annotate - [select for diffs], Mon May 15 09:22:53 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.187: +3 -3 lines
Diff to previous 1.187 (colored) to selected 1.32 (colored)

indent: let indent format its own code

With manual corrections, as indent does not properly indent multi-line
'?:' expressions nor multi-line controlling expressions.

Revision 1.187 / (download) - annotate - [select for diffs], Mon May 15 08:02:01 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.186: +5 -5 lines
Diff to previous 1.186 (colored) to selected 1.32 (colored)

indent: clean up memory allocation

No functional change.

Revision 1.186 / (download) - annotate - [select for diffs], Mon May 15 07:57:22 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.185: +8 -14 lines
Diff to previous 1.185 (colored) to selected 1.32 (colored)

indent: move debugging code to separate file

No functional change.

Revision 1.185 / (download) - annotate - [select for diffs], Mon May 15 07:28:45 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.184: +28 -40 lines
Diff to previous 1.184 (colored) to selected 1.32 (colored)

indent: clean up memory and buffer management

Remove the need to explicitly initialize the buffers.  To avoid
subtracting null pointers or comparing them using '<', migrate the
buffers from the (start, end) form to the (start, len) form.  This form
also avoids inconsistencies in whether 'buf.e == buf.s' or 'buf.s ==
buf.e' is used.

Make buffer.st const, to avoid accidental modification of the buffer's
content.

Replace '*buf.e++ = ch' with buf_add_char, to avoid having to keep track
how much unwritten space is left in the buffer.  Remove all safety
margins, that is, no more unchecked access to buf.st[-1] or appending
using '*buf.e++'.

Fix line number counting in lex_word for words that contain line breaks.

No functional change.

Revision 1.184 / (download) - annotate - [select for diffs], Sun May 14 22:26:37 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.183: +5 -10 lines
Diff to previous 1.183 (colored) to selected 1.32 (colored)

indent: only null-terminate the buffers if necessary

The only case where a buffer is used as a C-style string is when looking
up a keyword.

No functional change.

Revision 1.183 / (download) - annotate - [select for diffs], Sun May 14 14:14:07 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.182: +11 -13 lines
Diff to previous 1.182 (colored) to selected 1.32 (colored)

indent: reduce code for scanning tokens

The input line is guaranteed to end with '\n', so there's no need to
carry another pointer around.

No functional change.

Revision 1.182 / (download) - annotate - [select for diffs], Sun May 14 12:12:02 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.181: +2 -10 lines
Diff to previous 1.181 (colored) to selected 1.32 (colored)

indent: remove foreign RCS IDs

Revision 1.181 / (download) - annotate - [select for diffs], Sun May 14 11:29:23 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -6 lines
Diff to previous 1.180 (colored) to selected 1.32 (colored)

indent: miscellaneous cleanups

Revision 1.180 / (download) - annotate - [select for diffs], Sun May 14 11:02:53 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.179: +3 -3 lines
Diff to previous 1.179 (colored) to selected 1.32 (colored)

indent: reduce binary size

No functional change.

Revision 1.179 / (download) - annotate - [select for diffs], Sat May 13 13:31:37 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.178: +8 -2 lines
Diff to previous 1.178 (colored) to selected 1.32 (colored)

indent: fix lexing of numbers that are spread over multiple lines

Revision 1.178 / (download) - annotate - [select for diffs], Sat May 13 12:31:02 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored) to selected 1.32 (colored)

indent: rename struct fields for buffers

No binary change except for assertion line numbers.

Revision 1.177 / (download) - annotate - [select for diffs], Sat May 13 09:27:49 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.176: +3 -175 lines
Diff to previous 1.176 (colored) to selected 1.32 (colored)

indent: move debugging code to separate file

No functional change.

Revision 1.176 / (download) - annotate - [select for diffs], Fri May 12 08:40:54 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +9 -4 lines
Diff to previous 1.175 (colored) to selected 1.32 (colored)

indent: condense code for handling spaced expressions

No functional change outside debug mode.

Revision 1.175 / (download) - annotate - [select for diffs], Thu May 11 11:25:47 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.174: +14 -7 lines
Diff to previous 1.174 (colored) to selected 1.32 (colored)

indent: move parser state variables to the parser_state struct

Include the variables in the debug output.

Revision 1.174 / (download) - annotate - [select for diffs], Thu May 11 10:51:34 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.173: +3 -2 lines
Diff to previous 1.173 (colored) to selected 1.32 (colored)

indent: move force_nl into the parser state

This way, it is included in the debug output.

No functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Thu May 11 09:28:53 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +2 -4 lines
Diff to previous 1.172 (colored) to selected 1.32 (colored)

indent: remove buggy code for swapping tokens

It is not the job of an indenter to swap tokens, even if it's only about
placing comments elsewhere.  The code that swapped the tokens was
complicated, buggy and impossible to understand.

In -br (brace right) mode, indent no longer moves a '{' from the
beginning of a line to the end of the previous line, as that was handled
by the token swapping code as well.  This change is unintended, but it
will be easier to re-add that now that the code is simpler.

Revision 1.172 / (download) - annotate - [select for diffs], Sun Feb 13 12:43:26 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.171: +16 -16 lines
Diff to previous 1.171 (colored) to selected 1.32 (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 (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.170: +41 -11 lines
Diff to previous 1.170 (colored) to selected 1.32 (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 (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.169: +5 -5 lines
Diff to previous 1.169 (colored) to selected 1.32 (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 (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.168: +13 -3 lines
Diff to previous 1.168 (colored) to selected 1.32 (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 (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.167: +18 -7 lines
Diff to previous 1.167 (colored) to selected 1.32 (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 (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.166: +14 -7 lines
Diff to previous 1.166 (colored) to selected 1.32 (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 (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.165: +14 -8 lines
Diff to previous 1.165 (colored) to selected 1.32 (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 (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.164: +12 -6 lines
Diff to previous 1.164 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.163: +6 -6 lines
Diff to previous 1.163 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.162: +14 -4 lines
Diff to previous 1.162 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.161: +8 -9 lines
Diff to previous 1.161 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.160: +31 -26 lines
Diff to previous 1.160 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.159: +24 -56 lines
Diff to previous 1.159 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.158: +32 -30 lines
Diff to previous 1.158 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.157: +25 -5 lines
Diff to previous 1.157 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.155: +4 -3 lines
Diff to previous 1.155 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.154: +17 -11 lines
Diff to previous 1.154 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.153: +5 -8 lines
Diff to previous 1.153 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.152: +7 -3 lines
Diff to previous 1.152 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.151: +4 -4 lines
Diff to previous 1.151 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.150: +3 -3 lines
Diff to previous 1.150 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.149: +2 -3 lines
Diff to previous 1.149 (colored) to selected 1.32 (colored)

indent: clean up lint annotation and tests

Revision 1.149 / (download) - annotate - [select for diffs], Sat Nov 20 09:43:03 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.148: +10 -12 lines
Diff to previous 1.148 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.147: +9 -11 lines
Diff to previous 1.147 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.146: +5 -6 lines
Diff to previous 1.146 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.145: +18 -6 lines
Diff to previous 1.145 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.144: +13 -9 lines
Diff to previous 1.144 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.143: +9 -14 lines
Diff to previous 1.143 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.142: +7 -9 lines
Diff to previous 1.142 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.141: +9 -32 lines
Diff to previous 1.141 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.140: +34 -34 lines
Diff to previous 1.140 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.139: +48 -48 lines
Diff to previous 1.139 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.138: +7 -3 lines
Diff to previous 1.138 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.137: +4 -4 lines
Diff to previous 1.137 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.135: +3 -5 lines
Diff to previous 1.135 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.134: +7 -7 lines
Diff to previous 1.134 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.133: +16 -19 lines
Diff to previous 1.133 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.132: +23 -23 lines
Diff to previous 1.132 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.131: +9 -12 lines
Diff to previous 1.131 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.130: +10 -4 lines
Diff to previous 1.130 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.129: +7 -7 lines
Diff to previous 1.129 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.128: +4 -3 lines
Diff to previous 1.128 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.127: +3 -6 lines
Diff to previous 1.127 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.126: +51 -49 lines
Diff to previous 1.126 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.125: +55 -70 lines
Diff to previous 1.125 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.124: +50 -73 lines
Diff to previous 1.124 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.123: +6 -6 lines
Diff to previous 1.123 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.122: +2 -6 lines
Diff to previous 1.122 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.121: +6 -4 lines
Diff to previous 1.121 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.120: +4 -2 lines
Diff to previous 1.120 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.119: +4 -2 lines
Diff to previous 1.119 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.118: +15 -16 lines
Diff to previous 1.118 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.117: +27 -47 lines
Diff to previous 1.117 (colored) to selected 1.32 (colored)

indent: condense lexi_alnum

No functional change.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Oct 30 22:36:07 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.116: +9 -9 lines
Diff to previous 1.116 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.115: +4 -5 lines
Diff to previous 1.115 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.114: +13 -18 lines
Diff to previous 1.114 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.112: +15 -6 lines
Diff to previous 1.112 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.111: +50 -8 lines
Diff to previous 1.111 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.110: +4 -4 lines
Diff to previous 1.110 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.109: +17 -18 lines
Diff to previous 1.109 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.108: +5 -5 lines
Diff to previous 1.108 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.106: +63 -67 lines
Diff to previous 1.106 (colored) to selected 1.32 (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 (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.105: +5 -3 lines
Diff to previous 1.105 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.104: +12 -11 lines
Diff to previous 1.104 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.103: +14 -11 lines
Diff to previous 1.103 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.102: +8 -8 lines
Diff to previous 1.102 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.101: +7 -9 lines
Diff to previous 1.101 (colored) to selected 1.32 (colored)

indent: merge duplicate code in lexi_alnum

Revision 1.101 / (download) - annotate - [select for diffs], Mon Oct 25 21:33:24 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.100: +43 -11 lines
Diff to previous 1.100 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.99: +98 -77 lines
Diff to previous 1.99 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.98: +4 -4 lines
Diff to previous 1.98 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.97: +14 -8 lines
Diff to previous 1.97 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.96: +12 -8 lines
Diff to previous 1.96 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.95: +5 -5 lines
Diff to previous 1.95 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.94: +7 -7 lines
Diff to previous 1.94 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.93: +5 -5 lines
Diff to previous 1.93 (colored) to selected 1.32 (colored)

indent: rename nitems to array_length

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

indent: sort includes

Revision 1.92 / (download) - annotate - [select for diffs], Wed Oct 20 05:37:21 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.91: +18 -18 lines
Diff to previous 1.91 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.90: +6 -5 lines
Diff to previous 1.90 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.89: +15 -23 lines
Diff to previous 1.89 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.88: +118 -114 lines
Diff to previous 1.88 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.87: +4 -5 lines
Diff to previous 1.87 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.86: +17 -18 lines
Diff to previous 1.86 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.84: +2 -3 lines
Diff to previous 1.84 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.83: +31 -44 lines
Diff to previous 1.83 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.82: +18 -18 lines
Diff to previous 1.82 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.81: +9 -9 lines
Diff to previous 1.81 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.80: +6 -7 lines
Diff to previous 1.80 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.78: +9 -7 lines
Diff to previous 1.78 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.77: +47 -47 lines
Diff to previous 1.77 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.76: +4 -7 lines
Diff to previous 1.76 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.74: +29 -2 lines
Diff to previous 1.74 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.72: +4 -4 lines
Diff to previous 1.72 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.71: +9 -9 lines
Diff to previous 1.71 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.70: +12 -9 lines
Diff to previous 1.70 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.69: +15 -7 lines
Diff to previous 1.69 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.67: +5 -6 lines
Diff to previous 1.67 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.65: +5 -5 lines
Diff to previous 1.65 (colored) to selected 1.32 (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 (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.63: +39 -37 lines
Diff to previous 1.63 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.62: +18 -9 lines
Diff to previous 1.62 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.61: +72 -74 lines
Diff to previous 1.61 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.60: +5 -5 lines
Diff to previous 1.60 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.59: +11 -23 lines
Diff to previous 1.59 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.58: +22 -20 lines
Diff to previous 1.58 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.57: +4 -11 lines
Diff to previous 1.57 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.56: +17 -14 lines
Diff to previous 1.56 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.55: +48 -44 lines
Diff to previous 1.55 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.53: +11 -11 lines
Diff to previous 1.53 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.52: +2 -6 lines
Diff to previous 1.52 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.51: +17 -23 lines
Diff to previous 1.51 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.50: +8 -18 lines
Diff to previous 1.50 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.49: +44 -44 lines
Diff to previous 1.49 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.48: +7 -7 lines
Diff to previous 1.48 (colored) to selected 1.32 (colored)

indent: inline macro 'token'

No functional change.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Sep 25 07:55:24 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.46: +36 -52 lines
Diff to previous 1.46 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.32 (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 (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored) to selected 1.32 (colored)

indent: fix space-tab in indentation

Revision 1.43 / (download) - annotate - [select for diffs], Thu Aug 26 07:03:00 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.42: +74 -56 lines
Diff to previous 1.42 (colored) to selected 1.32 (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 (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored) to selected 1.32 (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 (3 years 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) to selected 1.32 (colored)

indent: fix lint warnings

No functional change.

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

indent: remove redundant parentheses

No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Mar 13 09:21:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.38: +8 -18 lines
Diff to previous 1.38 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.37: +9 -12 lines
Diff to previous 1.37 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.35: +18 -18 lines
Diff to previous 1.35 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.34: +14 -14 lines
Diff to previous 1.34 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored) to selected 1.32 (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 (3 years 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 - [selected], Thu Mar 11 21:47:36 2021 UTC (3 years 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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.30: +16 -16 lines
Diff to previous 1.30 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.29: +9 -9 lines
Diff to previous 1.29 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.26: +15 -12 lines
Diff to previous 1.26 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.24: +24 -9 lines
Diff to previous 1.24 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.21: +8 -8 lines
Diff to previous 1.21 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.20: +58 -60 lines
Diff to previous 1.20 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.19: +74 -17 lines
Diff to previous 1.19 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.18: +5 -5 lines
Diff to previous 1.18 (colored) to selected 1.32 (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 (3 years ago) by rillig
Branch: MAIN
Changes since 1.17: +2 -4 lines
Diff to previous 1.17 (colored) to selected 1.32 (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 (3 years, 11 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) to selected 1.32 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 19 15:44:31 2019 UTC (4 years, 5 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) to selected 1.32 (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 (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.14: +577 -545 lines
Diff to previous 1.14 (colored) to selected 1.32 (colored)

Sync with HEAD

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Thu Apr 4 20:39:17 2019 UTC (4 years, 11 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) to selected 1.32 (colored)

FreeBSD indent r340138

Revision 1.16 / (download) - annotate - [select for diffs], Thu Apr 4 15:22:13 2019 UTC (4 years, 11 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) to selected 1.32 (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 (5 years, 1 month ago) by mrg
Branch: MAIN
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored) to selected 1.32 (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 (7 years, 9 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) to selected 1.32 (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 (14 years, 10 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) to selected 1.32 (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 (14 years, 11 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) to selected 1.32 (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 (20 years, 7 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) to selected 1.32 (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 (21 years, 10 months ago) by wiz
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.10: +4 -6 lines
Diff to previous 1.10 (colored) to selected 1.32 (colored)

Remove #ifndef'd __STDC__ code. ANSIfy.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 22 22:30:02 2002 UTC (22 years 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) to selected 1.32 (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 (25 years 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) to selected 1.32 (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 (25 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.7: +9 -7 lines
Diff to previous 1.7 (colored) to selected 1.32 (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 (25 years, 7 months ago) by ross
Branch: MAIN
Changes since 1.6: +11 -6 lines
Diff to previous 1.6 (colored) to selected 1.32 (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 (26 years, 5 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) to selected 1.32 (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 (26 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.4: +9 -5 lines
Diff to previous 1.4 (colored) to selected 1.32 (colored)

merge lite-2.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Sep 9 09:28:19 1997 UTC (26 years, 6 months ago) by agc
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored) to selected 1.32 (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 (27 years, 2 months ago) by tls
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored) to selected 1.32 (colored)

RCS ID police

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:14:31 1993 UTC (30 years, 8 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) to selected 1.32 (colored)

Add RCS identifiers.

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

4.4BSD-Lite2

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 9 12:59:15 1993 UTC (30 years, 11 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
Diff to selected 1.32 (colored)

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>