-
Notifications
You must be signed in to change notification settings - Fork 41
Code style guide
animehunter edited this page Apr 23, 2014
·
9 revisions
- All spaces replaced with underscores
- Lowercase
- Functions that belong to a group <name> should be named <name>_something(...)
- Argument list should be expanded to multiple lines, if line length is obviously getting too wide.
- Getter functions should ideally be named <prefix>_get_<variable>() or <prefix>_<variable>()
- Setter functions should ideally be named <prefix>_set_<variable>()
- Functions that check if something IS something (eg. object_is_airborne), should return int 0 or 1 for boolean value
- Functions that DO something with given arguments, should return 0 for success, and > 0 for failure code
- Include system headers before library ones
- Include library headers before local ones
- Variables, functions, types and goto labels may only use lowercase letters
- Constants, enumerators and macros may only use UPPERCASE letters