HomeFreeBSD

style.9: be explicit about booleans in comparisons

Description

style.9: be explicit about booleans in comparisons

We prefer something like "if (count != 0)" over "if (count)" for
non-boolean variables. This was implicit in examples, but was unclear
for some new contributors. Attempt to clarify by providing a more
explicit statement and example.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30507

(cherry picked from commit 93f7a3023c3147d42dbe3dab58a5a70779587ea5)

Details

Provenance
emasteAuthored on May 27 2021, 3:25 PM
Reviewer
imp
Differential Revision
D30507: style.9: be explicit about booleans in comparisons
Parents
rGb01067349311: struct proc: add locking annotation for p_pendingcnt
Branches
Unknown
Tags
Unknown