diff options
Diffstat (limited to '3rdparty/libconfig/scanner.c')
-rw-r--r-- | 3rdparty/libconfig/scanner.c | 279 |
1 files changed, 124 insertions, 155 deletions
diff --git a/3rdparty/libconfig/scanner.c b/3rdparty/libconfig/scanner.c index abe173830..687b52dbe 100644 --- a/3rdparty/libconfig/scanner.c +++ b/3rdparty/libconfig/scanner.c @@ -1,6 +1,6 @@ -#line 2 "scanner.c" +#line 1 "scanner.c" -#line 4 "scanner.c" +#line 3 "scanner.c" #define YY_INT_ALIGNED short int @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 +#define YY_FLEX_SUBMINOR_VERSION 2 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -88,36 +88,22 @@ typedef unsigned int flex_uint32_t; #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -141,20 +127,16 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE libconfig_yyrestart(yyin ,yyscanner ) - #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -187,7 +169,7 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE libconfig_yylex. @@ -223,7 +205,6 @@ typedef size_t yy_size_t; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -238,12 +219,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* 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 @@ -300,36 +281,33 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void libconfig_yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void libconfig_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE libconfig_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void libconfig_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void libconfig_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void libconfig_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void libconfig_yypop_buffer_state (yyscan_t yyscanner ); - -static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner ); -static void libconfig_yy_load_buffer_state (yyscan_t yyscanner ); -static void libconfig_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - +void libconfig_yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void libconfig_yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE libconfig_yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void libconfig_yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void libconfig_yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void libconfig_yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void libconfig_yypop_buffer_state ( yyscan_t yyscanner ); + +static void libconfig_yyensure_buffer_stack ( yyscan_t yyscanner ); +static void libconfig_yy_load_buffer_state ( yyscan_t yyscanner ); +static void libconfig_yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); #define YY_FLUSH_BUFFER libconfig_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) -YY_BUFFER_STATE libconfig_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE libconfig_yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE libconfig_yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE libconfig_yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *libconfig_yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *libconfig_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void libconfig_yyfree (void * ,yyscan_t yyscanner ); +void *libconfig_yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *libconfig_yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void libconfig_yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer libconfig_yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -339,7 +317,6 @@ void libconfig_yyfree (void * ,yyscan_t yyscanner ); } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -349,36 +326,30 @@ void libconfig_yyfree (void * ,yyscan_t yyscanner ); } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) #define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 45 #define YY_END_OF_BUFFER 46 /* This struct is not used in this scanner, @@ -388,7 +359,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[123] = +static const flex_int16_t yy_accept[123] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 44, 25, 24, 24, 5, 44, 40, 41, 37, @@ -406,7 +377,7 @@ static yyconst flex_int16_t yy_accept[123] = 19, 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, @@ -438,7 +409,7 @@ static yyconst YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[51] = +static const YY_CHAR yy_meta[51] = { 0, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 4, 4, 1, 1, @@ -447,7 +418,7 @@ static yyconst YY_CHAR yy_meta[51] = 4, 4, 3, 3, 3, 3, 3, 3, 1, 1 } ; -static yyconst flex_uint16_t yy_base[134] = +static const flex_int16_t yy_base[134] = { 0, 0, 49, 49, 50, 48, 49, 50, 51, 244, 243, 248, 251, 245, 251, 251, 251, 243, 251, 251, 0, @@ -466,7 +437,7 @@ static yyconst flex_uint16_t yy_base[134] = 227, 115, 104 } ; -static yyconst flex_int16_t yy_def[134] = +static const flex_int16_t yy_def[134] = { 0, 122, 1, 123, 123, 124, 124, 125, 125, 126, 126, 122, 122, 122, 122, 122, 122, 127, 122, 122, 128, @@ -485,7 +456,7 @@ static yyconst flex_int16_t yy_def[134] = 122, 122, 122 } ; -static yyconst flex_uint16_t yy_nxt[302] = +static const flex_int16_t yy_nxt[302] = { 0, 12, 13, 14, 15, 15, 16, 17, 12, 18, 19, 20, 21, 22, 21, 23, 24, 25, 26, 27, 28, @@ -523,7 +494,7 @@ static yyconst flex_uint16_t yy_nxt[302] = 122 } ; -static yyconst flex_int16_t yy_chk[302] = +static const flex_int16_t yy_chk[302] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -562,7 +533,7 @@ static yyconst flex_int16_t yy_chk[302] = } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[46] = +static const flex_int32_t yy_rule_can_match_eol[46] = { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -651,8 +622,9 @@ static unsigned long long fromhex(const char *s) #endif /* __MINGW32__ */ } +#line 625 "scanner.c" -#line 656 "scanner.c" +#line 627 "scanner.c" #define INITIAL 0 #define COMMENT 1 @@ -675,8 +647,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -698,7 +670,7 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ @@ -706,44 +678,44 @@ static int yy_init_globals (yyscan_t yyscanner ); int libconfig_yylex_init (yyscan_t* scanner); -int libconfig_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int libconfig_yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int libconfig_yylex_destroy (yyscan_t yyscanner ); +int libconfig_yylex_destroy ( yyscan_t yyscanner ); -int libconfig_yyget_debug (yyscan_t yyscanner ); +int libconfig_yyget_debug ( yyscan_t yyscanner ); -void libconfig_yyset_debug (int debug_flag ,yyscan_t yyscanner ); +void libconfig_yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE libconfig_yyget_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE libconfig_yyget_extra ( yyscan_t yyscanner ); -void libconfig_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void libconfig_yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *libconfig_yyget_in (yyscan_t yyscanner ); +FILE *libconfig_yyget_in ( yyscan_t yyscanner ); -void libconfig_yyset_in (FILE * _in_str ,yyscan_t yyscanner ); +void libconfig_yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *libconfig_yyget_out (yyscan_t yyscanner ); +FILE *libconfig_yyget_out ( yyscan_t yyscanner ); -void libconfig_yyset_out (FILE * _out_str ,yyscan_t yyscanner ); +void libconfig_yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -yy_size_t libconfig_yyget_leng (yyscan_t yyscanner ); + int libconfig_yyget_leng ( yyscan_t yyscanner ); -char *libconfig_yyget_text (yyscan_t yyscanner ); +char *libconfig_yyget_text ( yyscan_t yyscanner ); -int libconfig_yyget_lineno (yyscan_t yyscanner ); +int libconfig_yyget_lineno ( yyscan_t yyscanner ); -void libconfig_yyset_lineno (int _line_number ,yyscan_t yyscanner ); +void libconfig_yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int libconfig_yyget_column (yyscan_t yyscanner ); +int libconfig_yyget_column ( yyscan_t yyscanner ); -void libconfig_yyset_column (int _column_no ,yyscan_t yyscanner ); +void libconfig_yyset_column ( int _column_no , yyscan_t yyscanner ); -YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner ); +YYSTYPE * libconfig_yyget_lval ( yyscan_t yyscanner ); -void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); +void libconfig_yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -751,9 +723,9 @@ void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int libconfig_yywrap (yyscan_t yyscanner ); +extern "C" int libconfig_yywrap ( yyscan_t yyscanner ); #else -extern int libconfig_yywrap (yyscan_t yyscanner ); +extern int libconfig_yywrap ( yyscan_t yyscanner ); #endif #endif @@ -762,19 +734,18 @@ extern int libconfig_yywrap (yyscan_t yyscanner ); #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif @@ -794,7 +765,7 @@ static int input (yyscan_t yyscanner ); /* 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, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -805,7 +776,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -818,7 +789,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -860,7 +831,7 @@ static int input (yyscan_t yyscanner ); #define YY_DECL_IS_OURS 1 extern int libconfig_yylex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); + (YYSTYPE * yylval_param , yyscan_t yyscanner); #define YY_DECL int libconfig_yylex \ (YYSTYPE * yylval_param , yyscan_t yyscanner) @@ -925,7 +896,7 @@ YY_DECL #line 103 "scanner.l" -#line 929 "scanner.c" +#line 899 "scanner.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -954,9 +925,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 123 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 122 ); @@ -970,7 +941,7 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; + int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) @@ -1128,7 +1099,9 @@ YY_RULE_SETUP if(fp) { yyin = fp; - libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner); + libconfig_yy_switch_to_buffer( + libconfig_yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), + yyscanner); } else { @@ -1281,8 +1254,8 @@ case YY_STATE_EOF(SCRIPTBLOCK): yyextra); if(buf) { - libconfig_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner); - libconfig_yy_switch_to_buffer(buf,yyscanner); + libconfig_yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); + libconfig_yy_switch_to_buffer(buf, yyscanner); } else yyterminate(); @@ -1293,7 +1266,7 @@ YY_RULE_SETUP #line 219 "scanner.l" ECHO; YY_BREAK -#line 1297 "scanner.c" +#line 1269 "scanner.c" case YY_END_OF_BUFFER: { @@ -1438,7 +1411,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; - yy_size_t number_to_move, i; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1467,7 +1440,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1480,7 +1453,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1494,7 +1467,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1503,11 +1476,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - libconfig_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + libconfig_yyrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ,yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1549,10 +1522,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->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 = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) libconfig_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) libconfig_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } @@ -1589,9 +1562,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 123 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1618,9 +1591,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 123 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 122); (void)yyg; @@ -1656,7 +1629,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1680,7 +1653,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( libconfig_yywrap(yyscanner ) ) - return EOF; + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1792,12 +1765,12 @@ static void libconfig_yy_load_buffer_state (yyscan_t yyscanner) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + 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 *) libconfig_yyalloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) libconfig_yyalloc((yy_size_t) (b->yy_buf_size + 2) ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_create_buffer()" ); @@ -1953,7 +1926,7 @@ static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner) * 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; // After all that talk, this was set to 1 anyways... + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)libconfig_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); @@ -2000,16 +1973,16 @@ YY_BUFFER_STATE libconfig_yy_scan_buffer (char * base, yy_size_t size , yyscan base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; b = (YY_BUFFER_STATE) libconfig_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2029,10 +2002,10 @@ YY_BUFFER_STATE libconfig_yy_scan_buffer (char * base, yy_size_t size , yyscan * @note If you want to scan bytes that may contain NUL values, then use * libconfig_yy_scan_bytes() instead. */ -YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE libconfig_yy_scan_string (const char * yystr , yyscan_t yyscanner) { - return libconfig_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); + return libconfig_yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to libconfig_yylex() will @@ -2042,15 +2015,15 @@ YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char * yystr , yyscan_t yyscan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE libconfig_yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) (_yybytes_len + 2); buf = (char *) libconfig_yyalloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in libconfig_yy_scan_bytes()" ); @@ -2076,7 +2049,7 @@ YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yy #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; @@ -2159,7 +2132,7 @@ FILE *libconfig_yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t libconfig_yyget_leng (yyscan_t yyscanner) +int libconfig_yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2265,9 +2238,7 @@ void libconfig_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - int libconfig_yylex_init(yyscan_t* ptr_yy_globals) - { if (ptr_yy_globals == NULL){ errno = EINVAL; @@ -2294,9 +2265,7 @@ int libconfig_yylex_init(yyscan_t* ptr_yy_globals) * The user defined value in the first argument will be available to libconfig_yyalloc in * the yyextra field. */ - int libconfig_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - { struct yyguts_t dummy_yyguts; @@ -2330,10 +2299,10 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from libconfig_yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; + yyg->yy_c_buf_p = NULL; yyg->yy_init = 0; yyg->yy_start = 0; @@ -2346,8 +2315,8 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -2391,7 +2360,7 @@ int libconfig_yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; @@ -2403,7 +2372,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { int n; for ( n = 0; s[n]; ++n ) @@ -2417,7 +2386,7 @@ void *libconfig_yyalloc (yy_size_t size , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; - return (void *) malloc( size ); + return malloc(size); } void *libconfig_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) @@ -2432,7 +2401,7 @@ void *libconfig_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void libconfig_yyfree (void * ptr , yyscan_t yyscanner) |