Commit Graph

286340 Commits

Author SHA1 Message Date
rillig 115656881d make: document how error handling should be done correctly
Right now, when a variable expression cannot be parsed, the result of
calling Var_Subst is a string containing garbage, and no error is
reported.  In addition, there are some silent errors that are not
reported at all.  This combination makes it difficult to change the
error handling without introducing subtle breakage in some edge cases.

An example for garbage output is in varmod-subst-regex.mk, in target
mod-regex-compile-error.

No functional change.
2021-03-14 15:04:13 +00:00
rin 8b206140eb Build rump for PPC_OEA64 on evbppc64. 2021-03-14 13:11:59 +00:00
rillig 63e8f1e660 tests/make: add test for short-circuit evaluation of modifiers 2021-03-14 11:49:37 +00:00
rillig 58e152bdc2 make: sort modifiers in ApplyModifier alphabetically
No functional change.
2021-03-14 11:15:37 +00:00
rillig 8902b05acf make: fix wrong expression evaluation in -dL mode
The modifier ':C' now only compiles the regular expression if the result
of the expression is actually needed.

Several other modifiers have the same bug of evaluating the expression
in cases where this is not needed.  It just doesn't show up because they
don't have any noticeable side effects, other than wasting CPU time.
This affects irrelevant conditions as well.
2021-03-14 10:57:12 +00:00
rillig 0ed436993c make: demonstrate wrong expression evaluation in -dL mode 2021-03-14 10:45:51 +00:00
skrll 4cfcc99482 Sprinkle kpreempt_{dis,en}able ready for when preemption gets turned on. 2021-03-14 10:36:46 +00:00
skrll 34ee086f83 Use fdtbus_intr_establish_xname 2021-03-14 08:16:57 +00:00
skrll 7fb67d6ed3 No need to have an MD #ifdef in an MI file, so remove it. 2021-03-14 08:13:58 +00:00
skrll 41a3438ddf Remoave an extra space from a comment 2021-03-14 08:10:23 +00:00
skrll f4ee76b184 Remove an unnecessary if statement in gic_v2m_msi_alloc when finding a
'count' that fits the available.
2021-03-14 08:09:20 +00:00
rillig de1cec24a0 indent: clean up check_size_comment
The additional parameter last_bl_ptr was only necessary because the last
blank was stored as a pointer into the buffer.  By storing the index in
the buffer instead, it doesn't need to be updated all the time.

No functional change.
2021-03-14 05:26:42 +00:00
rillig a8e5d6abb4 indent: remove trailing whitespace 2021-03-14 04:52:10 +00:00
rillig f21f69f749 indent: clean up target column computation in process_comment
No functional change.
2021-03-14 04:42:17 +00:00
rin 485b8b3cff Enable NFS_BOOT_UDP; on-board NIC seems to be too slow for overhead due to
NFS over TCP. Some scores of pkgsrc/benchmarks/bonnie improve nearly x2.
2021-03-14 03:35:39 +00:00
rin eb13d3e4ac Fix DJMEMCMAX option for Quadra/Centris 650/800.
- Use jeq instead of jra for conditional branch.
- Use cmpl instead of cmp (= cmpw) for int variables.

Now, my Quadra 800 recognizes full 520MB memory!
2021-03-14 03:25:01 +00:00
rin 482f9a49eb Initialize dp->rd_cmap_{red,green,blue} in radeonfb_init_palette() for 8bpp,
so that color map can be obtained by WSDISPLAYIO_GETCMAP ioctl(2).

Now, mlterm-fb from pkgsrc/x11/mlterm works just fine on radeonfb(4).
2021-03-14 03:14:42 +00:00
rin 623d9b5490 Fix typo: s/--r/-r/ 2021-03-14 02:56:51 +00:00
rin 35a048da19 Document NFS_BOOT_UDP instead of NFS_BOOT_TCP; We've switched to
NFS over TCP by default.

Bump date.
2021-03-14 02:56:07 +00:00
rin 8c6ac8307c Comment on CTASSERT() in COND_SET_STRUCT(); this is a sanity check to
avoid hashing/assigning large structure. Upper-bound is arbitrary, but
be carefully for performance penalty if bumping.

Thanks christos for discussion.
2021-03-14 02:53:57 +00:00
rillig 3cc06592f5 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.
2021-03-14 01:44:37 +00:00
rillig 1e4c413bac indent: fix off-by-one error in comment wrapping
The manual page says that the default maximum length of a comment line
is 78.  The test 'comments.0' wrongly assumed that this 78 would refer
to the maximum _column_ allowed, which is off by one.

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

Several other tests just happened to hit that limit, fix these as well.
2021-03-14 01:34:13 +00:00
rillig 80a063b8f7 tests/indent: demonstrate off-by-one error in comment processing 2021-03-14 00:50:39 +00:00
rillig bd908d33db indent: give indent a try at formatting its own code
Formatting indent.h required the following manual corrections
afterwards:

