Update 'Coding Style'
parent
0a4538ca06
commit
7b8bafd7c6
1 changed files with 23 additions and 0 deletions
|
@ -51,16 +51,30 @@ while ((c = *str++))
|
|||
hash = (hash * 33) ^ c;
|
||||
}
|
||||
```
|
||||
Continuation lines should align wrapped elements with the first argument (excluding reference operators) or use a hanging indent. When using a hanging indent, there should be no arguments on the first line and all subsequent "hanging" lines should be indented with 2 spaces in relation to the calling command:
|
||||
|
||||
#### Aligned Along First Deliminator
|
||||
```c
|
||||
# Correct
|
||||
error = initialize_tagtree(&prec_control->tag_inclusion,
|
||||
prec_control->numCbX,
|
||||
prec_control->numCbY,
|
||||
prec_control->numCbZ,
|
||||
prec_control->numCbTS)
|
||||
exit(error);
|
||||
|
||||
# Wrong
|
||||
error = initialize_tagtree(&prec_control->tag_inclusion,
|
||||
prec_control->numCbX,
|
||||
prec_control->numCbY,
|
||||
prec_control->numCbZ,
|
||||
prec_control->numCbTS)
|
||||
exit(error);
|
||||
```
|
||||
|
||||
#### Hanging Indent
|
||||
```c
|
||||
# Correct
|
||||
error = initialize_tagtree(
|
||||
&prec_control->tag_inclusion,
|
||||
prec_control->numCbX,
|
||||
|
@ -68,6 +82,15 @@ error = initialize_tagtree(
|
|||
prec_control->numCbZ,
|
||||
prec_control->numCbTS);
|
||||
exit(error);
|
||||
|
||||
# Wrong
|
||||
error = initialize_tagtree(
|
||||
&prec_control->tag_inclusion,
|
||||
prec_control->numCbX,
|
||||
prec_control->numCbY,
|
||||
prec_control->numCbZ,
|
||||
prec_control->numCbTS);
|
||||
exit(error);
|
||||
```
|
||||
|
||||
### Braces
|
||||
|
|
Loading…
Reference in a new issue