summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorZach Johnson <zachoverflow@google.com>2015-03-24 10:05:15 -0700
committerZach Johnson <zachoverflow@google.com>2015-03-25 16:45:28 -0700
commit72ab8914685151a39a82c6548950ee70bca90b60 (patch)
treee33860c99800170b5a3b620ca673457dda0260b7 /doc
parent03f182be7f2cdf06568bf046e1519ed962c89c46 (diff)
downloadandroid_system_bt-72ab8914685151a39a82c6548950ee70bca90b60.tar.gz
android_system_bt-72ab8914685151a39a82c6548950ee70bca90b60.tar.bz2
android_system_bt-72ab8914685151a39a82c6548950ee70bca90b60.zip
Add section on booleans and bitfields to the style guide
Change-Id: I75df8b638d71bfe2ba1dc98d3eb148d8a61f5b9c
Diffstat (limited to 'doc')
-rw-r--r--doc/style_guide.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/style_guide.md b/doc/style_guide.md
index 686888f1c..f2f280498 100644
--- a/doc/style_guide.md
+++ b/doc/style_guide.md
@@ -124,6 +124,10 @@ Use the C99 `bool` type with values `true` and `false` defined in `stdbool.h`.
Not only is this a standardized type, it is also safer and provides more
compile-time checks.
+### Booleans instead of bitfields
+Use booleans to represent boolean state, instead of a set of masks into an
+integer. It's more transparent and readable, and less error prone.
+
## Header files
In general, every source file (`.c` or `.cpp`) in a `src/` directory should
have a corresponding header (`.h`) in the `include/` directory.