mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
tools/nxstyle.c: Add capability to detect multiple blank lines. Single spacing required by the coding standard. Also coding standard fixes to server .c files for problems found during testing nxstyle.
This commit is contained in:
@@ -66,6 +66,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
/* Debug ********************************************************************/
|
||||||
/* Non-standard debug that may be enabled just for testing Audio */
|
/* Non-standard debug that may be enabled just for testing Audio */
|
||||||
|
|
||||||
@@ -416,6 +417,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
audinfo("AUDIOIOC_SHUTDOWN\n");
|
audinfo("AUDIOIOC_SHUTDOWN\n");
|
||||||
|
|
||||||
/* Call the lower-half driver initialize handler */
|
/* Call the lower-half driver initialize handler */
|
||||||
|
|
||||||
ret = lower->ops->shutdown(lower);
|
ret = lower->ops->shutdown(lower);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
#define CONFIG_PCM_DEBUG 1 /* For now */
|
#define CONFIG_PCM_DEBUG 1 /* For now */
|
||||||
@@ -79,6 +80,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This structure describes the internal state of the PCM decoder */
|
/* This structure describes the internal state of the PCM decoder */
|
||||||
|
|
||||||
struct pcm_decode_s
|
struct pcm_decode_s
|
||||||
|
|||||||
@@ -90,5 +90,3 @@ int dump_module(FAR const struct binary_s *bin)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,5 +67,3 @@ FAR struct binfmt_s *g_binfmts;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#endif /* CONFIG_BINFMT_DISABLE */
|
#endif /* CONFIG_BINFMT_DISABLE */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -199,7 +199,7 @@ static int pcode_run(FAR char *exepath, size_t varsize, size_t strsize)
|
|||||||
|
|
||||||
/* Execute the P-Code program until a stopping condition occurs */
|
/* Execute the P-Code program until a stopping condition occurs */
|
||||||
|
|
||||||
for (;;)
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* Execute the instruction; Check for exceptional conditions */
|
/* Execute the instruction; Check for exceptional conditions */
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -944,11 +944,15 @@ ssize_t rwb_readbytes(FAR struct rwbuffer_s *dev, off_t offset,
|
|||||||
size_t nbytes, FAR uint8_t *buffer)
|
size_t nbytes, FAR uint8_t *buffer)
|
||||||
{
|
{
|
||||||
/* Loop while there are bytes still be be read */
|
/* Loop while there are bytes still be be read */
|
||||||
|
|
||||||
/* Make sure that the sector containing the next bytes to transfer is in
|
/* Make sure that the sector containing the next bytes to transfer is in
|
||||||
* memory.
|
* memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* How many bytes can be transfer from the in-memory data? */
|
/* How many bytes can be transfer from the in-memory data? */
|
||||||
|
|
||||||
/* Transfer the bytes */
|
/* Transfer the bytes */
|
||||||
|
|
||||||
/* Adjust counts and offsets for the next time through the loop */
|
/* Adjust counts and offsets for the next time through the loop */
|
||||||
|
|
||||||
#warning Not Implemented
|
#warning Not Implemented
|
||||||
@@ -956,7 +960,6 @@ ssize_t rwb_readbytes(FAR struct rwbuffer_s *dev, off_t offset,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: rwb_mediaremoved
|
* Name: rwb_mediaremoved
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -240,7 +240,6 @@ float fast_cos(float angle)
|
|||||||
return fast_sin(angle + M_PI_2_F);
|
return fast_sin(angle + M_PI_2_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: fast_sin2
|
* Name: fast_sin2
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ void motor_observer_smo(FAR struct motor_observer_s *o, FAR ab_frame_t *i_ab,
|
|||||||
|
|
||||||
angle_norm_2pi(&angle, 0.0f, 2.0f*M_PI_F);
|
angle_norm_2pi(&angle, 0.0f, 2.0f*M_PI_F);
|
||||||
|
|
||||||
/* Store estimated angle in observer data*/
|
/* Store estimated angle in observer data */
|
||||||
|
|
||||||
o->angle = angle;
|
o->angle = angle;
|
||||||
}
|
}
|
||||||
@@ -423,7 +423,6 @@ void motor_sobserver_div_init(FAR struct motor_sobserver_div_s *so,
|
|||||||
so->one_by_dt = 1.0f/(so->samples * per);
|
so->one_by_dt = 1.0f/(so->samples * per);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: motor_sobserver_div
|
* Name: motor_sobserver_div
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ static uint8_t svm3_sector_get(FAR abc_frame_t *ijk)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void svm3_duty_calc(FAR struct svm3_state_s *s, FAR abc_frame_t *ijk)
|
static void svm3_duty_calc(FAR struct svm3_state_s *s, FAR abc_frame_t *ijk)
|
||||||
{
|
{
|
||||||
|
|||||||
+72
-62
@@ -74,8 +74,9 @@ int main(int argc, char **argv, char **envp)
|
|||||||
int prevncomment;
|
int prevncomment;
|
||||||
int n;
|
int n;
|
||||||
int i;
|
int i;
|
||||||
int last_oneline_comment;
|
int comment_lineno;
|
||||||
int last_blank_line;
|
int blank_lineno;
|
||||||
|
int noblank_lineno;
|
||||||
int linelen;
|
int linelen;
|
||||||
|
|
||||||
instream = fopen(argv[1], "r");
|
instream = fopen(argv[1], "r");
|
||||||
@@ -85,19 +86,19 @@ int main(int argc, char **argv, char **envp)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
btabs = false;
|
btabs = false;
|
||||||
bfunctions = false;
|
bfunctions = false;
|
||||||
bswitch = false;
|
bswitch = false;
|
||||||
bstring = false;
|
bstring = false;
|
||||||
lineno = 0;
|
lineno = 0;
|
||||||
ncomment = 0;
|
ncomment = 0;
|
||||||
nnest = 0;
|
nnest = 0;
|
||||||
declnest = 0;
|
declnest = 0;
|
||||||
prevdeclnest = 0;
|
prevdeclnest = 0;
|
||||||
prevncomment = 0;
|
prevncomment = 0;
|
||||||
last_oneline_comment = -1; /* Line on which the last one line comment was
|
comment_lineno = -1; /* Line on which the last one line comment was closed */
|
||||||
* closed */
|
blank_lineno = -1; /* Line number of the last blank line */
|
||||||
last_blank_line = -1; /* lineno of last blank line */
|
noblank_lineno = -1; /* A blank line is not needed after this line */
|
||||||
|
|
||||||
while (fgets(line, LINE_SIZE, instream))
|
while (fgets(line, LINE_SIZE, instream))
|
||||||
{
|
{
|
||||||
@@ -113,20 +114,25 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
if (line[0] == '\n')
|
if (line[0] == '\n')
|
||||||
{
|
{
|
||||||
last_blank_line = lineno;
|
if (lineno == blank_lineno + 1)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Too many blank lines at line %d\n", lineno);
|
||||||
|
}
|
||||||
|
|
||||||
|
blank_lineno = lineno;
|
||||||
}
|
}
|
||||||
else /* this line is non-blank */
|
else /* this line is non-blank */
|
||||||
{
|
{
|
||||||
if (lineno == last_oneline_comment + 1)
|
if (lineno == comment_lineno + 1)
|
||||||
{
|
{
|
||||||
/* TODO: This generates a false alarm if the current line
|
/* TODO: This generates a false alarm if the current line
|
||||||
* contains a right brace. No blank line should be present in
|
* contains a right brace or a pre-processor line. No blank line
|
||||||
* that case.
|
* should be present in those cases.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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);
|
comment_lineno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +177,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
/* Suppress error for comment following conditional compilation */
|
/* Suppress error for comment following conditional compilation */
|
||||||
|
|
||||||
last_blank_line = lineno;
|
noblank_lineno = lineno;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,8 +190,9 @@ 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)
|
||||||
{
|
{
|
||||||
if (last_oneline_comment != lineno - 1 &&
|
if (comment_lineno != lineno - 1 &&
|
||||||
last_blank_line != lineno - 1)
|
blank_lineno != lineno - 1 &&
|
||||||
|
noblank_lineno != lineno - 1)
|
||||||
{
|
{
|
||||||
/* TODO: This generates a false alarm if preceded by a label. */
|
/* TODO: This generates a false alarm if preceded by a label. */
|
||||||
|
|
||||||
@@ -194,7 +201,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
lineno);
|
lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
last_oneline_comment = lineno;
|
comment_lineno = lineno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +268,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
/* Check for a keyword indicating the beginning of a statement.
|
/* Check for a keyword indicating the beginning of a statement.
|
||||||
* REVISIT: This, obviously, will not detect statements that do not
|
* REVISIT: This, obviously, will not detect statements that do not
|
||||||
* begin with a C keyword (such as assignement statements).
|
* begin with a C keyword (such as assignment statements).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (strncmp(&line[indent], "break ", 6) == 0 ||
|
else if (strncmp(&line[indent], "break ", 6) == 0 ||
|
||||||
@@ -322,14 +329,14 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
/* Check for start of a C comment */
|
/* Check for start of a C comment */
|
||||||
|
|
||||||
if (line[n+1] == '*')
|
if (line[n + 1] == '*')
|
||||||
{
|
{
|
||||||
if (line[n+2] == '\n')
|
if (line[n + 2] == '\n')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "C comment on separate line at %d:%d\n",
|
fprintf(stderr, "C comment on separate line at %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
}
|
}
|
||||||
else if (line[n+2] != ' ' && line[n+2] != '*')
|
else if (line[n + 2] != ' ' && line[n + 2] != '*')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Missing space after opening C comment at line %d:%d\n",
|
"Missing space after opening C comment at line %d:%d\n",
|
||||||
@@ -343,14 +350,14 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
/* Check for end of a C comment */
|
/* Check for end of a C comment */
|
||||||
|
|
||||||
else if (n > 0 && line[n-1] == '*')
|
else if (n > 0 && line[n - 1] == '*')
|
||||||
{
|
{
|
||||||
if (n < 2)
|
if (n < 2)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Closing C comment not indented at line %d:%d\n",
|
fprintf(stderr, "Closing C comment not indented at line %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
}
|
}
|
||||||
else if (line[n-2] != ' ' && line[n-2] != '*')
|
else if (line[n - 2] != ' ' && line[n - 2] != '*')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Missing space before closing C comment at line %d:%d\n",
|
"Missing space before closing C comment at line %d:%d\n",
|
||||||
@@ -362,7 +369,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
* expression are commented out within the expression.
|
* expression are commented out within the expression.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (line[n+1] != '\n')
|
if (line[n + 1] != '\n')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Garbage on line after C comment at line %d:%d\n",
|
"Garbage on line after C comment at line %d:%d\n",
|
||||||
@@ -383,9 +390,12 @@ int main(int argc, char **argv, char **envp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for C++ style comments */
|
/* Check for C++ style comments
|
||||||
|
* NOTE: Gives false alarms on URLs (http://...) embedded
|
||||||
|
* inside of comments.
|
||||||
|
*/
|
||||||
|
|
||||||
else if (line[n+1] == '/')
|
else if (line[n + 1] == '/')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "C++ style comment on at %d:%d\n",
|
fprintf(stderr, "C++ style comment on at %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
@@ -442,7 +452,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
lineno, n);
|
lineno, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (line[n+1] != '\n')
|
else if (line[n + 1] != '\n')
|
||||||
{
|
{
|
||||||
if (declnest == 0)
|
if (declnest == 0)
|
||||||
{
|
{
|
||||||
@@ -460,7 +470,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
/* Suppress error for comment following a left brace */
|
/* Suppress error for comment following a left brace */
|
||||||
|
|
||||||
last_blank_line = lineno;
|
noblank_lineno = lineno;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -498,9 +508,9 @@ int main(int argc, char **argv, char **envp)
|
|||||||
lineno, n);
|
lineno, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (line[n+1] != '\n' &&
|
else if (line[n + 1] != '\n' &&
|
||||||
line[n+1] != ',' &&
|
line[n + 1] != ',' &&
|
||||||
line[n+1] != ';')
|
line[n + 1] != ';')
|
||||||
{
|
{
|
||||||
/* One case where there may be garbage after the right
|
/* One case where there may be garbage after the right
|
||||||
* bracket is, for example, when declaring a until or
|
* bracket is, for example, when declaring a until or
|
||||||
@@ -522,7 +532,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case '(':
|
case '(':
|
||||||
{
|
{
|
||||||
if (line[n+1] == ' ' /* && !bfor */)
|
if (line[n + 1] == ' ' /* && !bfor */)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Space follows left parenthesis at line %d:%d\n",
|
"Space follows left parenthesis at line %d:%d\n",
|
||||||
@@ -537,7 +547,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
* Allow "for (xx; xx; )" (bfor == true)
|
* Allow "for (xx; xx; )" (bfor == true)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (n > 0 && n != indent && line[n-1] == ' ' && !bfor)
|
if (n > 0 && n != indent && line[n - 1] == ' ' && !bfor)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Space precedes right parenthesis at line %d:%d\n",
|
"Space precedes right parenthesis at line %d:%d\n",
|
||||||
@@ -550,7 +560,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case '[':
|
case '[':
|
||||||
{
|
{
|
||||||
if (line[n+1] == ' ')
|
if (line[n + 1] == ' ')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Space follows left bracket at line %d:%d\n",
|
"Space follows left bracket at line %d:%d\n",
|
||||||
@@ -561,7 +571,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case ']':
|
case ']':
|
||||||
{
|
{
|
||||||
if (n > 0 && line[n-1] == ' ')
|
if (n > 0 && line[n - 1] == ' ')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Space precedes right bracket at line %d:%d\n",
|
"Space precedes right bracket at line %d:%d\n",
|
||||||
@@ -574,7 +584,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case ';':
|
case ';':
|
||||||
{
|
{
|
||||||
if (!isspace((int)line[n+1]))
|
if (!isspace((int)line[n + 1]))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Missing whitespace after semicolon at line %d:%d\n",
|
fprintf(stderr, "Missing whitespace after semicolon at line %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
@@ -595,7 +605,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case ',':
|
case ',':
|
||||||
{
|
{
|
||||||
if (!isspace((int)line[n+1]))
|
if (!isspace((int)line[n + 1]))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Missing whitespace after comma at line %d:%d\n",
|
fprintf(stderr, "Missing whitespace after comma at line %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
@@ -617,9 +627,9 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
int endndx = n + 2;
|
int endndx = n + 2;
|
||||||
|
|
||||||
if (line[n+1] != '\n' && line[n+1] != '\0')
|
if (line[n + 1] != '\n' && line[n + 1] != '\0')
|
||||||
{
|
{
|
||||||
if (line[n+1] == '\\')
|
if (line[n + 1] == '\\')
|
||||||
{
|
{
|
||||||
for (;
|
for (;
|
||||||
line[endndx] != '\n' &&
|
line[endndx] != '\n' &&
|
||||||
@@ -637,7 +647,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
{
|
{
|
||||||
if (n > 0 && isspace((int)line[n-1]))
|
if (n > 0 && isspace((int)line[n - 1]))
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Dangling whitespace at the end of line %d:%d\n",
|
"Dangling whitespace at the end of line %d:%d\n",
|
||||||
@@ -651,7 +661,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
case '-':
|
case '-':
|
||||||
/* -> */
|
/* -> */
|
||||||
|
|
||||||
if (line[n+1] == '>')
|
if (line[n + 1] == '>')
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
@@ -660,7 +670,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
case '+':
|
case '+':
|
||||||
/* ++, -- */
|
/* ++, -- */
|
||||||
|
|
||||||
if (line[n+1] == line[n])
|
if (line[n + 1] == line[n])
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
@@ -669,7 +679,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
case '&':
|
case '&':
|
||||||
/* && */
|
/* && */
|
||||||
|
|
||||||
if (line[n] == '&' && line[n+1] == line[n])
|
if (line[n] == '&' && line[n + 1] == line[n])
|
||||||
{
|
{
|
||||||
int curr;
|
int curr;
|
||||||
int next;
|
int next;
|
||||||
@@ -697,7 +707,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
/* &<variable> OR &(<expression>)*/
|
/* &<variable> OR &(<expression>)*/
|
||||||
|
|
||||||
else if (isalpha((int)line[n+1]) || line[n+1] == '_' || line[n+1] == '(')
|
else if (isalpha((int)line[n + 1]) || line[n + 1] == '_' || line[n + 1] == '(')
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -706,12 +716,12 @@ int main(int argc, char **argv, char **envp)
|
|||||||
{
|
{
|
||||||
if (line[n] == '/')
|
if (line[n] == '/')
|
||||||
{
|
{
|
||||||
if (line[n-1] == '*')
|
if (line[n - 1] == '*')
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (line[n+1] == '/')
|
else if (line[n + 1] == '/')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "C++ style comment on at %d:%d\n",
|
fprintf(stderr, "C++ style comment on at %d:%d\n",
|
||||||
lineno, n);
|
lineno, n);
|
||||||
@@ -726,8 +736,8 @@ int main(int argc, char **argv, char **envp)
|
|||||||
/* *\/, ** */
|
/* *\/, ** */
|
||||||
|
|
||||||
if (line[n] == '*' &&
|
if (line[n] == '*' &&
|
||||||
(line[n+1] == '/' ||
|
(line[n + 1] == '/' ||
|
||||||
line[n+1] == '*'))
|
line[n + 1] == '*'))
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
@@ -735,20 +745,20 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
/* *<variable>, *(<expression>) */
|
/* *<variable>, *(<expression>) */
|
||||||
|
|
||||||
else if (isalpha((int)line[n+1]) ||
|
else if (isalpha((int)line[n + 1]) ||
|
||||||
line[n+1] == '_' ||
|
line[n + 1] == '_' ||
|
||||||
line[n+1] == '(')
|
line[n + 1] == '(')
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (<type> *) */
|
/* (<type> *) */
|
||||||
|
|
||||||
else if (line[n+1] == ')')
|
else if (line[n + 1] == ')')
|
||||||
{
|
{
|
||||||
/* REVISIT: This gives false alarms on syntax like *--ptr */
|
/* REVISIT: This gives false alarms on syntax like *--ptr */
|
||||||
|
|
||||||
if (line[n-1] != ' ')
|
if (line[n - 1] != ' ')
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Operator/assignment must be preceded with whitespace at line %d:%d\n",
|
"Operator/assignment must be preceded with whitespace at line %d:%d\n",
|
||||||
@@ -761,7 +771,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
{
|
{
|
||||||
if (isalnum((int)line[n+1]))
|
if (isalnum((int)line[n + 1]))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -784,7 +794,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
lineno, curr);
|
lineno, curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
next = n+1;
|
next = n + 1;
|
||||||
|
|
||||||
/* <<, >>, <<=, >>= */
|
/* <<, >>, <<=, >>= */
|
||||||
|
|
||||||
|
|||||||
@@ -592,6 +592,7 @@ static void lo_txavail_work(FAR void *arg)
|
|||||||
if (priv->lo_bifup)
|
if (priv->lo_bifup)
|
||||||
{
|
{
|
||||||
/* If so, then poll the network for new XMIT data */
|
/* If so, then poll the network for new XMIT data */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_6LOWPAN
|
#ifdef CONFIG_NET_6LOWPAN
|
||||||
/* Make sure the our single packet buffer is attached */
|
/* Make sure the our single packet buffer is attached */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user