doc: update coding guidelines

- add a rule for "U" suffix
 - release the restrictions about function documentation

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
Shiqing Gao 2020-10-23 16:47:07 +08:00 committed by David Kinder
parent 30bbfa0d26
commit c51a96a11b

View File

@ -2595,6 +2595,31 @@ Compliant example::
uint32_t test = showcase_u16 + showcase_u32 + showcase_u64;
C-TY-29: "U" suffix shall be used for unsigned integer constants
================================================================
For 8-bit, 16-bit, and 32-bit unsigned integer constants, "U" suffix shall be
used. For 64-bit unsigned integer constants, "UL" suffix shall be used.
Compliant example::
uint8_t showcase_u8 = 8U;
uint16_t showcase_u16 = 16U;
uint32_t showcase_u32 = 32U;
uint64_t showcase_u64 = 64UL;
.. rst-class:: non-compliant-code
Non-compliant example::
uint8_t showcase_u8 = 8;
uint16_t showcase_u16 = 16;
uint32_t showcase_u32 = 32;
uint64_t showcase_u64 = 64;
Identifiers
***********
@ -3240,8 +3265,8 @@ function:
block shall start with :literal:`\ *` (space-asterisk). It also applies to the line which
is used to separate different paragraphs. We'll call it a blank line for
simplicity.
4) For each function, the information shall be documented with the following
order: brief description, detailed description, parameters description,
4) For each function, following information shall be documented:
brief description, detailed description, parameters description,
pre-conditions, post-conditions, return value description, and comments
explaining the actual return values. We'll call each block of information a
paragraph for simplicity. A paragraph may be removed from the list if it is not