Before this refactoring, I had skipped this section of the code from
formatting since the 'default:' branch was enclosed in a block of its
own, and that block would have been indented one more level to the
right. Extracting that code into a separate function got rid of the
extra braces.
No functional change.
For at least the past 27 years, labels have been indented 2 levels to
the left of the corresponding statement. See label_offset and
compute_label_indent (or compute_label_target in FreeBSD).
No idea what the 'rw' in 'rwcode' meant, it had been imported that way
28 years ago. Since rwcode specifies the kind of a keyword, the prefix
'kw_' makes sense.
No functional change.
OpenSSH 8.7 has deprecated ChallengeResponseAuthentication, but not removed
it. It is now an alias for KbdInteractiveAuthentication (as are the prior
aliases of ChallengeResponseAuthentication).
I think this chunk was accidentally dropped in the OpenSSH 8.7 merge.
- There is only a single return from the function (and thus a single
place where the pipe lock must be released).
- kn->kn_data is referenced only inside the lock perimeter.
now its only user. Also initialize it as IPL_SOFTCLOCK; there is no
practical difference in how it operates (it is still an adaptive lock),
but this serves as a visual reminder that we are interlocking against
a callout.
- Add some comments that describe why we don't need to hold kqueue_timer_lock
when detaching an EVFILT_TIMER due to guarantees made by callout_halt().
- Mark timer_filtops as MPSAFE.
fs_klist and take the kqueue_misc_lock inside the event callback.
However, that list can be modified by the attach and detach callbacks,
which could result in the walker stepping right off a cliff.
Instead, we give the fs_klist it's own lock, and hold it while we
call knote(), using the NOTE_SUBMIT protocol. Also, fs_filtops
into vfs_syscalls.c so all of the locking logic is contained in one
file (there is precedence with sig_filtops). fs_filtops is now marked
MPSAFE.
Almost all boolean options are negatable, so model this directly instead
of saving each option twice. This saves memory, is faster and more
directly models reality.
No functional change.
The old name did not mirror the description in the manual page, and it
was the only option that is negated. Inverting it allows the options
table to be compressed.
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.
One might expect that the code of indent is properly indented according
to its own capabilities, but that's not the case, there are many
deviations.
This indentation profile comes close to the existing code. Maybe someday
indent's own source code can be formatted using this profile, but before
attempting that, its remaining bugs have to be fixed.
Development of indent has essentially stopped somewhere around 1990, as
demonstrated by the wrong formatting of '...' that has only been fixed a
few minutes ago. The '...' is an invention of C90. Indent's parser still
considers '...' as consisting of the 3 tokens period-period-period, but
that's OK since the effect is the same.
Another feature that had been missing for a long time were C99 comments
that span from '//' to the next newline. Before March 2021, these were
parsed as a binary operator, which produced lots of funny side effects.
Since indent's code makes use of several C99 features, as soon as it can
properly indent its own code, the worst of these bugs will have been
fixed.
According to lint's C grammar, in standard C an ellipsis only occurs
after a comma. There are GCC extensions that allow an ellipsis as the
only function parameter, as well as in 'case a ... b', but these are
rare.
correct hints. Adjust filt_sysmon_power_read() accordingly (assert
that the mutex is held iff NOTE_SUBMIT).
- Mark sysmon_power_read_filtops as MPSAFE.
- Use seltrue_filtops rather than rolling our own with filt_seltrue.