mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-10 07:55:15 +00:00
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:
parent
30bbfa0d26
commit
c51a96a11b
@ -2595,6 +2595,31 @@ Compliant example::
|
|||||||
uint32_t test = showcase_u16 + showcase_u32 + showcase_u64;
|
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
|
Identifiers
|
||||||
***********
|
***********
|
||||||
@ -3240,8 +3265,8 @@ function:
|
|||||||
block shall start with :literal:`\ *` (space-asterisk). It also applies to the line which
|
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
|
is used to separate different paragraphs. We'll call it a blank line for
|
||||||
simplicity.
|
simplicity.
|
||||||
4) For each function, the information shall be documented with the following
|
4) For each function, following information shall be documented:
|
||||||
order: brief description, detailed description, parameters description,
|
brief description, detailed description, parameters description,
|
||||||
pre-conditions, post-conditions, return value description, and comments
|
pre-conditions, post-conditions, return value description, and comments
|
||||||
explaining the actual return values. We'll call each block of information a
|
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
|
paragraph for simplicity. A paragraph may be removed from the list if it is not
|
||||||
|
Loading…
Reference in New Issue
Block a user