tools/nxstyle.c: Correct detection of missing blank line following a block comment.

This commit is contained in:
Gregory Nutt 2019-11-09 08:15:12 -06:00
parent 4835c4c017
commit 2ab4d635b4
8 changed files with 25 additions and 10 deletions

View file

@ -52,6 +52,7 @@
/****************************************************************************
* Public Data
****************************************************************************/
/* This variable holds the group ID of the current task group. This ID is
* zero if the current task is a kernel thread that has no address
* environment (other than the kernel context).

View file

@ -331,6 +331,7 @@ uint8_t g_nx_initstate; /* See enum nx_initstate_e */
/****************************************************************************
* Private Data
****************************************************************************/
/* This is an array of task control block (TCB) for the IDLE thread of each
* CPU. For the non-SMP case, this is a a single TCB; For the SMP case,
* there is one TCB per CPU. NOTE: The system boots on CPU0 into the IDLE

View file

@ -58,6 +58,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Output format:
*
* 1111111111222222222233333333334444444444

View file

@ -366,6 +366,7 @@ static inline bool pg_startfill(void)
* the nature of the architecture-specific up_fillpage() function -- Is it
* a blocking or a non-blocking call?
*/
#ifdef CONFIG_PAGING_BLOCKINGFILL
/* If CONFIG_PAGING_BLOCKINGFILL is defined, then up_fillpage is blocking
* call. In this case, up_fillpage() will accept only (1) a reference to
@ -410,6 +411,7 @@ static inline bool pg_startfill(void)
* the case where all tasks are blocked waiting for a page fill, the IDLE
* task must still be available to run.
*/
#endif /* CONFIG_PAGING_BLOCKINGFILL */
return true;

View file

@ -168,6 +168,7 @@ int nxsched_setparam(pid_t pid, FAR const struct sched_param *param)
/* The replenishment period must be greater than or equal to the
* budget period.
*/
#if 1
/* REVISIT: In the current implementation, the budget cannot exceed
* half the duty.

View file

@ -217,6 +217,7 @@ int nxsched_setscheduler(pid_t pid, int policy,
/* The replenishment period must be greater than or equal to the
* budget period.
*/
#if 1
/* REVISIT: In the current implementation, the budget cannot
* exceed half the duty.

View file

@ -90,6 +90,7 @@ FAR struct tcb_s *this_task(void)
* enter_critical section are not viable options here (because both depend
* on this_task()).
*/
# warning "Missing critical section"
#endif

View file

@ -126,7 +126,7 @@ int main(int argc, char **argv, char **envp)
int dnest; /* Data declaration nesting level on this line */
int prevdnest; /* Data declaration nesting level on the previous line */
int pnest; /* Parenthesis nesting level on this line */
int comment_lineno; /* Line on which the last one line comment was closed */
int comment_lineno; /* Line on which the last comment was closed */
int blank_lineno; /* Line number of the last blank line */
int noblank_lineno; /* A blank line is not needed after this line */
int lbrace_lineno; /* Line number of last left brace */
@ -212,11 +212,11 @@ int main(int argc, char **argv, char **envp)
bnest = 0; /* Brace nesting level on this line */
dnest = 0; /* Data declaration nesting level on this line */
pnest = 0; /* Parenthesis nesting level on this line */
comment_lineno = -1; /* Line on which the last one line comment was closed */
comment_lineno = -1; /* Line on which the last comment was closed */
blank_lineno = -1; /* Line number of the last blank line */
noblank_lineno = -1; /* A blank line is not needed after this line */
lbrace_lineno = -1; /* Line number of last left brace */
rbrace_lineno = -1; /* Last line containine a right brace */
rbrace_lineno = -1; /* Last line containing a right brace */
externc_lineno = -1; /* Last line where 'extern "C"' declared */
/* Process each line in the input stream */
@ -873,16 +873,23 @@ int main(int argc, char **argv, char **envp)
if (--ncomment == 0)
{
#if 0
/* REVISIT: causes false alarms when comment appears to
* the right of a statement.
/* 'comment_lineno 'holds the line number of the
* last closing comment. It is used only to
* verify that the comment is followed by a blank
* line. 'comment_lineno' is NOT set here if this
* comment is to the right of the code. In that
* case, no blank link is required following the
* comment
*/
comment_lineno = lineno;
#endif
if (!brhcomment)
{
comment_lineno = lineno;
}
/* Note that brhcomment must persist to support a
* later test for comment alignment. We will will
* fix that at the top of the loop when ncomment == 0.
* later test for comment alignment. We will fix
* that at the top of the loop when ncomment == 0.
*/
}
}