mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
adds additional headings to Curly braces section
Adds proposed sub headings to Formatting Style > Curly Braces section
This commit is contained in:
parent
5e5748c99a
commit
7641bdcc91
1 changed files with 4 additions and 1 deletions
|
@ -30,7 +30,7 @@ Sometimes, for example, you may want other columns and line breaks so it looks l
|
|||
Note2: The Astyle settings have been tested and will produce a nice result. Many files will be changed, mostly to the better but maybe not always, so use with care.
|
||||
|
||||
## Curly Braces
|
||||
|
||||
### Functions
|
||||
Functions shall have the opening and closing braces at the beginning of the next line, and followed by a line break.
|
||||
```
|
||||
int function(int x)
|
||||
|
@ -38,9 +38,12 @@ int function(int x)
|
|||
body of function
|
||||
}
|
||||
```
|
||||
### Non-function statement blocks
|
||||
|
||||
#### Opening braces
|
||||
All non-function statement blocks (i.e. `if`, ` switch`, `for`, as well as any others) shall have the opening brace last on the same line, with the following statement on the next line.
|
||||
|
||||
#### Closing braces
|
||||
Closing braces shall be but on the line after the last statement in the block.
|
||||
```
|
||||
if (x is true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue