The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.235 / (download) - annotate - [select for diffs], Sun Dec 3 21:44:42 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.234: +13 -13 lines
Diff to previous 1.234 (colored) to selected 1.115 (colored)

indent: inline input-related macros

No binary change.

Revision 1.234 / (download) - annotate - [select for diffs], Sun Dec 3 21:40:44 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.233: +5 -6 lines
Diff to previous 1.233 (colored) to selected 1.115 (colored)

indent: group input-related variables into a struct

No functional change.

Revision 1.233 / (download) - annotate - [select for diffs], Sun Dec 3 21:03:58 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.232: +4 -2 lines
Diff to previous 1.232 (colored) to selected 1.115 (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.232 / (download) - annotate - [select for diffs], Tue Jun 27 04:41:23 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.231: +4 -6 lines
Diff to previous 1.231 (colored) to selected 1.115 (colored)

indent: fix 'blank line above first statement in function body'

Revision 1.231 / (download) - annotate - [select for diffs], Mon Jun 26 20:03:09 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.230: +10 -2 lines
Diff to previous 1.230 (colored) to selected 1.115 (colored)

indent: implement 'blank line above first statement in function body'

Revision 1.230 / (download) - annotate - [select for diffs], Mon Jun 26 14:54:40 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.229: +4 -3 lines
Diff to previous 1.229 (colored) to selected 1.115 (colored)

indent: in -bad mode, don't add a blank line above a comment or '}'

Revision 1.229 / (download) - annotate - [select for diffs], Sat Jun 17 23:03:20 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.228: +3 -4 lines
Diff to previous 1.228 (colored) to selected 1.115 (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.228 / (download) - annotate - [select for diffs], Sat Jun 17 22:28:49 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.227: +30 -24 lines
Diff to previous 1.227 (colored) to selected 1.115 (colored)

indent: miscellaneous cleanups

No binary change.

Revision 1.227 / (download) - annotate - [select for diffs], Fri Jun 16 11:48:32 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.226: +7 -6 lines
Diff to previous 1.226 (colored) to selected 1.115 (colored)

indent: don't force a blank line between '}' and preprocessing line

Revision 1.226 / (download) - annotate - [select for diffs], Fri Jun 16 11:27:49 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.225: +4 -4 lines
Diff to previous 1.225 (colored) to selected 1.115 (colored)

indent: rename a field of the parser state

The previous name 'comment_in_first_line' was misleading, as it could
mean that there was a comment in the first line of the file.

No functional change.

Revision 1.225 / (download) - annotate - [select for diffs], Thu Jun 15 11:27:36 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.224: +17 -6 lines
Diff to previous 1.224 (colored) to selected 1.115 (colored)

indent: consolidate handling of statement continuations

Revision 1.224 / (download) - annotate - [select for diffs], Thu Jun 15 10:59:06 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.223: +5 -5 lines
Diff to previous 1.223 (colored) to selected 1.115 (colored)

indent: rename state variable to be more accurate

No binary change.

Revision 1.223 / (download) - annotate - [select for diffs], Thu Jun 15 10:34:12 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.222: +2 -5 lines
Diff to previous 1.222 (colored) to selected 1.115 (colored)

indent: fix indentation of multi-line enum constant initializers

Revision 1.222 / (download) - annotate - [select for diffs], Thu Jun 15 09:19:06 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.221: +8 -6 lines
Diff to previous 1.221 (colored) to selected 1.115 (colored)

indent: miscellaneous cleanups, more tests for edge cases

