Skip to content

Commit 062007a

Browse files
authored
Merge pull request #773 from Riksu9000/coding_style
Update coding style
2 parents 89a29e9 + f56bd4c commit 062007a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

doc/contribute.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,10 @@ If there are no preconfigured rules for your IDE, you can use one of the existin
9494
- **Includes** :
9595
- files from the project : `#include "relative/path/to/the/file.h"`
9696
- external files and std : `#include <file.h>`
97+
- Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative)
98+
- Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name.
99+
- Examples:
100+
- `auto* app = static_cast<DisplayApp*>(instance);`
101+
- `auto number = static_cast<uint8_t>(variable);`
102+
- `uint8_t returnValue = MyFunction();`
103+
- Use nullptr instead of NULL

0 commit comments

Comments
 (0)