summaryrefslogtreecommitdiffstats
path: root/share/man
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2015-12-05 17:01:38 +0000
committercem <cem@FreeBSD.org>2015-12-05 17:01:38 +0000
commit55c3b70608f1e860b76ccbe9f9376dff70fe9056 (patch)
tree2ebd700d17bd2a8602c3edbb16084ffc870dbcc0 /share/man
parent4019e88aeea6550f16ee2d9a1751f2f69ad622f0 (diff)
downloadFreeBSD-src-55c3b70608f1e860b76ccbe9f9376dff70fe9056.zip
FreeBSD-src-55c3b70608f1e860b76ccbe9f9376dff70fe9056.tar.gz
style.9: Add a small blurb about allowing bool
It was allowed before, but make it very explicit it is allowed now. And prefer 'bool' to older types that were used for the same purpose -- int and boolean_t. Like with the C99 fixed-width types, use common sense when changing old code. No igor regressions. Suggested by: bde <20151205031713.T3286@besplex.bde.org> Reviewed by: glebius, davide, bapt (earlier versions) Reviewed by: imp Feedback from: julian Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4384
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/style.926
1 files changed, 25 insertions, 1 deletions
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index 1d0c7b3..946df14 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -26,7 +26,7 @@
.\" From: @(#)style 1.14 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd November 22, 2015
+.Dd December 5, 2015
.Dt STYLE 9
.Os
.Sh NAME
@@ -288,6 +288,30 @@ Like white-space commits, care should be taken in making
.Vt uintXX_t
only commits.
.Pp
+Similarly, the project is slowly moving to use the
+.St -isoC-99
+.Vt bool
+in preference to the older
+.Vt int
+or
+.Vt boolean_t .
+New code should use
+.Vt bool ,
+and old code may be converted if it is
+reasonable to do so.
+Literal values are named
+.Dv true
+and
+.Dv false .
+These are preferred to the old spellings
+.Dv TRUE
+and
+.Dv FALSE .
+Userspace code should include
+.In stdbool.h ,
+while kernel code should include
+.In sys/types.h .
+.Pp
Enumeration values are all uppercase.
.Bd -literal
enum enumtype { ONE, TWO } et;
OpenPOWER on IntegriCloud