The first tab in the comment in line 1 was replaced with a space but
shouldn't be.

The spacing around the '...' in function prototypes was completely
wrong.  It looked like 'const char *,...)__printflike', without any
spaces.

The '*' of the return type 'const char *' was tied to the function name,
even though this declaration was only for a single function.  In such a
case, it's more appropriate to line up the function names.

The function-like macros were not indented to -di.  This is something
that I would not expect from indent, so it's ok to do that manually.
2021-03-14 00:33:25 +00:00
rillig 744982a9b6 indent: fix lint warnings
No functional change.
2021-03-14 00:22:16 +00:00
rillig 1eb04b8cb5 indent: remove disabled duplicate RCS ID from header
By convention, headers don't record their RCS ID.
2021-03-13 23:42:23 +00:00
rillig c960730f11 indent: fix documentation of parser_state.paren_indents
The column position is not the same as the indentation (off-by-one).
2021-03-13 23:36:10 +00:00
mlelstv 6db11d86ef Enable block count only for count > 0.
Don't enable autostop when command sets new flag SCF_NO_STOP.
2021-03-13 23:26:47 +00:00
mlelstv 553854fbeb define NO_STOP flag 2021-03-13 23:22:44 +00:00
palle b7b2672bfd sun4v: vnet - reception and transmission of eternet frames seems to work now (it is possible to ping 8.8.8.8 from inside a sun4v ldom). Still cleanup of debug code to be done. 2021-03-13 20:21:37 +00:00
rillig fea66a5127 indent: add debug logging for switching the input buffer
No functional change outside debug mode.
2021-03-13 18:46:39 +00:00
rillig eb340c3e4a indent: align comments in indent's own code
No functional change.
2021-03-13 18:24:56 +00:00
rillig 56c4653e3f indent: remove the '+ 1' from right margin calculation in comment
No functional change.
2021-03-13 18:11:31 +00:00
skrll ab6f34e350 s/pfi_faultpte/&p/ for consistency with arm / other uses of ptep 2021-03-13 17:14:11 +00:00
christos 9c2966c186 record the libblocklist dependency 2021-03-13 16:46:49 +00:00
christos cf29492e59 Handle \t too (RVP) 2021-03-13 15:46:54 +00:00
skrll e9de112945 Consistently use %#jx instead of 0x%jx or just %jx in UVMHIST_LOG formats 2021-03-13 15:29:55 +00:00
skrll 5256ea236d Don't use %jx for 0 or 1 - just use %jd in UVMHIST_LOG format. 2021-03-13 15:29:13 +00:00
rillig 7e11a5f382 indent: rename local variable in dump_line
This clarifies that the variable names a column, not an indentation.
2021-03-13 13:55:42 +00:00
rillig 7301e2c2d1 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.
2021-03-13 13:54:01 +00:00
rillig 66af9142ab 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.
2021-03-13 13:51:08 +00:00
rillig 7ad6720446 indent: rename pr_comment to process_comment, clean up documentation
No functional change.
2021-03-13 13:25:23 +00:00
rillig 93e110b15f indent: fix handling of '/*' in string literal in preprocessing line
Previously, the '/*' in the string literal had been interpreted as the
beginning of a comment, which was wrong.  Because of that, the variable
declaration in the following line was still interpreted as part of the
comment.  The comment even continued until the end of the file.

Due to indent's forgiving nature, it neither complained nor even
mentioned that anything had gone wrong.  The decision of rather
producing wrong output than failing early is a dangerous one.

At least, there should have been an error message that at the end of the
file, the parser was still in a a comment, expecting the closing '*/'.
2021-03-13 13:14:14 +00:00
rillig 658877681d tests/indent: add another test case for preprocessing directives
In process_preprocessing, the variable 'quote' is not used, which makes
the code suspicious of not handling the combination of string literals
and comments properly.
2021-03-13 13:04:13 +00:00
rillig 102d371a8a indent: split 'main_loop' into several functions
No functional change.
2021-03-13 12:52:24 +00:00
rillig b97b269d52 indent: split 'main' into manageable parts
Since several years (maybe even decades) compilers know how to inline
static functions that are only used once.  Therefore there is no need to
have overly long functions anymore, especially not 'main', which is only
called a single time and thus does not add any noticeable performance
degradation.

No functional change.
2021-03-13 11:47:22 +00:00
rillig acec5beac9 indent: remove redundant parentheses
No functional change.
2021-03-13 11:27:01 +00:00
rillig 0a99ae80ca 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.
2021-03-13 11:19:43 +00:00
rillig 2c2459a1fa indent: document undefined behavior in processing of comments
No functional change.
2021-03-13 10:47:59 +00:00
rillig f3b63c94c8 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.
2021-03-13 10:32:25 +00:00