diff options
author | Damien George <damien.p.george@gmail.com> | 2015-06-24 17:34:33 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-06-24 17:35:27 +0100 |
commit | 3299f687f5b3b328008b568473c31dc8796a43c4 (patch) | |
tree | 8a335be4d7f5d475b25bd7da583719fc57e58e2a /CODECONVENTIONS.md | |
parent | 9c7d183a94af60177dea14c1bfd2754dbfdda933 (diff) | |
download | micropython-3299f687f5b3b328008b568473c31dc8796a43c4.tar.gz micropython-3299f687f5b3b328008b568473c31dc8796a43c4.zip |
CODECONVENTIONS.md: Mention macro and enum names.
Diffstat (limited to 'CODECONVENTIONS.md')
-rw-r--r-- | CODECONVENTIONS.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/CODECONVENTIONS.md b/CODECONVENTIONS.md index e9050a2d89..9d5f6d0cca 100644 --- a/CODECONVENTIONS.md +++ b/CODECONVENTIONS.md @@ -36,11 +36,10 @@ Header files: - Header files should be protected from multiple inclusion with #if directives. See an existing header for naming convention. -Function, variable and argument names: +Names: - Use underscore_case, not camelCase for all names. - -Type names and declarations: -- When defining a type, put '_t' after it. +- Use CAPS_WITH_UNDERSCORE for enums and macros. +- When defining a type use underscore_case and put '_t' after it. Integer types: Micro Python runs on 16, 32, and 64 bit machines, so it's important to use the correctly-sized (and signed) integer types. The @@ -58,11 +57,13 @@ Examples Braces, spaces and names: + #define TO_ADD (123) + int foo_function(int x, int some_value) { if (x < some_value) { foo(some_value, x); } else { - foo(x + 1, some_value - 1); + foo(x + TO_ADD, some_value - 1); } for (int my_counter = 0; my_counter < x; my_counter++) { |