HATPC/Conventions.txt

28 lines
629 B
Plaintext

Trivial Variables: i,n,c,etc... (Only one letter. If one letter isn't clear, then make it a Local Variable)
Local Variables: snake_case
Global Variables: g_snake_case
Const Variables: ALL_CAPS
Typedef Values: suffix _t
Pointer type: do type* var not type *var or type * var.
Braces for statements:
func(type arg)
{
...
}
Braces for struct Variable definition
struct var = {
.var1 = val1,
.var2 = val2
}
Single line is fine, though not recommended for struct with more than 4 fields.
Structs: PascalCase
Enums: PascalCase
Struct Member Variables: camelCase
Enum Values: ALL_CAPS
Functions: snake_case
Macros: ALL_CAPS