Revision 1.221 / (download) - annotate - [select for diffs], Wed Jun 14 16:14:30 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.220: +8 -8 lines
Diff to previous 1.220 (colored) to selected 1.115 (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.220 / (download) - annotate - [select for diffs], Wed Jun 14 14:11:28 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.219: +13 -11 lines
Diff to previous 1.219 (colored) to selected 1.115 (colored)

indent: allow more than 20 nested parentheses or brackets

Revision 1.219 / (download) - annotate - [select for diffs], Wed Jun 14 09:57:02 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.218: +5 -3 lines
Diff to previous 1.218 (colored) to selected 1.115 (colored)

indent: clean up debugging code

Revision 1.218 / (download) - annotate - [select for diffs], Wed Jun 14 09:31:05 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.217: +8 -6 lines
Diff to previous 1.217 (colored) to selected 1.115 (colored)

indent: clean up handling of comments

One less moving part in the parser state.

No functional change.

Revision 1.217 / (download) - annotate - [select for diffs], Sat Jun 10 21:36:38 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.216: +5 -5 lines
Diff to previous 1.216 (colored) to selected 1.115 (colored)

indent: rename misleading variable

The name started with 'line_start', but the value is not always the
value from the beginning of the line.

No functional change.

Revision 1.216 / (download) - annotate - [select for diffs], Sat Jun 10 16:43:56 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.215: +17 -17 lines
Diff to previous 1.215 (colored) to selected 1.115 (colored)

indent: miscellaneous cleanups

Revision 1.215 / (download) - annotate - [select for diffs], Sat Jun 10 12:59:31 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.214: +10 -8 lines
Diff to previous 1.214 (colored) to selected 1.115 (colored)

indent: in debug mode, null-terminate buffers

Revision 1.214 / (download) - annotate - [select for diffs], Sat Jun 10 11:01:58 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.213: +31 -33 lines
Diff to previous 1.213 (colored) to selected 1.115 (colored)

indent: distinguish blank lines from newline characters

Revision 1.213 / (download) - annotate - [select for diffs], Sat Jun 10 08:17:04 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.212: +4 -4 lines
Diff to previous 1.212 (colored) to selected 1.115 (colored)

indent: fix indentation of continuation lines in initializers

Revision 1.212 / (download) - annotate - [select for diffs], Sat Jun 10 07:53:00 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.211: +41 -38 lines
Diff to previous 1.211 (colored) to selected 1.115 (colored)

indent: extract output of an indented line to separate function

Revision 1.211 / (download) - annotate - [select for diffs], Sat Jun 10 07:48:55 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.210: +32 -32 lines
Diff to previous 1.210 (colored) to selected 1.115 (colored)

indent: clean up function names and order in output

Revision 1.210 / (download) - annotate - [select for diffs], Sat Jun 10 07:42:41 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.209: +3 -4 lines
Diff to previous 1.209 (colored) to selected 1.115 (colored)

indent: clean up function and variable names

Revision 1.209 / (download) - annotate - [select for diffs], Sat Jun 10 06:38:21 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.208: +5 -5 lines
Diff to previous 1.208 (colored) to selected 1.115 (colored)

indent: rename and sort variables in parser state

No functional change.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Jun 9 22:01:26 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.207: +33 -4 lines
Diff to previous 1.207 (colored) to selected 1.115 (colored)

indent: trim trailing blank lines

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jun 9 08:10:58 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.206: +13 -13 lines
Diff to previous 1.206 (colored) to selected 1.115 (colored)

indent: when an indentation is ambiguous, indent one level further

The '-eei' mode now applies whenever the indentation from a multi-line
expression could be confused with a following statement.

Revision 1.206 / (download) - annotate - [select for diffs], Fri Jun 9 07:20:30 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.205: +3 -3 lines
Diff to previous 1.205 (colored) to selected 1.115 (colored)

indent: format its own code

Revision 1.205 / (download) - annotate - [select for diffs], Fri Jun 9 06:36:57 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.204: +3 -7 lines
Diff to previous 1.204 (colored) to selected 1.115 (colored)

indent: indent multi-line expressions according to parentheses

This reverts the FreeBSD change from 2004-02-12 that had been imported
on 2019-04-04.

Revision 1.204 / (download) - annotate - [select for diffs], Thu Jun 8 20:36:35 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.203: +5 -3 lines
Diff to previous 1.203 (colored) to selected 1.115 (colored)

indent: fix indentation in multi-line else-if conditions

Revision 1.203 / (download) - annotate - [select for diffs], Thu Jun 8 06:47:13 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.202: +11 -11 lines
Diff to previous 1.202 (colored) to selected 1.115 (colored)

indent: clean up and condense code

No functional change.

Revision 1.202 / (download) - annotate - [select for diffs], Wed Jun 7 15:46:12 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.201: +9 -8 lines
Diff to previous 1.201 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.201 / (download) - annotate - [select for diffs], Tue Jun 6 05:27:56 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.200: +7 -9 lines
Diff to previous 1.200 (colored) to selected 1.115 (colored)

indent: condense code for writing tabs

No functional change.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Jun 6 05:11:11 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.199: +95 -94 lines
Diff to previous 1.199 (colored) to selected 1.115 (colored)

indent: sort functions in call order

No functional change.

Revision 1.199 / (download) - annotate - [select for diffs], Tue Jun 6 04:37:26 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.198: +13 -3 lines
Diff to previous 1.198 (colored) to selected 1.115 (colored)

indent: compute indentation of 'case' labels on-demand

One less moving part to keep track of.

No functional change.

Revision 1.198 / (download) - annotate - [select for diffs], Mon Jun 5 12:06:51 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.197: +4 -6 lines
Diff to previous 1.197 (colored) to selected 1.115 (colored)

indent: clean up comments

Revision 1.197 / (download) - annotate - [select for diffs], Mon Jun 5 12:01:33 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.196: +3 -4 lines
Diff to previous 1.196 (colored) to selected 1.115 (colored)

indent: don't remove blank line after 'if (expr) {'

Revision 1.196 / (download) - annotate - [select for diffs], Mon Jun 5 09:41:40 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.195: +4 -3 lines
Diff to previous 1.195 (colored) to selected 1.115 (colored)

indent: fix formatting of 'do' statements

Revision 1.195 / (download) - annotate - [select for diffs], Mon Jun 5 07:23:03 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.194: +4 -9 lines
Diff to previous 1.194 (colored) to selected 1.115 (colored)

indent: clean up handling of whitespace

No functional change.

Revision 1.194 / (download) - annotate - [select for diffs], Mon Jun 5 06:43:14 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.193: +27 -31 lines
Diff to previous 1.193 (colored) to selected 1.115 (colored)

indent: let the output routines keep track of the indentation

No functional change.

Revision 1.193 / (download) - annotate - [select for diffs], Sun Jun 4 20:51:19 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.192: +20 -19 lines
Diff to previous 1.192 (colored) to selected 1.115 (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.192 / (download) - annotate - [select for diffs], Sun Jun 4 18:58:30 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.191: +6 -4 lines
Diff to previous 1.191 (colored) to selected 1.115 (colored)

indent: force at least one space after the colon of a label

Revision 1.191 / (download) - annotate - [select for diffs], Sun Jun 4 17:54:11 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.190: +3 -3 lines
Diff to previous 1.190 (colored) to selected 1.115 (colored)

indent: track the kind of '{' on the parser stack

Revision 1.190 / (download) - annotate - [select for diffs], Sun Jun 4 14:38:15 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.189: +3 -3 lines
Diff to previous 1.189 (colored) to selected 1.115 (colored)

indent: ensure that the 'block init level' never goes negative

No functional change.

Revision 1.189 / (download) - annotate - [select for diffs], Sun Jun 4 13:49:00 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.188: +4 -3 lines
Diff to previous 1.188 (colored) to selected 1.115 (colored)

indent: fix indentation of initializers in compound expressions

Revision 1.188 / (download) - annotate - [select for diffs], Sun Jun 4 11:09:18 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.187: +5 -9 lines
Diff to previous 1.187 (colored) to selected 1.115 (colored)

indent: handle the indentation of 'case' in a simpler way

Revision 1.187 / (download) - annotate - [select for diffs], Tue May 23 18:16:28 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.186: +5 -3 lines
Diff to previous 1.186 (colored) to selected 1.115 (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.186 / (download) - annotate - [select for diffs], Tue May 23 12:12:29 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.185: +3 -3 lines
Diff to previous 1.185 (colored) to selected 1.115 (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.185 / (download) - annotate - [select for diffs], Mon May 22 10:28:59 2023 UTC (10 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.184: +23 -4 lines
Diff to previous 1.184 (colored) to selected 1.115 (colored)

indent: implement suppressing optional blank lines

Revision 1.184 / (download) - annotate - [select for diffs], Sat May 20 12:05:01 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.183: +4 -3 lines
Diff to previous 1.183 (colored) to selected 1.115 (colored)

indent: don't insert blank line between two closing lines

Revision 1.183 / (download) - annotate - [select for diffs], Sat May 20 11:53:53 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.182: +21 -23 lines
Diff to previous 1.182 (colored) to selected 1.115 (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.182 / (download) - annotate - [select for diffs], Sat May 20 11:19:17 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.181: +4 -5 lines
Diff to previous 1.181 (colored) to selected 1.115 (colored)

indent: implement blank line above block comment

Revision 1.181 / (download) - annotate - [select for diffs], Sat May 20 10:46:21 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.180: +5 -2 lines
Diff to previous 1.180 (colored) to selected 1.115 (colored)

indent: implement blank line after function body

Revision 1.180 / (download) - annotate - [select for diffs], Sat May 20 10:25:47 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.179: +12 -14 lines
Diff to previous 1.179 (colored) to selected 1.115 (colored)

indent: ensure that no blank lines are inserted in INDENT OFF mode

No blank lines were inserted previously, but the code looked
suspicious as if that were possible.

Revision 1.179 / (download) - annotate - [select for diffs], Sat May 20 10:09:02 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.178: +44 -16 lines
Diff to previous 1.178 (colored) to selected 1.115 (colored)

indent: implement blank lines around conditional compilation

Revision 1.178 / (download) - annotate - [select for diffs], Thu May 18 05:33:27 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.177: +6 -4 lines
Diff to previous 1.177 (colored) to selected 1.115 (colored)

indent: manually wrap overly long lines

No functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Thu May 18 04:23:03 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.176: +194 -193 lines
Diff to previous 1.176 (colored) to selected 1.115 (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.176 / (download) - annotate - [select for diffs], Thu May 18 03:38:34 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored) to selected 1.115 (colored)

indent: remove unnecessary variable size optimization

Due to the enum that follows in the struct, the short variable was
padded to 4 bytes anyway.

No functional change.

Revision 1.175 / (download) - annotate - [select for diffs], Tue May 16 13:26:26 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.174: +4 -32 lines
Diff to previous 1.174 (colored) to selected 1.115 (colored)

indent: directly access the input buffer

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Tue May 16 11:32:01 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.173: +6 -18 lines
Diff to previous 1.173 (colored) to selected 1.115 (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.173 / (download) - annotate - [select for diffs], Tue May 16 08:04:03 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.172: +19 -8 lines
Diff to previous 1.172 (colored) to selected 1.115 (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.172 / (download) - annotate - [select for diffs], Tue May 16 07:13:05 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.171: +3 -53 lines
Diff to previous 1.171 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Mon May 15 22:35:41 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.170: +4 -4 lines
Diff to previous 1.170 (colored) to selected 1.115 (colored)

indent: fix cast detection

In process_lparen_or_lbracket, ps.paren[...].maybe_cast was not
initialized, which may have been the cause for seemingly random spacing
around binary operators.

While here, clean up the code by reducing the number of accesses to the
parser state.

Revision 1.170 / (download) - annotate - [select for diffs], Mon May 15 13:37:16 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.169: +3 -3 lines
Diff to previous 1.169 (colored) to selected 1.115 (colored)

indent: indent multi-line conditions

No functional change.

Revision 1.169 / (download) - annotate - [select for diffs], Mon May 15 13:33:19 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.168: +5 -3 lines
Diff to previous 1.168 (colored) to selected 1.115 (colored)

indent: fix indentation of statements after controlling expression

Revision 1.168 / (download) - annotate - [select for diffs], Mon May 15 12:59:43 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.167: +5 -2 lines
Diff to previous 1.167 (colored) to selected 1.115 (colored)

indent: fix indentation of expressions in -nlp -eei mode

Revision 1.167 / (download) - annotate - [select for diffs], Mon May 15 08:11:27 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.166: +2 -3 lines
Diff to previous 1.166 (colored) to selected 1.115 (colored)

indent: remove redundant include lines

Revision 1.166 / (download) - annotate - [select for diffs], Mon May 15 07:28:45 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.165: +38 -65 lines
Diff to previous 1.165 (colored) to selected 1.115 (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.165 / (download) - annotate - [select for diffs], Sun May 14 22:26:37 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.164: +5 -6 lines
Diff to previous 1.164 (colored) to selected 1.115 (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.164 / (download) - annotate - [select for diffs], Sun May 14 14:14:07 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.163: +2 -8 lines
Diff to previous 1.163 (colored) to selected 1.115 (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.163 / (download) - annotate - [select for diffs], Sun May 14 12:12:02 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.162: +2 -10 lines
Diff to previous 1.162 (colored) to selected 1.115 (colored)

indent: remove foreign RCS IDs

Revision 1.162 / (download) - annotate - [select for diffs], Sun May 14 11:29:23 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.161: +9 -10 lines
Diff to previous 1.161 (colored) to selected 1.115 (colored)

indent: miscellaneous cleanups

Revision 1.161 / (download) - annotate - [select for diffs], Sat May 13 17:20:41 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.160: +4 -2 lines
Diff to previous 1.160 (colored) to selected 1.115 (colored)

indent: do not add a blank at the beginning of a line

Most calls to output_line did already reset the variable.  There may be
some untested edge cases in or after comments, but these should be fine
as well.

Revision 1.160 / (download) - annotate - [select for diffs], Sat May 13 15:34:22 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.159: +14 -5 lines
Diff to previous 1.159 (colored) to selected 1.115 (colored)

indent: implement 'blank after declarations'

Revision 1.159 / (download) - annotate - [select for diffs], Sat May 13 14:30:48 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored) to selected 1.115 (colored)

indent: use enum instead of magic numbers for tracking declarations

No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Sat May 13 13:48:54 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.157: +3 -4 lines
Diff to previous 1.157 (colored) to selected 1.115 (colored)

indent: improve names of option variables

No functional change.

Revision 1.157 / (download) - annotate - [select for diffs], Sat May 13 12:31:02 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.156: +19 -20 lines
Diff to previous 1.156 (colored) to selected 1.115 (colored)

indent: rename struct fields for buffers

No binary change except for assertion line numbers.

Revision 1.156 / (download) - annotate - [select for diffs], Sat May 13 09:27:49 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.155: +8 -2 lines
Diff to previous 1.155 (colored) to selected 1.115 (colored)

indent: move debugging code to separate file

No functional change.

Revision 1.155 / (download) - annotate - [select for diffs], Fri May 12 10:53:33 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.154: +2 -8 lines
Diff to previous 1.154 (colored) to selected 1.115 (colored)

indent: remove statistics

The numbers from the statistics were wrong.

Revision 1.154 / (download) - annotate - [select for diffs], Thu May 11 19:14:54 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.153: +33 -35 lines
Diff to previous 1.153 (colored) to selected 1.115 (colored)

indent: clean up input buffer handling

No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Thu May 11 19:01:35 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.152: +6 -147 lines
Diff to previous 1.152 (colored) to selected 1.115 (colored)

indent: don't touch comments in preprocessing lines

The indentation of multi-line comments was wrong, and the code for
handling them was too complicated.

Revision 1.152 / (download) - annotate - [select for diffs], Thu May 11 18:44:14 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.151: +2 -6 lines
Diff to previous 1.151 (colored) to selected 1.115 (colored)

tests/indent: add more tests for preprocessing directives

Revision 1.151 / (download) - annotate - [select for diffs], Thu May 11 18:26:56 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.150: +2 -85 lines
Diff to previous 1.150 (colored) to selected 1.115 (colored)

indent: remove unused code

Revision 1.150 / (download) - annotate - [select for diffs], Thu May 11 18:13:55 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.149: +4 -50 lines
Diff to previous 1.149 (colored) to selected 1.115 (colored)

indent: remove broken code for handling blank lines

This fixes several bugs where blank lines were erroneously added or
removed, treating these old bugs for new bugs in different places.
These new bugs are expected to be easier to fix, as the old bugs will
not interfere anymore.

Revision 1.149 / (download) - annotate - [select for diffs], Thu May 11 17:22:56 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.148: +10 -2 lines
Diff to previous 1.148 (colored) to selected 1.115 (colored)

indent: add debug output for tracking comments and braces

Revision 1.148 / (download) - annotate - [select for diffs], Sat Apr 23 06:43:22 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, 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.147: +19 -20 lines
Diff to previous 1.147 (colored) to selected 1.115 (colored)

indent: group global variables related to output control

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Sun Feb 13 12:48:12 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.146: +4 -4 lines
Diff to previous 1.146 (colored) to selected 1.115 (colored)

indent: consistently use nparen for indexing parser_state.paren

No binary change.

Revision 1.146 / (download) - annotate - [select for diffs], Sun Feb 13 12:43:26 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.145: +8 -8 lines
Diff to previous 1.145 (colored) to selected 1.115 (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.145 / (download) - annotate - [select for diffs], Sun Feb 13 12:20:09 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.144: +7 -7 lines
Diff to previous 1.144 (colored) to selected 1.115 (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.144 / (download) - annotate - [select for diffs], Sat Feb 12 19:56:52 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored) to selected 1.115 (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.143 / (download) - annotate - [select for diffs], Sun Nov 28 11:49:10 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.142: +53 -16 lines
Diff to previous 1.142 (colored) to selected 1.115 (colored)

indent: clean up and document input handling

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

No functional change.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Nov 27 21:15:58 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.141: +9 -10 lines
Diff to previous 1.141 (colored) to selected 1.115 (colored)

indent: accept a few formatting suggestions from indent

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

No functional change.

Revision 1.141 / (download) - annotate - [select for diffs], Sat Nov 27 18:37:17 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.140: +14 -14 lines
Diff to previous 1.140 (colored) to selected 1.115 (colored)

indent: rename dump functions to output

No functional change.

Revision 1.140 / (download) - annotate - [select for diffs], Sat Nov 27 18:26:48 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.139: +6 -2 lines
Diff to previous 1.139 (colored) to selected 1.115 (colored)

indent: add assertions for input handling

Just to document the invariants; the code is already OK.

Revision 1.139 / (download) - annotate - [select for diffs], Fri Nov 26 15:21:38 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.138: +23 -12 lines
Diff to previous 1.138 (colored) to selected 1.115 (colored)

indent: enhance debug logging for input handling

Revision 1.138 / (download) - annotate - [select for diffs], Fri Nov 26 15:08:48 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.137: +21 -22 lines
Diff to previous 1.137 (colored) to selected 1.115 (colored)

indent: replace inp_enlarge with inp_add

Previously, inbuf.inp.s was only updated at the very end of reading a
line from the input file, which meant that during debugging, it pointed
to invalid memory. Updating all fields in inbuf.inp after every
reallocation makes the code less tricky to understand.

No functional change.

Revision 1.137 / (download) - annotate - [select for diffs], Fri Nov 26 14:48:03 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.136: +43 -45 lines
Diff to previous 1.136 (colored) to selected 1.115 (colored)

indent: split inp_read_line into smaller functions

No functional change.

Revision 1.136 / (download) - annotate - [select for diffs], Fri Nov 26 14:33:12 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.135: +21 -11 lines
Diff to previous 1.135 (colored) to selected 1.115 (colored)

indent: extract inp_from_file from inp_read_line

No functional change.

Revision 1.135 / (download) - annotate - [select for diffs], Fri Nov 26 14:27:19 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.134: +3 -27 lines
Diff to previous 1.134 (colored) to selected 1.115 (colored)

indent: remove code that fixes malformed preprocessor directives

Revision 1.134 / (download) - annotate - [select for diffs], Fri Nov 26 14:17:01 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.133: +2 -18 lines
Diff to previous 1.133 (colored) to selected 1.115 (colored)

indent: move ind_add from io.c to indent.c

It's a general-purpose function that is not directly related to input or
output.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Nov 25 21:59:40 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.132: +3 -8 lines
Diff to previous 1.132 (colored) to selected 1.115 (colored)

indent: prevent undefined behavior in inp_line_start

No functional change.

Revision 1.132 / (download) - annotate - [select for diffs], Thu Nov 25 20:00:31 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.131: +6 -6 lines
Diff to previous 1.131 (colored) to selected 1.115 (colored)

indent: update cross-reference comments for bug in comment handling

The function was renamed in io.c 1.122 from 2021-11-19.

Revision 1.131 / (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.130: +3 -3 lines
Diff to previous 1.130 (colored) to selected 1.115 (colored)

indent: rename ps.in_stmt to in_stmt_or_decl

The previous name didn't match reality.

No functional change.

Revision 1.130 / (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.129: +5 -7 lines
Diff to previous 1.129 (colored) to selected 1.115 (colored)

indent: rename ps.ind_stmt to in_stmt_cont

This makes a comment redundant.

No functional change.

Revision 1.129 / (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.128: +3 -4 lines
Diff to previous 1.128 (colored) to selected 1.115 (colored)

indent: reduce casts to unsigned char for character classification

No functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Nov 19 20:13:05 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.127: +5 -6 lines
Diff to previous 1.127 (colored) to selected 1.115 (colored)

indent: keep inbuf.save_com_s and inbuf.save_com_e in sync

No functional change.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Nov 19 20:04:02 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.126: +2 -3 lines
Diff to previous 1.126 (colored) to selected 1.115 (colored)

indent: fix included headers

Revision 1.126 / (download) - annotate - [select for diffs], Fri Nov 19 20:01:37 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.125: +9 -8 lines
Diff to previous 1.125 (colored) to selected 1.115 (colored)

indent: clean up io.c

No functional change.

Revision 1.125 / (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.124: +3 -3 lines
Diff to previous 1.124 (colored) to selected 1.115 (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.124 / (download) - annotate - [select for diffs], Fri Nov 19 18:25:50 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.123: +15 -3 lines
Diff to previous 1.123 (colored) to selected 1.115 (colored)

indent: unexport inbuf

No functional change.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Nov 19 18:23:59 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.122: +17 -2 lines
Diff to previous 1.122 (colored) to selected 1.115 (colored)

indent: use character input API from pr_comment.c

No functional change.

Revision 1.122 / (download) - annotate - [select for diffs], Fri Nov 19 18:14:18 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.121: +52 -2 lines
Diff to previous 1.121 (colored) to selected 1.115 (colored)

indent: remove all references to inbuf from indent.c

No functional change.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Nov 19 17:59:16 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.120: +58 -2 lines
Diff to previous 1.120 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.120 / (download) - annotate - [select for diffs], Fri Nov 19 17:42:45 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.119: +65 -2 lines
Diff to previous 1.119 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.119 / (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.118: +14 -2 lines
Diff to previous 1.118 (colored) to selected 1.115 (colored)

indent: use character input API from the tokenizer

No functional change.

Revision 1.118 / (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.117: +32 -2 lines
Diff to previous 1.117 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.117 / (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.116: +19 -19 lines
Diff to previous 1.116 (colored) to selected 1.115 (colored)

indent: group variables for input handling

No functional change.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Nov 7 07:06:00 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (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.115 / (download) - annotate - [selected], Fri Nov 5 21:39:12 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.114: +3 -4 lines
Diff to previous 1.114 (colored)

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

Revision 1.114 / (download) - annotate - [select for diffs], Thu Nov 4 19:23:57 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.113: +4 -8 lines
Diff to previous 1.113 (colored) to selected 1.115 (colored)

indent: do not discard former error comments anymore

Since io.c 1.20 from 2019-10-19, indent has not placed error comments in
the code anymore. Since these comments are supposed to be cleaned up
immediately, there is no point in having code for handling them.

Revision 1.113 / (download) - annotate - [select for diffs], Thu Nov 4 17:10:37 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.112: +21 -16 lines
Diff to previous 1.112 (colored) to selected 1.115 (colored)

indent: extract compute_code_indent_lineup into separate function

Having 9 different paths in a single function made it more complicated
to understand than necessary.

No functional change.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Nov 4 17:08:50 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.111: +6 -12 lines
Diff to previous 1.111 (colored) to selected 1.115 (colored)

indent: fix off-by-one confusion in paren_indent

The variable was called 'indent' but actually contained a 'column',
which was off by one.

No functional change.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Nov 4 17:07:02 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.110: +12 -12 lines
Diff to previous 1.110 (colored) to selected 1.115 (colored)

indent: replace column computation with indentation computation

No functional change.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Nov 4 00:13:57 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.109: +28 -25 lines
Diff to previous 1.109 (colored) to selected 1.115 (colored)

indent: group conditions in compute_code_indent by topic

No functional change.

Revision 1.109 / (download) - annotate - [select for diffs], Wed Nov 3 21:47:35 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.108: +10 -16 lines
Diff to previous 1.108 (colored) to selected 1.115 (colored)

indent: inline indentation_after, shorten function name to ind_add

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

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

No functional change.

Revision 1.108 / (download) - annotate - [select for diffs], Sat Oct 30 11:49:38 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored) to selected 1.115 (colored)

indent: inline macro label_offset

No functional change.

Revision 1.107 / (download) - annotate - [select for diffs], Fri Oct 29 20:27:42 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.106: +10 -10 lines
Diff to previous 1.106 (colored) to selected 1.115 (colored)

indent: merge isblank and is_hspace into ch_isblank

No functional change.

Revision 1.106 / (download) - annotate - [select for diffs], Fri Oct 29 19:12:48 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.105: +4 -4 lines
Diff to previous 1.105 (colored) to selected 1.115 (colored)

indent: fix undefined behavior in buffer handling

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

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

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

No functional change.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Oct 29 18:18:03 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (colored) to selected 1.115 (colored)

indent: reorder global variables to be more intuitive

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

No functional change.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Oct 29 17:32:22 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored) to selected 1.115 (colored)

indent: rename ps.dumped_decl_indent and indent_declaration

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

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

No functional change.

Revision 1.103 / (download) - annotate - [select for diffs], Wed Oct 27 00:04:51 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.102: +3 -6 lines
Diff to previous 1.102 (colored) to selected 1.115 (colored)

indent: fix indentation of local variable declarations

This had been broken since the import of FreeBSD indent in 2019.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Oct 24 17:19:48 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.101: +2 -25 lines
Diff to previous 1.101 (colored) to selected 1.115 (colored)

indent: clean up format of warnings and errors

Previously, warnings and errors had the form of C block comments. Before
NetBSD io.c 1.20 from 2019-10-19, this format made sense because the
diagnostics could end up in the same output stream as the formatted
output.

Since NetBSD io.c 1.20 from 2019-10-19, all diagnostics are redirected
to stderr. This change was not mentioned in the commit message back
then, it makes sense nevertheless. Since stdout and stderr now are
properly separated, there is no need anymore to keep the weird format
for warnings and errors. Switch to the standard 'error: file:line'
format.

Move the function 'diag' to indent.c to have access to the name of the
current input file.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Oct 24 11:17:05 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.100: +17 -9 lines
Diff to previous 1.100 (colored) to selected 1.115 (colored)

indent: replace global variable use_ff with function parameter

Revision 1.100 / (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.99: +3 -3 lines
Diff to previous 1.99 (colored) to selected 1.115 (colored)

indent: sort includes

Revision 1.99 / (download) - annotate - [select for diffs], Wed Oct 20 05:14:21 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.98: +8 -8 lines
Diff to previous 1.98 (colored) to selected 1.115 (colored)

indent: rename blankline_requested variables

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

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Oct 20 05:00:37 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.97: +9 -9 lines
Diff to previous 1.97 (colored) to selected 1.115 (colored)

indent: rename next_blank_lines to blank_lines_to_output

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

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Tue Oct 19 21:39:19 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.96: +3 -4 lines
Diff to previous 1.96 (colored) to selected 1.115 (colored)

indent: always keep next_blank_lines >= 0

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Tue Oct 19 21:21:07 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.95: +4 -6 lines
Diff to previous 1.95 (colored) to selected 1.115 (colored)

indent: use simpler code for copying the input buffer

In debug mode, this reduces the amount of debug output lines.

No functional change in default mode.

Revision 1.95 / (download) - annotate - [select for diffs], Tue Oct 19 18:29:59 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.115 (colored)

indent: if a file ends with indent off, don't add space-newline

Revision 1.94 / (download) - annotate - [select for diffs], Mon Oct 11 19:04:47 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.93: +7 -7 lines
Diff to previous 1.93 (colored) to selected 1.115 (colored)

indent: use bool for suppress_blanklines

It only ever got assigned the values 0 and 1.

No functional change.

Revision 1.93 / (download) - annotate - [select for diffs], Mon Oct 11 18:55:49 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.92: +2 -12 lines
Diff to previous 1.92 (colored) to selected 1.115 (colored)

indent: remove dead code

Revision 1.92 / (download) - annotate - [select for diffs], Sat Oct 9 11:13:25 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.91: +14 -13 lines
Diff to previous 1.91 (colored) to selected 1.115 (colored)

indent: condense code for calculating indentations

No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Oct 9 11:00:27 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored) to selected 1.115 (colored)

indent: extract common code for advancing a single tab

No functional change.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Oct 8 21:16:23 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.89: +10 -10 lines
Diff to previous 1.89 (colored) to selected 1.115 (colored)

indent: improve local variable names

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Oct 8 21:13:58 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.88: +6 -9 lines
Diff to previous 1.88 (colored) to selected 1.115 (colored)

indent: rename fill_buffer to inbuf_read_line

No functional change.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Oct 8 19:03:34 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored) to selected 1.115 (colored)

indent: run indent on indent.h

The formatting looks mostly OK.

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

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

No functional change.

Revision 1.87 / (download) - annotate - [select for diffs], Fri Oct 8 18:29:36 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.86: +2 -7 lines
Diff to previous 1.86 (colored) to selected 1.115 (colored)

indent: fix formatting of C99 comments

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

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

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

Revision 1.86 / (download) - annotate - [select for diffs], Fri Oct 8 17:56:12 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.85: +121 -101 lines
Diff to previous 1.85 (colored) to selected 1.115 (colored)

indent: split dump_line into smaller functions

No functional change.

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

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

Revision 1.84 / (download) - annotate - [select for diffs], Fri Oct 8 17:12:08 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.83: +7 -10 lines
Diff to previous 1.83 (colored) to selected 1.115 (colored)

indent: replace column calculations with indent, part 3

No functional change.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Oct 8 17:07:36 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.82: +11 -11 lines
Diff to previous 1.82 (colored) to selected 1.115 (colored)

indent: replace column calculations with indent, part 2

No functional change.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Oct 8 17:04:13 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.81: +11 -11 lines
Diff to previous 1.81 (colored) to selected 1.115 (colored)

indent: calculate indentation instead of column

This avoids constantly adding and subtracting 1.

No functional change.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Oct 8 17:00:21 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.80: +15 -18 lines
Diff to previous 1.80 (colored) to selected 1.115 (colored)

indent: reduce indentation in dump_line

Revision 1.80 / (download) - annotate - [select for diffs], Thu Oct 7 23:18:47 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.79: +7 -7 lines
Diff to previous 1.79 (colored) to selected 1.115 (colored)

indent: rename bp_save to saved_inp_s, be_save to saved_inp_e

Using the same naming convention makes it easier to relate the
variables.

No functional change.

Revision 1.79 / (download) - annotate - [select for diffs], Thu Oct 7 23:15:15 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.78: +19 -19 lines
Diff to previous 1.78 (colored) to selected 1.115 (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.78 / (download) - annotate - [select for diffs], Thu Oct 7 21:57:21 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.77: +5 -5 lines
Diff to previous 1.77 (colored) to selected 1.115 (colored)

indent: use braces around multi-line statements

No functional change.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Oct 7 21:52:54 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.76: +30 -3 lines
Diff to previous 1.76 (colored) to selected 1.115 (colored)

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

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Oct 7 21:38:25 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.75: +4 -10 lines
Diff to previous 1.75 (colored) to selected 1.115 (colored)

indent: remove redundant comments

No functional change.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Oct 7 19:35:50 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.74: +4 -4 lines
Diff to previous 1.74 (colored) to selected 1.115 (colored)

indent: clean up colon handling

No functional change.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Oct 7 18:32:09 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.73: +6 -6 lines
Diff to previous 1.73 (colored) to selected 1.115 (colored)

indent: raise WARNS from the default 5 up to 6

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 5 21:05:12 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.72: +24 -25 lines
Diff to previous 1.72 (colored) to selected 1.115 (colored)

indent: rewrite parse_indent_comment for human readers

The generated code is still very similar, GCC does a good job at
inlining strncmp.

No functional change.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Oct 5 18:50:42 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.71: +10 -10 lines
Diff to previous 1.71 (colored) to selected 1.115 (colored)

indent: rename n_real_blanklines

The word 'n' was not as helpful as possible, the word 'real' did not
give any clue at all about the variable's purpose.

No functional change.

Revision 1.71 / (download) - annotate - [select for diffs], Tue Oct 5 06:24:06 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.70: +7 -7 lines
Diff to previous 1.70 (colored) to selected 1.115 (colored)

indent: rename local char variable, reduce scope of counters

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Oct 5 06:15:24 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.115 (colored)

indent: use proper escape sequence for form feed

This escape sequence has been available since at least 1978.

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

indent: merge duplicate code into is_hspace

No functional change.

Revision 1.68 / (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.67: +3 -2 lines
Diff to previous 1.67 (colored) to selected 1.115 (colored)

indent: unexport global variables

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

No functional change.

Revision 1.67 / (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.66: +29 -25 lines
Diff to previous 1.66 (colored) to selected 1.115 (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.66 / (download) - annotate - [select for diffs], Sat Sep 25 22:57:04 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.65: +3 -5 lines
Diff to previous 1.65 (colored) to selected 1.115 (colored)

indent: misc cleanup

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Sep 25 22:54:32 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored) to selected 1.115 (colored)

indent: convert found_err to bool

That variable had slipped through the migration since it consequently
used int for the declaration, the definition and all assignments.

No functional change.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Sep 25 20:56:53 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored) to selected 1.115 (colored)

indent: un-abbreviate a few parser_state members, clean up comments

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Sat Sep 25 20:23:42 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.62: +3 -6 lines
Diff to previous 1.62 (colored) to selected 1.115 (colored)

indent: remove dead code for printing comments after empty lines

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

No functional change.

Revision 1.62 / (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.61: +5 -9 lines
Diff to previous 1.61 (colored) to selected 1.115 (colored)

indent: convert remaining ibool to bool

No functional change intended.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Sep 25 17:29:13 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.60: +2 -8 lines
Diff to previous 1.60 (colored) to selected 1.115 (colored)

indent: convert parser_state from ibool to bool

indent.c:400:5: error: suggest parentheses around assignment used as
    truth value
io.c:271:32: error: ãàÏßãàon a boolean expression

No functional change intended.

Revision 1.60 / (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.59: +26 -16 lines
Diff to previous 1.59 (colored) to selected 1.115 (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.59 / (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.58: +2 -6 lines
Diff to previous 1.58 (colored) to selected 1.115 (colored)

indent: remove ifdef for lint

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

Revision 1.58 / (download) - annotate - [select for diffs], Sat Sep 25 10:41:03 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.57: +6 -6 lines
Diff to previous 1.57 (colored) to selected 1.115 (colored)

indent: move statistical values into a separate struct

No functional change.

Revision 1.57 / (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.56: +3 -5 lines
Diff to previous 1.56 (colored) to selected 1.115 (colored)

indent: add nonnull memory allocation functions

The only functional change is a single error message.

Revision 1.56 / (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.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.115 (colored)

indent: group global variables for token buffer

No functional change.

Revision 1.55 / (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.54: +11 -11 lines
Diff to previous 1.54 (colored) to selected 1.115 (colored)

indent: group global variables for code buffer

No functional change.

Revision 1.54 / (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.53: +22 -22 lines
Diff to previous 1.53 (colored) to selected 1.115 (colored)

indent: group global variables for label buffer into struct

No functional change.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Sep 24 18:37:03 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.52: +59 -40 lines
Diff to previous 1.52 (colored) to selected 1.115 (colored)

indent: extract parse_indent_comment from fill_buffer

No functional change.

Revision 1.52 / (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.51: +11 -11 lines
Diff to previous 1.51 (colored) to selected 1.115 (colored)

indent: group global variables for the comment buffer

No functional change.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Sep 24 18:00:13 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.50: +8 -8 lines
Diff to previous 1.50 (colored) to selected 1.115 (colored)

indent: rename local variable in fill_buffer

The local variable name 'com' prevented grouping the global variables
combuf, s_com, e_com and l_com into a struct named 'com'.

No functional change.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Sep 24 16:29:31 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.49: +4 -3 lines
Diff to previous 1.49 (colored) to selected 1.115 (colored)

indent: fix token duplication after C99 comment

The code that keeps blank lines after C99 comments still looks wrong,
but at least it's better than before.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Mar 14 01:44:37 2021 UTC (3 years, 1 month 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.48: +6 -4 lines
Diff to previous 1.48 (colored) to selected 1.115 (colored)

indent: make compute_code_indent more readable

The '?:' operator computing the factor was too hard to read.  When
quickly scanning the code, the 1 in the expression looked too much like
it would be added to the indentation, which would turn the indentation
length into a column number, and that again would smell like an
off-by-one error.

No functional change.

Revision 1.48 / (download) - annotate - [select for diffs], Sun Mar 14 00:22:16 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.47: +4 -4 lines
Diff to previous 1.47 (colored) to selected 1.115 (colored)

indent: fix lint warnings

No functional change.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Mar 13 18:46:39 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.46: +3 -2 lines
Diff to previous 1.46 (colored) to selected 1.115 (colored)

indent: add debug logging for switching the input buffer

No functional change outside debug mode.

Revision 1.46 / (download) - annotate - [select for diffs], Sat Mar 13 18:24:56 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.45: +10 -12 lines
Diff to previous 1.45 (colored) to selected 1.115 (colored)

indent: align comments in indent's own code

No functional change.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Mar 13 13:55:42 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.44: +11 -11 lines
Diff to previous 1.44 (colored) to selected 1.115 (colored)

indent: rename local variable in dump_line

This clarifies that the variable names a column, not an indentation.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Mar 13 13:54:01 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.43: +4 -4 lines
Diff to previous 1.43 (colored) to selected 1.115 (colored)

indent: in dump_line, reduce scope of local variable

This allows the variable 'target' in the lower half of the function to
get a more specific name.

No functional change.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Mar 13 13:51:08 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.42: +6 -6 lines
Diff to previous 1.42 (colored) to selected 1.115 (colored)

indent: distinguish between 'column' and 'indentation'

column == 1 + indentation.

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

No functional change.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Mar 13 11:19:43 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored) to selected 1.115 (colored)

indent: fix confusing variable names

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

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

No functional change.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Mar 13 10:32:25 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.40: +6 -18 lines
Diff to previous 1.40 (colored) to selected 1.115 (colored)

indent: inline calls to count_spaces and count_spaces_until

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

No functional change.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Mar 13 10:20:54 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.39: +26 -30 lines
Diff to previous 1.39 (colored) to selected 1.115 (colored)

indent: replace column computation with indentation computation

No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Mar 13 10:06:47 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.38: +19 -14 lines
Diff to previous 1.38 (colored) to selected 1.115 (colored)

indent: replace compute_code_column with compute_code_indent

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

No functional change.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Mar 13 09:54:11 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.37: +9 -8 lines
Diff to previous 1.37 (colored) to selected 1.115 (colored)

indent: replace compute_label_column with compute_label_indent

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

No functional change.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Mar 13 09:48:04 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.36: +8 -8 lines
Diff to previous 1.36 (colored) to selected 1.115 (colored)

indent: manually fix indentation in indent's own source code

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 13 09:21:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.35: +24 -8 lines
Diff to previous 1.35 (colored) to selected 1.115 (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.35 / (download) - annotate - [select for diffs], Sat Mar 13 09:06:12 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.34: +3 -15 lines
Diff to previous 1.34 (colored) to selected 1.115 (colored)

indent: remove strange debugging code that went in the output file

Whenever the code to be output contained the magic byte 0x80, instead of
writing this byte, indent wrote the column number at the beginning of
the code snippet, times 7.  Especially the 'times 7' does not make any
sense at all.

In ISO-8859-1, this character position is not assigned.  In Microsoft
Codepage 1252 it is the Euro sign.  In UTF-8 (which was probably not on
the author's list when the code was originally written) it occurs as the
middle byte for code points like U+2026 (horizontal ellipsis) from the
block General Punctuation.

Remove this strange code, thereby fixing indent for UTF-8 code.  The
code had been there since at least 1993-04-09, when it was first
imported to NetBSD.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Mar 13 00:26:56 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.33: +30 -44 lines
Diff to previous 1.33 (colored) to selected 1.115 (colored)

indent: replace pad_output with output_indent

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

No functional change.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Mar 13 00:03:29 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.32: +4 -51 lines
Diff to previous 1.32 (colored) to selected 1.115 (colored)

indent: clean up verbose documentation comments from the 1970s

Since C90, there is no need to repeat the type of the function
parameters.

In the whole code of indent, there is a lot of confusion between the
concepts of a 'column' (which is a position on the screen, counting
starts at 1) and 'indentation' (which is a length, not a position).  To
avoid this confusion, the code will be rewritten anyway very soon.

Repeatedly adding and subtracting 1 from the 'current column' is not
elegant, this should rather be done by consistently measuring only the
indentation from the left border (at offset 0), as a distance, not as an
absolute position.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Mar 12 23:27:41 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.31: +12 -14 lines
Diff to previous 1.31 (colored) to selected 1.115 (colored)

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

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

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

No functional change.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Mar 12 23:16:00 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.30: +10 -10 lines
Diff to previous 1.30 (colored) to selected 1.115 (colored)

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

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

No functional change.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Mar 12 23:10:18 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.29: +11 -16 lines
Diff to previous 1.29 (colored) to selected 1.115 (colored)

indent: use consistent indentation for 'else'

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

No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Mar 12 19:14:18 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored) to selected 1.115 (colored)

indent: make output_string inline

GCC 9.3.0 didn't notice that the argument to this function is always a
string literal, which makes it worthwhile to inline the call.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Mar 12 19:11:29 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.27: +52 -21 lines
Diff to previous 1.27 (colored) to selected 1.115 (colored)

indent: add helper functions for doing the actual output

This allows to add debug logging to these few functions instead of all
other places that might output something.

Reducing the possible output formats to a few primitives makes dump_line
simpler, especially the fprintf calls.  It also removes the non-constant
printf string.

The call to output_int may be meant for debugging, as the character 0x80
is unlikely to appear in any real-world code.

No functional change.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Mar 8 22:28:31 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.26: +3 -4 lines
Diff to previous 1.26 (colored) to selected 1.115 (colored)

indent: remove redundant initializer in dump_line

No functional change.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 8 22:26:17 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.25: +8 -7 lines
Diff to previous 1.25 (colored) to selected 1.115 (colored)

indent: move comment about dump_line to column 1

It looked misplaced on the right side since that area is usually
reserved for small remarks, not long explanations.

No functional change.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Mar 8 22:23:58 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.24: +7 -6 lines
Diff to previous 1.24 (colored) to selected 1.115 (colored)

indent: always use braces in do-while loops

Having a 'while' at the beginning of a line looks as if it would start a
loop.  It's confusing when it _ends_ a loop instead.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 7 22:11:01 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.23: +7 -2 lines
Diff to previous 1.23 (colored) to selected 1.115 (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, 1 month ago) by rillig
Branch: MAIN
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored) to selected 1.115 (colored)

indent: remove redundant parentheses around return value

No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Mar 7 10:42:48 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored) to selected 1.115 (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.21 / (download) - annotate - [select for diffs], Sat Mar 6 20:30:06 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.20: +5 -5 lines
Diff to previous 1.20 (colored) to selected 1.115 (colored)

indent: fix space-tab alignment in indent's own code

These parts are not fixed automatically by indent since they are in box
comments.

No functional change.

Revision 1.17.16.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:43 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.17.16.1: +16 -43 lines
Diff to previous 1.17.16.1 (colored) to branchpoint 1.17 (colored) next main 1.18 (colored) to selected 1.115 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.20 / (download) - annotate - [select for diffs], Sat Oct 19 15:44:31 2019 UTC (4 years, 6 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.19: +16 -43 lines
Diff to previous 1.19 (colored) to selected 1.115 (colored)

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

Revision 1.17.16.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:20 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.17: +358 -509 lines
Diff to previous 1.17 (colored) to selected 1.115 (colored)

Sync with HEAD

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

FreeBSD indent r340138

Revision 1.19 / (download) - annotate - [select for diffs], Thu Apr 4 15:22:13 2019 UTC (5 years 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.18: +358 -510 lines
Diff to previous 1.18 (colored) to selected 1.115 (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.18 / (download) - annotate - [select for diffs], Sun Feb 3 03:19:29 2019 UTC (5 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored) to selected 1.115 (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.17 / (download) - annotate - [select for diffs], Thu Feb 25 13:23:27 2016 UTC (8 years, 1 month ago) by ginsbach
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi
Changes since 1.16: +5 -5 lines
Diff to previous 1.16 (colored) to selected 1.115 (colored)

Fix obvious contraction spelling mistakes by adding missing apostrophes.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Feb 22 19:04:18 2016 UTC (8 years, 1 month ago) by ginsbach
Branch: MAIN
Changes since 1.15: +3 -4 lines
Diff to previous 1.15 (colored) to selected 1.115 (colored)

Use errx(3).

Revision 1.14.24.1 / (download) - annotate - [select for diffs], Sun Sep 21 18:58:56 2014 UTC (9 years, 6 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, 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
Changes since 1.14: +7 -5 lines
Diff to previous 1.14 (colored) next main 1.15 (colored) to selected 1.115 (colored)

Pull up following revision(s) (requested by mrg in ticket #110):
	usr.bin/indent/io.c: revision 1.15
	usr.bin/indent/indent_globs.h: revision 1.10
	usr.bin/indent/args.c: revision 1.11
	usr.bin/indent/indent.1: revision 1.23
	usr.bin/indent/indent.c: revision 1.19
port the -ut / -nut options from freebsd.  -ut (default) enables tabs
in output, the -nut uses spaces.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Sep 4 04:06:07 2014 UTC (9 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.14: +7 -5 lines
Diff to previous 1.14 (colored) to selected 1.115 (colored)

port the -ut / -nut options from freebsd.  -ut (default) enables tabs
in output, the -nut uses spaces.

Revision 1.13.42.1 / (download) - annotate - [select for diffs], Wed May 13 19:19:52 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored) next main 1.14 (colored) to selected 1.115 (colored)

Sync with HEAD.

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

Revision 1.14 / (download) - annotate - [select for diffs], Sun Apr 12 11:09:49 2009 UTC (15 years 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-base, 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
Branch point for: netbsd-7
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored) to selected 1.115 (colored)

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

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 16 06:51:22 2003 UTC (20 years, 6 months ago) by itojun
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.12: +6 -4 lines
Diff to previous 1.12 (colored) to selected 1.115 (colored)

safer use of realloc

Revision 1.12 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:09 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
Changes since 1.11: +29 -2 lines
Diff to previous 1.11 (colored) to selected 1.115 (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: +14 -42 lines
Diff to previous 1.10 (colored) to selected 1.115 (colored)

Remove #ifndef'd __STDC__ code. ANSIfy.

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Thu Oct 19 14:48:53 2000 UTC (23 years, 6 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) next main 1.10 (colored) to selected 1.115 (colored)

Pull up revision 1.10 (requested by is):
  The type of the difference between pointers is implementation-
  defined (long on sparc and int on most others).  Compensate when
  printing.

Revision 1.9.10.1 / (download) - annotate - [select for diffs], Tue Oct 17 02:16:44 2000 UTC (23 years, 6 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) next main 1.10 (colored) to selected 1.115 (colored)

Pullup 1.10 [is]:
Due to infinite wisdom by the language designers, the difference of pointers
has a type of (int) on i386 and (long) on sparc, and I don't even want to
know what else on other cpu types.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Oct 14 18:07:10 2000 UTC (23 years, 6 months ago) by is
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: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.115 (colored)

Due to infinite wisdom by the language designers, the difference of pointers
has a type of (int) on i386 and (long) on sparc, and I don't even want to
know what else on other cpu types.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Dec 19 17:00:08 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-ALPHA2, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Branch point for: netbsd-1-5, netbsd-1-4
Changes since 1.8: +8 -8 lines
Diff to previous 1.8 (colored) to selected 1.115 (colored)

char -> unsigned char, braces for gcc-2.8.1

Revision 1.8 / (download) - annotate - [select for diffs], Tue Aug 25 20:59:37 1998 UTC (25 years, 7 months ago) by ross
Branch: MAIN
Changes since 1.7: +27 -11 lines
Diff to previous 1.7 (colored) to selected 1.115 (colored)

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

Revision 1.7 / (download) - annotate - [select for diffs], Mon Mar 30 02:25:33 1998 UTC (26 years ago) by mrg
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored) to selected 1.115 (colored)

use static int instead of static

Revision 1.6 / (download) - annotate - [select for diffs], Sun Oct 19 14:06:35 1997 UTC (26 years, 6 months ago) by mrg
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: +3 -3 lines
Diff to previous 1.5 (colored) to selected 1.115 (colored)

fix compile warnings on the alpha.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Oct 19 03:17:23 1997 UTC (26 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.4: +503 -467 lines
Diff to previous 1.4 (colored) to selected 1.115 (colored)

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

Revision 1.4 / (download) - annotate - [select for diffs], Sat Oct 18 16:04:45 1997 UTC (26 years, 6 months ago) by mrg
Branch: MAIN
Changes since 1.3: +9 -5 lines
Diff to previous 1.3 (colored) to selected 1.115 (colored)

merge lite-2.

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

RCS ID police

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:14:32 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.115 (colored)

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Jun 6 21:52:29 1993 UTC (30 years, 10 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.115 (colored)

4.4BSD-Lite2

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 9 12:59:14 1993 UTC (31 years 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.115 (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>