Update 'Coding Style'

Patrick Vogler 2023-06-21 14:28:34 +00:00
parent 915dcbd7c0
commit 0edc44f8dc

@ -15,15 +15,7 @@ This document discusses practices and style for programmers working on the BigWh
</p> </p>
## Content ## Content
- [The Single Most Important Rule](#the-single-most-important-rule)
- [Formatting](#formatting)
- [Indentation](#indentation)
- [Braces](#braces)
- [Functions](#functions)
- [Derived Types](#derived-types)
- [Comments](#comments)
- [Syntactic Conventions](#syntactic_conventions)
- [Names](#names)
## The Single Most Important Rule ## The Single Most Important Rule
Above all, the following rule from the GNOME developer documentation should always be followed. Above all, the following rule from the GNOME developer documentation should always be followed.
@ -51,7 +43,23 @@ while ((c = *str++))
} }
``` ```
Continuation lines should align wrapped elements either vertically using Pythons implicit line joining inside parentheses, brackets and braces, or using a hanging indent [1]. When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation should be used to clearly distinguish itself as a continuation line: Continuation lines should align wrapped elements either vertically using Pythons implicit line joining inside parentheses, brackets and braces, or using a hanging indent [1]. When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation should be used to clearly distinguish itself as a continuation line:
```c
error = initialize_tagtree(&prec_control->tag_inclusion,
prec_control->numCbX,
prec_control->numCbY,
prec_control->numCbZ,
prec_control->numCbTS)
exit(error);
```
```c
error = initialize_tagtree(
&prec_control->tag_inclusion,
prec_control->numCbX,
prec_control->numCbY,
prec_control->numCbZ,
prec_control->numCbTS);
exit(error);
```
### Braces ### Braces
```c ```c
prec_control->numCodeblocks_a = (uint64)(prec_control->numCbX prec_control->numCodeblocks_a = (uint64)(prec_control->numCbX