Update C Coding standard again. Correct some comments in tools/nxstyle.c
This commit is contained in:
parent
5635e9632c
commit
30d7dbd9a6
@ -419,8 +419,12 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
With braces.
|
With braces.
|
||||||
No blank line separates the beginning left brace from a comment.
|
No blank line separates the line containing the opening left brace from a comment.
|
||||||
No blank line follows a comment that may be the final thing preceding a right brace.
|
No blank line follows a comment that may be the final line preceding a closing right brace.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
With Labels.
|
||||||
|
No blank line separates the line containing the label from a comment.
|
||||||
</li>
|
</li>
|
||||||
</p>
|
</p>
|
||||||
<center><table width="60%" border=1>
|
<center><table width="60%" border=1>
|
||||||
@ -444,6 +448,11 @@
|
|||||||
/* Only a comment */
|
/* Only a comment */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
here:
|
||||||
|
|
||||||
|
/* This is the place */
|
||||||
|
|
||||||
</ul></pre></font>
|
</ul></pre></font>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td bgcolor="white">
|
<tr><td bgcolor="white">
|
||||||
@ -468,6 +477,10 @@
|
|||||||
{
|
{
|
||||||
/* Only a comment */
|
/* Only a comment */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
here:
|
||||||
|
/* This is the place */
|
||||||
|
|
||||||
</ul></pre></font>
|
</ul></pre></font>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table></center>
|
</table></center>
|
||||||
|
@ -119,6 +119,11 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
if (lineno == last_oneline_comment + 1)
|
if (lineno == last_oneline_comment + 1)
|
||||||
{
|
{
|
||||||
|
/* TODO: This generates a false alarm if the current line
|
||||||
|
* contains a right brace. No blank line should be present in
|
||||||
|
* that case.
|
||||||
|
*/
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Missing blank line after comment line. Found at line %d\n",
|
"Missing blank line after comment line. Found at line %d\n",
|
||||||
last_oneline_comment);
|
last_oneline_comment);
|
||||||
@ -179,13 +184,11 @@ int main(int argc, char **argv, char **envp)
|
|||||||
if (line[indent] == '/' && line[indent +1] == '*' &&
|
if (line[indent] == '/' && line[indent +1] == '*' &&
|
||||||
lptr - line == linelen - 3)
|
lptr - line == linelen - 3)
|
||||||
{
|
{
|
||||||
/* TODO: This generates a false alarm if followed by a right brace.
|
|
||||||
* No blank line should be present in that case.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (last_oneline_comment != lineno - 1 &&
|
if (last_oneline_comment != lineno - 1 &&
|
||||||
last_blank_line != lineno - 1)
|
last_blank_line != lineno - 1)
|
||||||
{
|
{
|
||||||
|
/* TODO: This generates a false alarm if preceded by a label. */
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Missing blank line before comment found at line %d\n",
|
"Missing blank line before comment found at line %d\n",
|
||||||
lineno);
|
lineno);
|
||||||
|
Loading…
Reference in New Issue
Block a user