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

Commit 364c1eba authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Android Partner Code Review
Browse files

Merge "Add section on booleans and bitfields to the style guide" into m-wireless-dev

parents 63bae08e f572db12
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line 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
Not only is this a standardized type, it is also safer and provides more
compile-time checks.
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
## Header files
In general, every source file (`.c` or `.cpp`) in a `src/` directory should
In general, every source file (`.c` or `.cpp`) in a `src/` directory should
have a corresponding header (`.h`) in the `include/` directory.
have a corresponding header (`.h`) in the `include/` directory.