-
Notifications
You must be signed in to change notification settings - Fork 167
Development Coding standards
Michael Corcoran edited this page Dec 2, 2016
·
6 revisions
- Please use Linux line-endings (LF, no CR).
- Please try to keep diff minimal. If you really feel some re-formatting is necessary, please do it in a separate commit to ease review
- Keep lines reasonably short (80 chars is a good guide), break statements over multiple lines where necessary
- Use
default
cases inswitch
statements only where you really intend it, they neuter compile-time checking of missed code when new enumerations are introduced
The flight side code has historically tried to stick as much as possible with the linux kernel style.
Always defer to K&R conventions when not explicitly covered here.
- Use TABS, not spaces
- Use typedefs only when strictly necessary
- One exception is for device handles where they appear in public declarations of PiOS drivers
-
case
statements are indented at the same level as the parentswitch
- ... more to come ...
Use Qt style and Qt coding conventions
- Use 4 SPACES, not tabs
- DON'T assume that returned pointers are non-null
- Use dynamic UAVO relations where you can, these will (soon) be checked at compile time against UAVO definitions