Commit Graph

286284 Commits

Author SHA1 Message Date
rillig 689a1f7922 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.
2021-03-13 00:26:56 +00:00
rillig 47a823baba 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.
2021-03-13 00:03:29 +00:00
rillig 8f15c12d1f 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.
2021-03-12 23:27:41 +00:00
rillig a0306e684f indent: replace 'target' with 'indent' in function names
The word 'target' was not as specific as possible.

No functional change.
2021-03-12 23:16:00 +00:00
rillig 2be5ec967d indent: use consistent indentation for 'else'
Half of the code used -ce, the other half the opposite -nce.

No functional change.
2021-03-12 23:10:18 +00:00
rillig b69ea1ee50 tests/indent: add test for preprocessor lines 2021-03-12 22:53:18 +00:00
fcambus 3a79b57aac Update Spleen wscons fonts to version 1.9.0, bringing the following
improvements:

- Enlarge vertical line for consistency with other small sizes (5x8 version)
- Add full support for the Latin-1 Supplement Unicode block (6x12 version)
2021-03-12 21:07:08 +00:00
rillig 2603dcca0f 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.
2021-03-12 19:14:18 +00:00
rillig 51ad939870 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.
2021-03-12 19:11:29 +00:00
rillig 40f5d5969a tests/indent: demonstrate stray empty line at end-of-file 2021-03-12 18:28:07 +00:00
rillig d07ba49995 indent: fix misleading indentation in indent's own code
No functional change.
2021-03-12 18:11:50 +00:00
thorpej 3ae28cf29b Fix paste-o in last. 2021-03-12 18:10:00 +00:00
rillig 61a2b8d236 indent: move code for tokenizing numbers further up
Having it directly below the table makes it easier understandable.

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

No functional change.
2021-03-12 17:46:48 +00:00
rillig 23562e890e tests/indent: test tokenization of punctuation, mainly operators 2021-03-12 17:41:10 +00:00
fcambus cff63e93ae Update Spleen kernel fonts to version 1.9.0, bringing the following
improvements:

- Enlarge vertical line for consistency with other small sizes (5x8 version)
- Add full support for the Latin-1 Supplement Unicode block (6x12 version)
2021-03-12 17:03:06 +00:00
nia 73bd0f0df6 Use inline cross-references. 2021-03-12 10:48:29 +00:00
nia c11974cbe1 Use inline cross-references 2021-03-12 10:45:43 +00:00
uwe 33da33a43d Retire the paragraph from 1983 that says this file can be "created
from the official host data base maintained at the Network Information
Control Center (NIC)".  Suggested by Henry Bent.
2021-03-12 10:00:32 +00:00
nia 6cfc1dcd83 s/Disk and tape/Storage/g, more relevant cross-references 2021-03-12 08:28:20 +00:00
nia 44d60cf0a4 add rtsx(4) 2021-03-12 08:19:29 +00:00
nia f2b94eb614 Clarify problem. 2021-03-12 08:03:24 +00:00
thorpej 6311fdd048 Re-factor the code in pmap_extract() that checks the 601 I/O segment
table and the BAT tables into separate functions that can be called
from outside of the pmap module.
2021-03-12 04:57:42 +00:00
knakahara 9f07171dbd Refactor rxr->next_to_check updating. 2021-03-12 01:54:29 +00:00
knakahara d712b4adb8 Remove extra unlock/lock processing around if_percpuq_enqueue().
same as if_wm.c:r1.700
2021-03-12 01:53:36 +00:00
rillig 81c22dc68a indent: manually fix indentation
No functional change.
2021-03-12 00:15:34 +00:00
rillig 3530c7d28f tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then
reassemble them, reformatting them on the way.  These tokens determine
how the output is formatted, therefore add tests for each of the
terminal tokens and nonterminal parser symbols, to cover more common
cases, and edge cases as well.
2021-03-12 00:13:06 +00:00
rillig 200ea2d398 indent: reduce indentation of check_size functions
No functional change.
2021-03-11 22:32:06 +00:00
christos ff8b561e4a remove extra increment; fixes: echo o | sed -e 's/o/\a/' 2021-03-11 22:31:19 +00:00
rillig c7f0688822 indent: remove redundant cast after allocation functions
No functional change.
2021-03-11 22:28:30 +00:00
rillig 72f722fd46 indent: use consistent array indexing
No functional change.
2021-03-11 22:15:44 +00:00
rillig a855cd0537 indent: merge duplicate code for reading from the input buffer
No functional change.
2021-03-11 21:47:36 +00:00
macallan 202e08cd90 add basic support for iMac G5 audio:
- match AOAShasta
- deal with headphone gpios labeled as lineout in OF
- set sc_mode to SNAPPER_IS_PCM3052 - OF makes it look like an unlabeled
  TAS3004
TODO:
- actually support pcm3052 instead of treating it like a sw codec
2021-03-11 19:36:11 +00:00
palle f7c207741e sun4v: vnet - reception of ethernet frames seems to work now (WIP and code is still full of debug code) 2021-03-11 19:34:11 +00:00
christos d48a1fa0b9 Underscore is a word character (thanks uwe@) 2021-03-11 18:49:18 +00:00
nia 0269aae9a7 Fix missing Xr 2021-03-11 18:16:50 +00:00
nia fe15df49d0 Mention that formats with >16-bit precision cannot yet be used 2021-03-11 17:42:14 +00:00
wiz 4481672ffb Remove trailing whitespace. 2021-03-11 17:13:29 +00:00
nia 490280b5bf Remove dead references 2021-03-11 17:12:42 +00:00
nia 26a3928b4e Use inline cross-references.
Remove dead reference.
2021-03-11 17:01:55 +00:00
nia b111a8ed96 Use inline cross-references 2021-03-11 16:59:04 +00:00
nia 0cea59e8b3 Use inline cross-references.
Remove reference to no-longer-existing FDDI driver.
2021-03-11 16:56:50 +00:00
nia 2c3227d4ff Use inline cross-references. 2021-03-11 16:53:14 +00:00
nia 74ff3ffbf7 Use inline cross-references.
Remove dead references that mandoc complains about.
2021-03-11 16:50:08 +00:00
nia ed05de92ad Reference kernel developer's manual 2021-03-11 16:43:01 +00:00
nia 36e57376af Use inline cross-references. 2021-03-11 16:39:58 +00:00
christos be8d4886f8 improve wording. 2021-03-11 16:36:41 +00:00
nia f1f02abe4d Use inline references. 2021-03-11 16:34:12 +00:00
nia 7343bd7865 Use inline cross-references. 2021-03-11 15:46:03 +00:00
christos 95cea0cc25 Use the same options like m4 (-g turns on GNU, -G turns off GNU) Suggested
by uwe@
2021-03-11 15:45:55 +00:00
nia e4c891f6dc cross-reference pci(9) 2021-03-11 15:44:50 +00:00