diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-03 12:55:25 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-03 12:55:25 +0000 |
commit | aed582e4228f3ca60d47bc79f86447c01ba686b5 (patch) | |
tree | cfc84a848d5c278b4223bee44e26b67b66e46c03 /doc | |
parent | 47a81338a592084ad4be9e49ba076192e93d6260 (diff) | |
download | riscv-openocd-aed582e4228f3ca60d47bc79f86447c01ba686b5.zip riscv-openocd-aed582e4228f3ca60d47bc79f86447c01ba686b5.tar.gz riscv-openocd-aed582e4228f3ca60d47bc79f86447c01ba686b5.tar.bz2 |
- add openocd coding style to texi
git-svn-id: svn://svn.berlios.de/openocd/trunk@1454 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'doc')
-rw-r--r-- | doc/openocd.texi | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi index d52d1f8..84400fc 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -123,6 +123,41 @@ as numerous bugfixes and enhancements. See the AUTHORS file for regular contribu The main OpenOCD web site is available at @uref{http://openocd.berlios.de/web/}. +@section Coding Style +@cindex Coding Style + +The following rules try to describe formatting and naming conventions that should be +followed to make the whole OpenOCD code look more consistent. The ultimate goal of +coding style should be readability, and these rules may be ignored for a particular +(small) piece of code if that makes it more readable. + +@subsection Formatting rules: +@itemize @bullet +@item remove any trailing white space +@item use TAB characters for indentation, not spaces +@item displayed TAB width is 4 characters +@item make sure NOT to use DOS '\r\n' line feeds +@item do not add more than 2 empty lines to source files +@item do not add trailing empty lines to source files +@item do not use C++ style comments (//) +@item lines may be reasonably wide - there's no anachronistic 80 characters limit +@end itemize + +@subsection Naming rules: +@itemize @bullet +@item identifiers use lower-case letters only +@item identifiers consisting of multiple words use underline characters between consecutive words +@item macros use upper-case letters only +@item structure names shall be appended with '_s' +@item typedefs shall be appended with '_t' +@end itemize + +@subsection Function calls: +@itemize @bullet +@item function calls have no space between the functions name and the parameter +list: my_func(param1, param2, ...) +@end itemize + @node Building @chapter Building @cindex building OpenOCD |