From 421cb85865f6577a2a696c2cb4f652f590a475f9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 29 Dec 2016 23:18:23 +0100 Subject: [PATCH] recreate lexer files without deprecated register keyword --- src/App/lex.ExpressionParser.c | 166 ++++++++++++++++++-------------- src/Base/QuantityLexer.c | 131 +++++++++++++++---------- src/Gui/lex.SelectionFilter.c | 169 ++++++++++++++++++--------------- 3 files changed, 265 insertions(+), 201 deletions(-) diff --git a/src/App/lex.ExpressionParser.c b/src/App/lex.ExpressionParser.c index dff026292..a386d83c5 100644 --- a/src/App/lex.ExpressionParser.c +++ b/src/App/lex.ExpressionParser.c @@ -1,5 +1,6 @@ +#line 2 "lex.ExpressionParser.c" -#line 3 "lex.ExpressionParser.c" +#line 4 "lex.ExpressionParser.c" #define YY_INT_ALIGNED short int @@ -26,8 +27,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -180,7 +181,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int ExpressionParserleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t ExpressionParserleng; extern FILE *ExpressionParserin, *ExpressionParserout; @@ -189,6 +195,7 @@ extern FILE *ExpressionParserin, *ExpressionParserout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -206,11 +213,6 @@ extern FILE *ExpressionParserin, *ExpressionParserout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -299,7 +301,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when ExpressionParsertext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int ExpressionParserleng; +yy_size_t ExpressionParserleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -327,7 +329,7 @@ static void ExpressionParser_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE ExpressionParser_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE ExpressionParser_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE ExpressionParser_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE ExpressionParser_scan_bytes (yyconst char *bytes,yy_size_t len ); void *ExpressionParseralloc (yy_size_t ); void *ExpressionParserrealloc (void *,yy_size_t ); @@ -357,7 +359,7 @@ void ExpressionParserfree (void * ); #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -#define ExpressionParserwrap(n) 1 +#define ExpressionParserwrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -371,11 +373,17 @@ extern int ExpressionParserlineno; int ExpressionParserlineno = 1; extern char *ExpressionParsertext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr ExpressionParsertext 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 ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -644,7 +652,7 @@ static yyconst flex_int16_t yy_accept[2208] = 64, 65, 90, 90, 90, 66, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, @@ -676,7 +684,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[167] = +static yyconst YY_CHAR yy_meta[167] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 5, @@ -698,7 +706,7 @@ static yyconst flex_int32_t yy_meta[167] = 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[2355] = +static yyconst flex_uint16_t yy_base[2355] = { 0, 0, 0, 4364,19612, 165,19612, 4345,19612,19612, 0, 19612, 4343,19612, 4338, 156, 156, 4331, 4315, 194, 0, @@ -1224,7 +1232,7 @@ static yyconst flex_int16_t yy_def[2355] = 2207, 2207, 2207, 2207 } ; -static yyconst flex_int16_t yy_nxt[19779] = +static yyconst flex_uint16_t yy_nxt[19779] = { 0, 4, 5, 6, 4, 5, 7, 8, 9, 10, 11, 9, 9, 12, 13, 14, 15, 16, 17, 18, 19, @@ -5622,7 +5630,7 @@ extern int column; /* the manual says "somewhat more optimized" */ /* no support for include files is planned */ /* UTF-8 unicode regular expressions. */ -#line 5626 "lex.ExpressionParser.c" +#line 5634 "lex.ExpressionParser.c" #define INITIAL 0 @@ -5655,19 +5663,19 @@ void ExpressionParserset_extra (YY_EXTRA_TYPE user_defined ); FILE *ExpressionParserget_in (void ); -void ExpressionParserset_in (FILE * in_str ); +void ExpressionParserset_in (FILE * _in_str ); FILE *ExpressionParserget_out (void ); -void ExpressionParserset_out (FILE * out_str ); +void ExpressionParserset_out (FILE * _out_str ); -int ExpressionParserget_leng (void ); +yy_size_t ExpressionParserget_leng (void ); char *ExpressionParserget_text (void ); int ExpressionParserget_lineno (void ); -void ExpressionParserset_lineno (int line_number ); +void ExpressionParserset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -5681,6 +5689,10 @@ extern int ExpressionParserwrap (void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -5793,7 +5805,7 @@ extern int ExpressionParserlex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -5803,15 +5815,10 @@ extern int ExpressionParserlex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 142 "ExpressionParser.l" - - -#line 5814 "lex.ExpressionParser.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -5838,7 +5845,13 @@ YY_DECL ExpressionParser_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 142 "ExpressionParser.l" + + +#line 5853 "lex.ExpressionParser.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -5854,7 +5867,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -6366,7 +6379,7 @@ YY_RULE_SETUP #line 283 "ExpressionParser.l" ECHO; YY_BREAK -#line 6370 "lex.ExpressionParser.c" +#line 6383 "lex.ExpressionParser.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -6498,6 +6511,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of ExpressionParserlex */ /* yy_get_next_buffer - try to read in a new buffer @@ -6509,9 +6523,9 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -6540,7 +6554,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -6553,21 +6567,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -6598,7 +6612,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -6622,9 +6636,9 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) ((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); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ExpressionParserrealloc((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()" ); @@ -6643,14 +6657,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); 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); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -6675,10 +6689,10 @@ static int yy_get_next_buffer (void) */ 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); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -6693,9 +6707,13 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 2207); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -6720,7 +6738,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -6845,7 +6863,7 @@ static void ExpressionParser_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in ExpressionParser_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)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. @@ -6992,7 +7010,7 @@ void ExpressionParserpop_buffer_state (void) */ static void ExpressionParserensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -7000,7 +7018,7 @@ static void ExpressionParserensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)ExpressionParseralloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -7017,7 +7035,7 @@ static void ExpressionParserensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)ExpressionParserrealloc @@ -7089,12 +7107,12 @@ YY_BUFFER_STATE ExpressionParser_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE ExpressionParser_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE ExpressionParser_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -7125,7 +7143,7 @@ YY_BUFFER_STATE ExpressionParser_scan_bytes (yyconst char * yybytes, int _yyby static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -7176,7 +7194,7 @@ FILE *ExpressionParserget_out (void) /** Get the length of the current token. * */ -int ExpressionParserget_leng (void) +yy_size_t ExpressionParserget_leng (void) { return ExpressionParserleng; } @@ -7191,29 +7209,29 @@ char *ExpressionParserget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void ExpressionParserset_lineno (int line_number ) +void ExpressionParserset_lineno (int _line_number ) { - ExpressionParserlineno = line_number; + ExpressionParserlineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see ExpressionParser_switch_to_buffer */ -void ExpressionParserset_in (FILE * in_str ) +void ExpressionParserset_in (FILE * _in_str ) { - ExpressionParserin = in_str ; + ExpressionParserin = _in_str ; } -void ExpressionParserset_out (FILE * out_str ) +void ExpressionParserset_out (FILE * _out_str ) { - ExpressionParserout = out_str ; + ExpressionParserout = _out_str ; } int ExpressionParserget_debug (void) @@ -7221,9 +7239,9 @@ int ExpressionParserget_debug (void) return ExpressionParser_flex_debug; } -void ExpressionParserset_debug (int bdebug ) +void ExpressionParserset_debug (int _bdebug ) { - ExpressionParser_flex_debug = bdebug ; + ExpressionParser_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -7283,7 +7301,8 @@ int ExpressionParserlex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -7292,7 +7311,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -7302,11 +7321,12 @@ static int yy_flex_strlen (yyconst char * s ) void *ExpressionParseralloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *ExpressionParserrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -7319,7 +7339,7 @@ void *ExpressionParserrealloc (void * ptr, yy_size_t size ) void ExpressionParserfree (void * ptr ) { - free( (char *) ptr ); /* see ExpressionParserrealloc() for (char *) cast */ + free( (char *) ptr ); /* see ExpressionParserrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff --git a/src/Base/QuantityLexer.c b/src/Base/QuantityLexer.c index fe0883079..931c36dd6 100644 --- a/src/Base/QuantityLexer.c +++ b/src/Base/QuantityLexer.c @@ -8,8 +8,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -142,7 +142,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -203,7 +211,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -273,7 +281,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -332,7 +340,7 @@ void yyfree (void * ); #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -#define yywrap() 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -346,11 +354,17 @@ extern int yylineno; int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #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 ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -396,7 +410,7 @@ static yyconst flex_int16_t yy_accept[189] = 0, 85, 91, 60, 61, 0, 62, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -428,7 +442,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[59] = +static yyconst YY_CHAR yy_meta[59] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -438,7 +452,7 @@ static yyconst flex_int32_t yy_meta[59] = 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[190] = +static yyconst flex_uint16_t yy_base[190] = { 0, 0, 0, 56, 57, 309, 310, 310, 305, 310, 310, 310, 50, 310, 54, 61, 310, 282, 283, 310, 310, @@ -486,7 +500,7 @@ static yyconst flex_int16_t yy_def[190] = 188, 188, 188, 188, 188, 188, 188, 0, 188 } ; -static yyconst flex_int16_t yy_nxt[369] = +static yyconst flex_uint16_t yy_nxt[369] = { 0, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15, 15, 15, 16, 17, 6, 18, 19, 20, @@ -602,7 +616,7 @@ char *yytext; /* the manual says "somewhat more optimized" */ /* no support for include files is planned */ -#line 606 "QuantityLexer.c" +#line 620 "QuantityLexer.c" #define INITIAL 0 #define C_COMMENT 1 @@ -636,11 +650,11 @@ void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * _in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * _out_str ); yy_size_t yyget_leng (void ); @@ -648,7 +662,7 @@ char *yyget_text (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. @@ -662,6 +676,10 @@ extern int yywrap (void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -682,7 +700,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -769,7 +792,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -779,9 +802,9 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -813,9 +836,9 @@ YY_DECL #line 31 "QuantityParser.l" -#line 817 "QuantityLexer.c" +#line 840 "QuantityLexer.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -831,7 +854,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1362,7 +1385,7 @@ YY_RULE_SETUP #line 160 "QuantityParser.l" ECHO; YY_BREAK -#line 1366 "QuantityLexer.c" +#line 1389 "QuantityLexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(C_COMMENT): yyterminate(); @@ -1507,9 +1530,9 @@ case YY_STATE_EOF(C_COMMENT): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1538,7 +1561,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1620,9 +1643,9 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) ((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); + int 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()" ); @@ -1641,14 +1664,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); 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); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1673,10 +1696,10 @@ static int yy_get_next_buffer (void) */ 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); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1694,6 +1717,10 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1843,7 +1870,7 @@ static void yy_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)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. @@ -1998,7 +2025,7 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -2015,7 +2042,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -2123,7 +2150,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2189,29 +2216,29 @@ char *yyget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -2219,9 +2246,9 @@ int yyget_debug (void) return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -2281,7 +2308,8 @@ int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2290,7 +2318,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2300,11 +2328,12 @@ static int yy_flex_strlen (yyconst char * s ) void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( 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 * that use void* generic pointers. It works with the latter @@ -2317,7 +2346,7 @@ void *yyrealloc (void * ptr, yy_size_t size ) void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" diff --git a/src/Gui/lex.SelectionFilter.c b/src/Gui/lex.SelectionFilter.c index c5b4fb981..7a5af0275 100644 --- a/src/Gui/lex.SelectionFilter.c +++ b/src/Gui/lex.SelectionFilter.c @@ -27,8 +27,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -181,7 +181,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int SelectionFilterleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t SelectionFilterleng; extern FILE *SelectionFilterin, *SelectionFilterout; @@ -190,6 +195,7 @@ extern FILE *SelectionFilterin, *SelectionFilterout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -207,11 +213,6 @@ extern FILE *SelectionFilterin, *SelectionFilterout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -300,7 +301,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when SelectionFiltertext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int SelectionFilterleng; +yy_size_t SelectionFilterleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -328,7 +329,7 @@ static void SelectionFilter_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE SelectionFilter_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE SelectionFilter_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE SelectionFilter_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE SelectionFilter_scan_bytes (yyconst char *bytes,yy_size_t len ); void *SelectionFilteralloc (yy_size_t ); void *SelectionFilterrealloc (void *,yy_size_t ); @@ -358,7 +359,7 @@ void SelectionFilterfree (void * ); #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -#define SelectionFilterwrap(n) 1 +#define SelectionFilterwrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -372,11 +373,17 @@ extern int SelectionFilterlineno; int SelectionFilterlineno = 1; extern char *SelectionFiltertext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr SelectionFiltertext 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 ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -406,7 +413,7 @@ static yyconst flex_int16_t yy_accept[37] = 8, 8, 8, 8, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -438,13 +445,13 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[18] = +static yyconst YY_CHAR yy_meta[18] = { 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[38] = +static yyconst flex_uint16_t yy_base[38] = { 0, 0, 0, 43, 44, 44, 39, 37, 35, 33, 0, 24, 8, 34, 44, 31, 44, 0, 18, 23, 25, @@ -460,7 +467,7 @@ static yyconst flex_int16_t yy_def[38] = 37, 37, 37, 37, 37, 0, 36 } ; -static yyconst flex_int16_t yy_nxt[62] = +static yyconst flex_uint16_t yy_nxt[62] = { 0, 4, 5, 6, 7, 8, 9, 10, 10, 11, 10, 10, 10, 10, 10, 12, 10, 10, 19, 17, 35, @@ -516,7 +523,7 @@ char *SelectionFiltertext; /* change the name of the scanner class. results in "SelectionFilterFlexLexer" */ /* the manual says "somewhat more optimized" */ /* no support for include files is planned */ -#line 520 "lex.SelectionFilter.c" +#line 527 "lex.SelectionFilter.c" #define INITIAL 0 @@ -549,19 +556,19 @@ void SelectionFilterset_extra (YY_EXTRA_TYPE user_defined ); FILE *SelectionFilterget_in (void ); -void SelectionFilterset_in (FILE * in_str ); +void SelectionFilterset_in (FILE * _in_str ); FILE *SelectionFilterget_out (void ); -void SelectionFilterset_out (FILE * out_str ); +void SelectionFilterset_out (FILE * _out_str ); -int SelectionFilterget_leng (void ); +yy_size_t SelectionFilterget_leng (void ); char *SelectionFilterget_text (void ); int SelectionFilterget_lineno (void ); -void SelectionFilterset_lineno (int line_number ); +void SelectionFilterset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -575,6 +582,10 @@ extern int SelectionFilterwrap (void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -687,7 +698,7 @@ extern int SelectionFilterlex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -697,16 +708,10 @@ extern int SelectionFilterlex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 30 "SelectionFilter.l" - - - -#line 709 "lex.SelectionFilter.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -733,7 +738,14 @@ YY_DECL SelectionFilter_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 30 "SelectionFilter.l" + + + +#line 747 "lex.SelectionFilter.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -749,7 +761,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -842,7 +854,7 @@ YY_RULE_SETUP #line 54 "SelectionFilter.l" ECHO; YY_BREAK -#line 846 "lex.SelectionFilter.c" +#line 858 "lex.SelectionFilter.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -974,6 +986,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of SelectionFilterlex */ /* yy_get_next_buffer - try to read in a new buffer @@ -985,9 +998,9 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1016,7 +1029,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1029,21 +1042,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1074,7 +1087,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1098,9 +1111,9 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) ((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); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) SelectionFilterrealloc((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()" ); @@ -1119,14 +1132,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); 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); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1151,10 +1164,10 @@ static int yy_get_next_buffer (void) */ 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); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1169,9 +1182,13 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 36); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1196,7 +1213,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1321,7 +1338,7 @@ static void SelectionFilter_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in SelectionFilter_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)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. @@ -1356,10 +1373,6 @@ static void SelectionFilter_load_buffer_state (void) SelectionFilterfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a SelectionFilterrestart() or at EOF. @@ -1472,7 +1485,7 @@ void SelectionFilterpop_buffer_state (void) */ static void SelectionFilterensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1480,7 +1493,7 @@ static void SelectionFilterensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)SelectionFilteralloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -1497,7 +1510,7 @@ static void SelectionFilterensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)SelectionFilterrealloc @@ -1569,12 +1582,12 @@ YY_BUFFER_STATE SelectionFilter_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE SelectionFilter_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE SelectionFilter_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1605,7 +1618,7 @@ YY_BUFFER_STATE SelectionFilter_scan_bytes (yyconst char * yybytes, int _yybyt static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1656,7 +1669,7 @@ FILE *SelectionFilterget_out (void) /** Get the length of the current token. * */ -int SelectionFilterget_leng (void) +yy_size_t SelectionFilterget_leng (void) { return SelectionFilterleng; } @@ -1671,29 +1684,29 @@ char *SelectionFilterget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void SelectionFilterset_lineno (int line_number ) +void SelectionFilterset_lineno (int _line_number ) { - SelectionFilterlineno = line_number; + SelectionFilterlineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see SelectionFilter_switch_to_buffer */ -void SelectionFilterset_in (FILE * in_str ) +void SelectionFilterset_in (FILE * _in_str ) { - SelectionFilterin = in_str ; + SelectionFilterin = _in_str ; } -void SelectionFilterset_out (FILE * out_str ) +void SelectionFilterset_out (FILE * _out_str ) { - SelectionFilterout = out_str ; + SelectionFilterout = _out_str ; } int SelectionFilterget_debug (void) @@ -1701,9 +1714,9 @@ int SelectionFilterget_debug (void) return SelectionFilter_flex_debug; } -void SelectionFilterset_debug (int bdebug ) +void SelectionFilterset_debug (int _bdebug ) { - SelectionFilter_flex_debug = bdebug ; + SelectionFilter_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -1763,7 +1776,8 @@ int SelectionFilterlex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1772,7 +1786,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1782,11 +1796,12 @@ static int yy_flex_strlen (yyconst char * s ) void *SelectionFilteralloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *SelectionFilterrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1799,7 +1814,7 @@ void *SelectionFilterrealloc (void * ptr, yy_size_t size ) void SelectionFilterfree (void * ptr ) { - free( (char *) ptr ); /* see SelectionFilterrealloc() for (char *) cast */ + free( (char *) ptr ); /* see SelectionFilterrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables"