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 * Public Data
****************************************************************************/ ****************************************************************************/
/* This variable holds the group ID of the current task group. This ID is /* 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 * zero if the current task is a kernel thread that has no address
* environment (other than the kernel context). * environment (other than the kernel context).

View File

@ -331,6 +331,7 @@ uint8_t g_nx_initstate; /* See enum nx_initstate_e */
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This is an array of task control block (TCB) for the IDLE thread of each /* 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, * 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 * there is one TCB per CPU. NOTE: The system boots on CPU0 into the IDLE

View File

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

View File

@ -366,6 +366,7 @@ static inline bool pg_startfill(void)
* the nature of the architecture-specific up_fillpage() function -- Is it * the nature of the architecture-specific up_fillpage() function -- Is it
* a blocking or a non-blocking call? * a blocking or a non-blocking call?
*/ */
#ifdef CONFIG_PAGING_BLOCKINGFILL #ifdef CONFIG_PAGING_BLOCKINGFILL
/* If CONFIG_PAGING_BLOCKINGFILL is defined, then up_fillpage is blocking /* If CONFIG_PAGING_BLOCKINGFILL is defined, then up_fillpage is blocking
* call. In this case, up_fillpage() will accept only (1) a reference to * 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 * the case where all tasks are blocked waiting for a page fill, the IDLE
* task must still be available to run. * task must still be available to run.
*/ */
#endif /* CONFIG_PAGING_BLOCKINGFILL */ #endif /* CONFIG_PAGING_BLOCKINGFILL */
return true; 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 /* The replenishment period must be greater than or equal to the
* budget period. * budget period.
*/ */
#if 1 #if 1
/* REVISIT: In the current implementation, the budget cannot exceed /* REVISIT: In the current implementation, the budget cannot exceed
* half the duty. * 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 /* The replenishment period must be greater than or equal to the
* budget period. * budget period.
*/ */
#if 1 #if 1
/* REVISIT: In the current implementation, the budget cannot /* REVISIT: In the current implementation, the budget cannot
* exceed half the duty. * 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 * enter_critical section are not viable options here (because both depend
* on this_task()). * on this_task()).
*/ */
# warning "Missing critical section" # warning "Missing critical section"
#endif #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 dnest; /* Data declaration nesting level on this line */
int prevdnest; /* Data declaration nesting level on the previous line */ int prevdnest; /* Data declaration nesting level on the previous line */
int pnest; /* Parenthesis nesting level on this 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 blank_lineno; /* Line number of the last blank line */
int noblank_lineno; /* A blank line is not needed after this line */ int noblank_lineno; /* A blank line is not needed after this line */
int lbrace_lineno; /* Line number of last left brace */ 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 */ bnest = 0; /* Brace nesting level on this line */
dnest = 0; /* Data declaration nesting level on this line */ dnest = 0; /* Data declaration nesting level on this line */
pnest = 0; /* Parenthesis 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 */ blank_lineno = -1; /* Line number of the last blank line */
noblank_lineno = -1; /* A blank line is not needed after this line */ noblank_lineno = -1; /* A blank line is not needed after this line */
lbrace_lineno = -1; /* Line number of last left brace */ 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 */ externc_lineno = -1; /* Last line where 'extern "C"' declared */
/* Process each line in the input stream */ /* Process each line in the input stream */
@ -873,16 +873,23 @@ int main(int argc, char **argv, char **envp)
if (--ncomment == 0) if (--ncomment == 0)
{ {
#if 0 /* 'comment_lineno 'holds the line number of the
/* REVISIT: causes false alarms when comment appears to * last closing comment. It is used only to
* the right of a statement. * 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; if (!brhcomment)
#endif {
comment_lineno = lineno;
}
/* Note that brhcomment must persist to support a /* Note that brhcomment must persist to support a
* later test for comment alignment. We will will * later test for comment alignment. We will fix
* fix that at the top of the loop when ncomment == 0. * that at the top of the loop when ncomment == 0.
*/ */
} }
} }