-
Notifications
You must be signed in to change notification settings - Fork 0
Code Conventions
Code conventions are a very important and serious matter. WingCorp is also filled with very important and very, very serious people. Therefore, it is only fitting that we embrace a clearly defined set of coding conventions
Global variables (e.g. extern int x = 10; ) and functions are also to be named by camelCase.
Structs are to be named using PascalCase
Macros are to be named using ALL_CAPITAL_LETTERS.
The code is to be divided into modules.
A module is named in camel case in the folder structure. A module must consist of a simple directory in the ./src/ directory, but can contain multiple sub-directories and .h and .c files.
Each function, struct and global variable within a module that should be visible to other modules must be prefixed with the module name and an undescore _.
Functions should have clear concise names, usually a function should be verb. However, in order to
In order to keep the initialization and referencing to structs as simple as possible, typedef'ing should be used whenever possible. This can be done in the following fashion:
typedef struct _StructA {
int varA;
int varB;
} StructA;