Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f572db12 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add section on booleans and bitfields to the style guide

Change-Id: I75df8b638d71bfe2ba1dc98d3eb148d8a61f5b9c
parent 31446d17
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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.