diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index aff0e9d732..ab596429c6 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -307,14 +307,14 @@
struct some_long_struct_name_s { - /* The forward link to the next instance of struct - * some_long_struct_name_s in a singly linked list + /* The forward link to the next instance of struct + * some_long_struct_name_s in a singly linked list. */ struct some_long_struct_name_s *flink; - int short_name1; /* Short comment 1 */ + int short_name1; /* Short comment 1. */ int short_name2; /* This is a very long comment describing subtle - * aspects of the short_name2 field */ + * aspects of the short_name2 field. */ }; FAR struct some_medium_name_s *ptr = (FAR struct some_medium_name_s *) @@ -384,8 +384,8 @@General. - Within a comment, the text must be standard English conforming to standard English rules or grammar and spelling (US English spelling). - Of course, this is not the place to summarize all English grammar, but as examples: + Within a comment, the text must be standard English conforming to standard English rules of grammar and spelling (US English spelling). + Of course, this is not the place to summarize all English grammar, but as examples of common grammatic issues in comments:
Line Spacing @@ -408,9 +412,9 @@
Incorrect
- /* Set a equal to b */ + /* set a equal to b */ a = b; - /* Set b equal to c */ + /* set b equal to c */ b = c;
Correct
- /* Set a equal to b */ + /* Set a equal to b. */ a = b; - /* Set b equal to c */ + /* Set b equal to c. */ b = c; @@ -453,7 +457,7 @@@@ -509,23 +513,23 @@ Correct
- /* This is a single line comment */ + /* This is a single line comment. */Acceptable
- dog = cat; /* Make the dog be a cat */ - monkey = oxen; /* Make the monkey be an oxen */ - aardvark = macaque; /* Make the aardvark be a macaque */ + dog = cat; /* Make the dog be a cat. */ + monkey = oxen; /* Make the monkey be an oxen. */ + aardvark = macaque; /* Make the aardvark be a macaque. */@@ -571,12 +575,12 @@ struct animals_s Preferred
- /* Make the dog be a cat */ + /* Make the dog be a cat. */ dog = cat; - /* Make the monkey be an oxen */ + /* Make the monkey be an oxen. */ monkey = oxen; - /* Make the aardvark be a macaque */ + /* Make the aardvark be a macaque. */ aardvark = macaque;@@ -557,12 +561,12 @@ struct animals_sstruct animals_s { - int dog; /* This is a dog */ - int cat; /* This is a cat */ - double monkey; /* This is a monkey */ - double oxen; /* This is an oxen */ - bool aardvark; /* This is an aardvark */ - bool macaque; /* This is a macaque */ + int dog; /* This is a dog. */ + int cat; /* This is a cat. */ + double monkey; /* This is a monkey. */ + double oxen; /* This is an oxen. */ + bool aardvark; /* This is an aardvark. */ + bool macaque; /* This is a macaque. */ };
struct animals_s { - int dog; /* This is a dog */ - int cat; /* This is a cat */ - double monkey; /* This is a monkey */ - double oxen; /* This is an oxen */ - bool aardvark; /* This is an aardvark */ - bool macaque; /* This is a macaque */ + int dog; /* This is a dog. */ + int cat; /* This is a cat. */ + double monkey; /* This is a monkey. */ + double oxen; /* This is an oxen. */ + bool aardvark; /* This is an aardvark. */ + bool macaque; /* This is a macaque. */ };@@ -611,16 +615,16 @@ struct animals_s
Correct
-/* This is a structure of animals */ +/* This is a structure of animals. */ struct animals_s { - int dog; /* This is a dog */ - int cat; /* This is a cat */ - double monkey; /* This is a monkey */ - double oxen; /* This is an oxen */ - bool aardvark; /* This is an aardvark */ - bool macaque; /* This is a macaque */ + int dog; /* This is a dog. */ + int cat; /* This is a cat. */ + double monkey; /* This is a monkey. */ + double oxen; /* This is an oxen. */ + bool aardvark; /* This is an aardvark. */ + bool macaque; /* This is a macaque. */ };
union xyz_union_u { - uint8_t b[4]; /* Byte values */ - uint16_t h[2]; /* Half word values */ - uint32_t w; /* Word Value */ + uint8_t b[4]; /* Byte values. */ + uint16_t h[2]; /* Half word values. */ + uint32_t w; /* Word Value. */ }; struct xyz_info_s @@ -1389,9 +1393,9 @@ struct xyz_info_s ... union { - uint8_t b[4]; /* Byte values */ - uint16_t h[2]; /* Half word values */ - uint32_t w; /* Word Value */ + uint8_t b[4]; /* Byte values. */ + uint16_t h[2]; /* Half word values. */ + uint32_t w; /* Word Value. */ } u; ... }; @@ -1445,12 +1449,12 @@ struct xyz_info_s
enum xyz_state_e { - XYZ_STATE_UNINITIALIZED = 0, /* Uninitialized state */ - XYZ_STATE_WAITING, /* Waiting for input state */ - XYZ_STATE_BUSY, /* Busy processing input state */ - XYZ_STATE_ERROR, /* Halted due to an error */ - XYZ_STATE_TERMINATING, /* Terminating stated */ - XYZ_STATE_TERMINATED /* Terminating stated */ + XYZ_STATE_UNINITIALIZED = 0, /* Uninitialized state. */ + XYZ_STATE_WAITING, /* Waiting for input state. */ + XYZ_STATE_BUSY, /* Busy processing input state. */ + XYZ_STATE_ERROR, /* Halted due to an error. */ + XYZ_STATE_TERMINATING, /* Terminating stated. */ + XYZ_STATE_TERMINATED /* Terminating stated. */ };@@ -2096,14 +2100,14 @@ x++;
switch (...) { - case 1: /* Example of a comment following a case selector */ + case 1: /* Example of a comment following a case selector. */ ... - /* Example of a comment preceding a case selector */ + /* Example of a comment preceding a case selector. */ case 2: { - /* Example of comment following the case selector */ + /* Example of comment following the case selector. */ int value; ...