diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 15:14:28 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 15:14:28 -0600 |
commit | 6b0412f5128e2fdf94852de586b3f90cbf476240 (patch) | |
tree | 91ab0edfb4492a25abf3c7e177e102201a77b23f /apps/interpreters | |
parent | b845f19a3bb200e49a7a314787b3290e3155ce01 (diff) | |
download | nuttx-6b0412f5128e2fdf94852de586b3f90cbf476240.tar.gz nuttx-6b0412f5128e2fdf94852de586b3f90cbf476240.tar.bz2 nuttx-6b0412f5128e2fdf94852de586b3f90cbf476240.zip |
Fixes for more cppcheck complaints. Mostly cosmetic
Diffstat (limited to 'apps/interpreters')
-rw-r--r-- | apps/interpreters/bas/bas_auto.c | 12 | ||||
-rw-r--r-- | apps/interpreters/bas/bas_program.c | 1 | ||||
-rw-r--r-- | apps/interpreters/bas/bas_statement.c | 4 | ||||
-rw-r--r-- | apps/interpreters/bas/bas_token.c | 407 |
4 files changed, 212 insertions, 212 deletions
diff --git a/apps/interpreters/bas/bas_auto.c b/apps/interpreters/bas/bas_auto.c index 016596c1e..a27481145 100644 --- a/apps/interpreters/bas/bas_auto.c +++ b/apps/interpreters/bas/bas_auto.c @@ -190,7 +190,9 @@ struct Var *Auto_local(struct Auto *this, int l) int Auto_funcReturn(struct Auto *this, struct Pc *pc) { - int i, retFrame, retException; + int retException; + int retFrame; + int i; if (this->stackPointer == 0) { @@ -236,8 +238,11 @@ int Auto_gosubReturn(struct Auto *this, struct Pc *pc) void Auto_frameToError(struct Auto *this, struct Program *program, struct Value *v) { - int i = this->stackPointer, framePointer, frameSize, retFrame; struct Pc p; + int framePointer; + int frameSize,; + int retFrame; + int i = this->stackPointer; framePointer = this->framePointer; frameSize = this->frameSize; @@ -251,10 +256,7 @@ void Auto_frameToError(struct Auto *this, struct Program *program, struct Value if (i) { retFrame = framePointer + frameSize - 1; - i = framePointer; p = this->slot[retFrame].retFrame.pc; - frameSize = this->slot[retFrame].retFrame.frameSize; - framePointer = this->slot[retFrame].retFrame.framePointer; Value_errorSuffix(v, _("Proc Called")); Program_PCtoError(program, &p, v); } diff --git a/apps/interpreters/bas/bas_program.c b/apps/interpreters/bas/bas_program.c index ead14e52f..f132c7b27 100644 --- a/apps/interpreters/bas/bas_program.c +++ b/apps/interpreters/bas/bas_program.c @@ -1121,6 +1121,5 @@ void Program_xref(struct Program *this, int chn) FS_putChars(chn, _("Goto Referenced in line\n")); Xref_print(goto_, printLine, this, chn); Xref_destroy(goto_); - nl = 1; } } diff --git a/apps/interpreters/bas/bas_statement.c b/apps/interpreters/bas/bas_statement.c index 051d66295..4d72c25e9 100644 --- a/apps/interpreters/bas/bas_statement.c +++ b/apps/interpreters/bas/bas_statement.c @@ -836,7 +836,7 @@ struct Value *stmt_DELETE(struct Value *value) else if (f == 1) { to = from; - t = 1; + t = 1; } if (!f && !t) @@ -2415,7 +2415,7 @@ struct Value *stmt_LIST_LLIST(struct Value *value) else if (f == 1) { to = from; - t = 1; + t = 1; } if (g_pass == INTERPRET) diff --git a/apps/interpreters/bas/bas_token.c b/apps/interpreters/bas/bas_token.c index 8c0e39aa8..dc33ad7a8 100644 --- a/apps/interpreters/bas/bas_token.c +++ b/apps/interpreters/bas/bas_token.c @@ -135,7 +135,7 @@ typedef unsigned int flex_uint32_t; #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) +#define YY_NEW_FILE yyrestart(yyin) #define YY_END_OF_BUFFER_CHAR 0 @@ -189,9 +189,9 @@ extern FILE *yyin, *yyout; (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ - while ( 0 ) + while (0) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define unput(c) yyunput(c, (yytext_ptr)) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE @@ -269,7 +269,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ +#define YY_CURRENT_BUFFER ((yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) @@ -293,46 +293,46 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart (FILE *input_file); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size); +void yy_delete_buffer (YY_BUFFER_STATE b); +void yy_flush_buffer (YY_BUFFER_STATE b); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer); +void yypop_buffer_state (void); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack (void); +static void yy_load_buffer_state (void); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len); -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc (yy_size_t); +void *yyrealloc (void *,yy_size_t); +void yyfree (void *); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ + if (! YY_CURRENT_BUFFER){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer(yyin,YY_BUF_SIZE); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ + if (! YY_CURRENT_BUFFER){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer(yyin,YY_BUF_SIZE); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } @@ -357,10 +357,10 @@ int yylineno = 1; extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state (void); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state); +static int yy_get_next_buffer (void); +static void yy_fatal_error (yyconst char msg[]); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -1474,36 +1474,36 @@ static void string2(void) /*{{{*/ #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals (void); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy (void); -int yyget_debug (void ); +int yyget_debug (void); -void yyset_debug (int debug_flag ); +void yyset_debug (int debug_flag); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra (void); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra (YY_EXTRA_TYPE user_defined); -FILE *yyget_in (void ); +FILE *yyget_in (void); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * in_str); -FILE *yyget_out (void ); +FILE *yyget_out (void); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * out_str); -yy_size_t yyget_leng (void ); +yy_size_t yyget_leng (void); -char *yyget_text (void ); +char *yyget_text (void); -int yyget_lineno (void ); +int yyget_lineno (void); -void yyset_lineno (int line_number ); +void yyset_lineno (int line_number); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1511,26 +1511,26 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap (void); #else -extern int yywrap (void ); +extern int yywrap (void); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy (char *,yyconst char *,int); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen (yyconst char *); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput (void ); +static int yyinput (void); #else -static int input (void ); +static int input (void); #endif #endif @@ -1550,7 +1550,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite(yytext, yyleng, 1, yyout)) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1558,27 +1558,27 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) \ { \ int c = '*'; \ size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + for (n = 0; n < max_size && \ + (c = getc(yyin)) != EOF && c != '\n'; ++n) \ buf[n] = (char) c; \ - if ( c == '\n' ) \ + if (c == '\n') \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ + if (c == EOF && ferror(yyin)) \ + YY_FATAL_ERROR("input in flex scanner failed"); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ((result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ - if( errno != EINTR) \ + if(errno != EINTR) \ { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ + YY_FATAL_ERROR("input in flex scanner failed"); \ break; \ } \ errno=0; \ @@ -1604,7 +1604,7 @@ static int input (void ); /* Report a fatal error. */ #ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#define YY_FATAL_ERROR(msg) yy_fatal_error(msg) #endif /* end tables serialization structures and prototypes */ @@ -1643,7 +1643,7 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; - if ( !(yy_init) ) + if (!(yy_init)) { (yy_init) = 1; @@ -1651,22 +1651,22 @@ YY_DECL YY_USER_INIT; #endif - if ( ! (yy_start) ) + if (! (yy_start)) (yy_start) = 1; /* first start state */ - if ( ! yyin ) + if (! yyin) yyin = stdin; - if ( ! yyout ) + if (! yyout) yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { + if (! YY_CURRENT_BUFFER) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer(yyin,YY_BUF_SIZE); } - yy_load_buffer_state( ); + yy_load_buffer_state(); } { @@ -1677,7 +1677,7 @@ YY_DECL #line 1683 "<stdout>" - while ( 1 ) /* loops until end-of-file is reached */ + while (1) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1694,25 +1694,25 @@ yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) + if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 701 ) + if (yy_current_state >= 701) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 3041 ); + while (yy_base[yy_current_state] != 3041); yy_find_action: yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) + if (yy_act == 0) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1723,7 +1723,7 @@ yy_find_action: do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) + switch (yy_act) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ @@ -3719,7 +3719,7 @@ case YY_STATE_EOF(IMAGEFMT): *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { /* We're scanning a new file or input source. It's * possible that this happened because the user @@ -3742,13 +3742,13 @@ case YY_STATE_EOF(IMAGEFMT): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -3759,11 +3759,11 @@ case YY_STATE_EOF(IMAGEFMT): * will run more slowly). */ - yy_next_state = yy_try_NUL_trans( yy_current_state ); + yy_next_state = yy_try_NUL_trans(yy_current_state); yy_bp = (yytext_ptr) + YY_MORE_ADJ; - if ( yy_next_state ) + if (yy_next_state) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); @@ -3778,13 +3778,13 @@ case YY_STATE_EOF(IMAGEFMT): } } - else switch ( yy_get_next_buffer( ) ) + else switch (yy_get_next_buffer()) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if (yywrap()) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -3803,7 +3803,7 @@ case YY_STATE_EOF(IMAGEFMT): else { - if ( ! (yy_did_buffer_switch_on_eof) ) + if (! (yy_did_buffer_switch_on_eof)) YY_NEW_FILE; } break; @@ -3813,7 +3813,7 @@ case YY_STATE_EOF(IMAGEFMT): (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; @@ -3823,7 +3823,7 @@ case YY_STATE_EOF(IMAGEFMT): (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; @@ -3834,7 +3834,7 @@ case YY_STATE_EOF(IMAGEFMT): default: YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); + "fatal flex scanner internal error--no action found"); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ @@ -3849,18 +3849,19 @@ case YY_STATE_EOF(IMAGEFMT): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); - register int number_to_move, i; + register int number_to_move; + register int i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + "fatal flex scanner internal error--end of buffer missed"); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -3882,10 +3883,10 @@ static int yy_get_next_buffer (void) /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - for ( i = 0; i < number_to_move; ++i ) + for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++); - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ @@ -3896,7 +3897,7 @@ static int yy_get_next_buffer (void) yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) + while (num_to_read < 1) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ @@ -3905,26 +3906,26 @@ static int yy_get_next_buffer (void) int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) + if (b->yy_is_our_buffer) { yy_size_t new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) + if (new_size < 1) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; - if ( ! b->yy_ch_buf ) + if (! b->yy_ch_buf) YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + "fatal error - scanner input buffer overflow"); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; @@ -3933,22 +3934,22 @@ static int yy_get_next_buffer (void) } - if ( num_to_read > YY_READ_BUF_SIZE ) + if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( (yy_n_chars) == 0 ) + if ((yy_n_chars) == 0) { - if ( number_to_move == YY_MORE_ADJ ) + if (number_to_move == YY_MORE_ADJ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart(yyin); } else @@ -3965,9 +3966,9 @@ static int yy_get_next_buffer (void) if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size); + if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); } (yy_n_chars) += number_to_move; @@ -3988,18 +3989,18 @@ static int yy_get_next_buffer (void) yy_current_state = (yy_start); - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) + if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 701 ) + if (yy_current_state >= 701) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -4011,23 +4012,23 @@ static int yy_get_next_buffer (void) /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans(current_state); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) + if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 701 ) + if (yy_current_state >= 701) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -4048,13 +4049,13 @@ static int yy_get_next_buffer (void) *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; @@ -4063,7 +4064,7 @@ static int yy_get_next_buffer (void) yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); - switch ( yy_get_next_buffer( ) ) + switch (yy_get_next_buffer()) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -4077,16 +4078,16 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart(yyin); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) + if (yywrap()) return EOF; - if ( ! (yy_did_buffer_switch_on_eof) ) + if (! (yy_did_buffer_switch_on_eof)) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -4115,24 +4116,24 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + void yyrestart (FILE * input_file) { - if ( ! YY_CURRENT_BUFFER ){ + if (! YY_CURRENT_BUFFER){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer(yyin,YY_BUF_SIZE); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer(YY_CURRENT_BUFFER,input_file); + yy_load_buffer_state(); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer) { /* TODO. We should be able to replace this entire function body @@ -4141,10 +4142,10 @@ static int yy_get_next_buffer (void) * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) + if (YY_CURRENT_BUFFER == new_buffer) return; - if ( YY_CURRENT_BUFFER ) + if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); @@ -4153,7 +4154,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -4177,26 +4178,26 @@ static void yy_load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + b = (YY_BUFFER_STATE) yyalloc(sizeof(struct yy_buffer_state)); + if (! b) + YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2); + if (! b->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer(b,file); return b; } @@ -4205,19 +4206,19 @@ static void yy_load_buffer_state (void) * @param b a buffer created with yy_create_buffer() * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b) { - if ( ! b ) + if (! b) return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + if (b->yy_is_our_buffer) + yyfree((void *) b->yy_ch_buf); - yyfree((void *) b ); + yyfree((void *) b); } /* Initializes or reinitializes a buffer. @@ -4225,11 +4226,11 @@ static void yy_load_buffer_state (void) * such as during a yyrestart() or at EOF. */ -static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) +static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer(b); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -4246,7 +4247,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) } #ifdef CONFIG_SERIAL_TERMIOS - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; #else b->yy_is_interactive = 1; #endif @@ -4258,9 +4259,9 @@ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b) { - if ( ! b ) + if (! b) return; b->yy_n_chars = 0; @@ -4277,8 +4278,8 @@ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + if (b == YY_CURRENT_BUFFER) + yy_load_buffer_state(); } /** Pushes the new state onto the stack. The new state becomes @@ -4287,7 +4288,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) * @param new_buffer The new state. * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer) { if (new_buffer == NULL) return; @@ -4295,7 +4296,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) + if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); @@ -4309,7 +4310,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } @@ -4322,13 +4323,13 @@ void yypop_buffer_state (void) if (!YY_CURRENT_BUFFER) return; - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } } @@ -4348,10 +4349,9 @@ static void yyensure_buffer_stack (void) */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + (num_to_alloc * sizeof(struct yy_buffer_state*)); + if (! (yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -4368,10 +4368,9 @@ static void yyensure_buffer_stack (void) num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + num_to_alloc * sizeof(struct yy_buffer_state*)); + if (! (yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -4385,19 +4384,19 @@ static void yyensure_buffer_stack (void) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size) { YY_BUFFER_STATE b; - if ( size < 2 || + if (size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + base[size-1] != YY_END_OF_BUFFER_CHAR) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + b = (YY_BUFFER_STATE) yyalloc(sizeof(struct yy_buffer_state)); + if (! b) + YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -4409,7 +4408,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer(b); return b; } @@ -4422,10 +4421,10 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes(yystr,strlen(yystr)); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -4435,7 +4434,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len) { YY_BUFFER_STATE b; char *buf; @@ -4444,18 +4443,18 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + buf = (char *) yyalloc(n); + if (! buf) + YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - for ( i = 0; i < _yybytes_len; ++i ) + for (i = 0; i < _yybytes_len; ++i) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + b = yy_scan_buffer(buf,n); + if (! b) + YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -4469,10 +4468,10 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yy_fatal_error (yyconst char* msg) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf(stderr, "%s\n", msg); + exit(YY_EXIT_FAILURE); } /* Redefine yyless() so it works in section 3 code. */ @@ -4490,7 +4489,7 @@ static void yy_fatal_error (yyconst char* msg ) *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ - while ( 0 ) + while (0) /* Accessor methods (get/set functions) to struct members. */ @@ -4540,7 +4539,7 @@ char *yyget_text (void) * @param line_number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int line_number) { yylineno = line_number; @@ -4552,12 +4551,12 @@ void yyset_lineno (int line_number ) * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * in_str) { yyin = in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * out_str) { yyout = out_str ; } @@ -4567,7 +4566,7 @@ int yyget_debug (void) return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int bdebug) { yy_flex_debug = bdebug ; } @@ -4606,18 +4605,18 @@ int yylex_destroy (void) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); + yyfree((yy_buffer_stack)); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ - yy_init_globals( ); + yy_init_globals(); return 0; } @@ -4627,31 +4626,31 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n) { register int i; - for ( i = 0; i < n; ++i ) + for (i = 0; i < n; ++i) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (yyconst char * s) { register int n; - for ( n = 0; s[n]; ++n ) + for (n = 0; s[n]; ++n) ; return n; } #endif -void *yyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size) { - return (void *) malloc( size ); + return (void *) malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -4660,12 +4659,12 @@ void *yyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return (void *) realloc((char *) ptr, size); } -void yyfree (void * ptr ) +void yyfree (void * ptr) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free((char *) ptr); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" |