From 619d22dde54ffe483ef8a57e49ec802b0e30c6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Apr 2019 13:03:18 +0300 Subject: Rebuild the InnoDB lexical analyzers with flex 2.6.4 InnoDB includes 3 parsers, which use 3 lexical analyzers that are generated with flex. Flex versions before 2.6 emitted the keyword "register", which is deprecated in C++17. The lexical analyzers were regenerated as follows: for s in storage/innobase storage/xtradb do (cd "$s"/pars; ./make_flex.sh) touch "$s"/fts/*.l make -C "$s"/fts -f Makefile.query done --- storage/innobase/pars/lexyy.cc | 506 ++++++++++++++++++------------------- storage/innobase/pars/make_flex.sh | 9 +- storage/innobase/pars/pars0lex.l | 4 +- storage/innobase/pars/pars0pars.cc | 9 +- 4 files changed, 262 insertions(+), 266 deletions(-) (limited to 'storage/innobase/pars') diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index bfa8e2ea950..54fe182ae6b 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -9,8 +9,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 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -35,7 +35,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +52,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -85,60 +85,48 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +/* begin standard C++ headers. */ -/* 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)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (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 (((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 yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -168,16 +156,17 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; -extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #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) \ do \ @@ -191,7 +180,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -206,12 +194,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 @@ -262,7 +250,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -273,7 +261,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(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. */ @@ -281,11 +268,11 @@ 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 */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -294,85 +281,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -static 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 yyrestart ( FILE *input_file ); +MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +static YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +static void yy_delete_buffer ( YY_BUFFER_STATE b ); +static void yy_flush_buffer ( YY_BUFFER_STATE b ); +MY_ATTRIBUTE((unused)) static void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +MY_ATTRIBUTE((unused)) static 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 ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int 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 * ); +static void *yyalloc ( yy_size_t ); +static void *yyrealloc ( void *, yy_size_t ); +static void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ 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 ){\ 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; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +static FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; +static 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 ); -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 yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 124 #define YY_END_OF_BUFFER 125 /* This struct is not used in this scanner, @@ -382,7 +365,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[425] = +static const flex_int16_t yy_accept[425] = { 0, 0, 0, 119, 119, 0, 0, 0, 0, 125, 123, 122, 122, 8, 123, 114, 5, 103, 109, 112, 110, @@ -433,7 +416,7 @@ static yyconst flex_int16_t yy_accept[425] = 96, 96, 62, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const 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, @@ -465,7 +448,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[57] = +static const YY_CHAR yy_meta[57] = { 0, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, @@ -475,7 +458,7 @@ static yyconst flex_int32_t yy_meta[57] = 9, 9, 9, 9, 1, 1 } ; -static yyconst flex_int16_t yy_base[438] = +static const flex_int16_t yy_base[438] = { 0, 0, 0, 293, 287, 284, 281, 272, 256, 254, 1357, 55, 57, 1357, 0, 1357, 1357, 1357, 1357, 1357, 1357, @@ -527,7 +510,7 @@ static yyconst flex_int16_t yy_base[438] = 1306, 1315, 1324, 1333, 1340, 1344, 1347 } ; -static yyconst flex_int16_t yy_def[438] = +static const flex_int16_t yy_def[438] = { 0, 424, 1, 425, 425, 426, 426, 427, 427, 424, 424, 424, 424, 424, 428, 424, 424, 424, 424, 424, 424, @@ -579,7 +562,7 @@ static yyconst flex_int16_t yy_def[438] = 424, 424, 424, 424, 424, 424, 424 } ; -static yyconst flex_int16_t yy_nxt[1414] = +static const flex_int16_t yy_nxt[1414] = { 0, 10, 11, 12, 13, 10, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, @@ -739,7 +722,7 @@ static yyconst flex_int16_t yy_nxt[1414] = 424, 424, 424 } ; -static yyconst flex_int16_t yy_chk[1414] = +static const flex_int16_t yy_chk[1414] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -902,8 +885,8 @@ static yyconst flex_int16_t yy_chk[1414] = static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int yy_flex_debug; -int yy_flex_debug = 0; + +static int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -912,11 +895,12 @@ int yy_flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *yytext; +static char *yytext; #line 1 "pars0lex.l" /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -951,7 +935,7 @@ Created 12/14/1997 Heikki Tuuri *******************************************************/ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 -#line 53 "pars0lex.l" +#line 54 "pars0lex.l" #define YYSTYPE que_node_t* #include "univ.i" @@ -966,9 +950,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - (result = pars_get_lex_chars(buf, max_size)) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -1000,10 +983,9 @@ string_append( stringbuf_len += len; } +#line 986 "lexyy.cc" - - -#line 1006 "lexyy.cc" +#line 988 "lexyy.cc" #define INITIAL 0 #define comment 1 @@ -1022,36 +1004,36 @@ string_append( #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. */ -MY_ATTRIBUTE((unused)) static int yylex_destroy (void ); +MY_ATTRIBUTE((unused)) static int yylex_destroy ( void ); -int yyget_debug (void ); +MY_ATTRIBUTE((unused)) static int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +MY_ATTRIBUTE((unused)) static 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 ); +MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +MY_ATTRIBUTE((unused)) static void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +MY_ATTRIBUTE((unused)) static void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + MY_ATTRIBUTE((unused)) static int yyget_leng ( void ); -char *yyget_text (void ); +MY_ATTRIBUTE((unused)) static char *yyget_text ( void ); -int yyget_lineno (void ); +MY_ATTRIBUTE((unused)) static int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +MY_ATTRIBUTE((unused)) static void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1059,26 +1041,29 @@ 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 YY_NO_UNPUT + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const 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 @@ -1098,7 +1083,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, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1109,7 +1094,7 @@ static int input (void ); 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; \ @@ -1122,7 +1107,7 @@ static int input (void ); 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) \ { \ @@ -1177,7 +1162,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 \ @@ -1187,15 +1172,10 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 112 "pars0lex.l" - - -#line 1197 "lexyy.cc" - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1216,13 +1196,19 @@ YY_DECL 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( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 112 "pars0lex.l" + + +#line 1209 "lexyy.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1238,7 +1224,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; @@ -1248,9 +1234,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - 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 != 424 ); @@ -2234,7 +2220,7 @@ YY_RULE_SETUP #line 691 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2237 "lexyy.cc" +#line 2223 "lexyy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2316,7 +2302,7 @@ case YY_STATE_EOF(id): { (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 @@ -2369,6 +2355,7 @@ case YY_STATE_EOF(id): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2380,9 +2367,9 @@ case YY_STATE_EOF(id): */ 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); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2411,7 +2398,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 = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2424,21 +2411,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1); + int 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 = static_cast(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; @@ -2447,11 +2434,12 @@ static int yy_get_next_buffer (void) 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, + (yy_size_t) (b->yy_buf_size + 2) ); } 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( @@ -2459,9 +2447,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = static_cast( - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1); + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -2470,7 +2457,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); } @@ -2480,7 +2467,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -2494,12 +2481,15 @@ 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 (((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 ); + 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, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2513,16 +2503,16 @@ static int yy_get_next_buffer (void) /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yy_get_previous_state (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; @@ -2532,9 +2522,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - 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; @@ -2545,12 +2535,12 @@ static int yy_get_next_buffer (void) * synopsis * 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); + 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; @@ -2560,14 +2550,18 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 425 ) - 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 == 424); - 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) @@ -2577,7 +2571,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2592,7 +2586,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2609,14 +2603,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2644,29 +2638,29 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + static void yyrestart (FILE * input_file ) { - + 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. - * + * */ MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -2685,7 +2679,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 @@ -2706,14 +2700,14 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ static YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2722,24 +2716,24 @@ static void yy_load_buffer_state (void) /* 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 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (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; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) + static void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2747,21 +2741,21 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * 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; @@ -2776,15 +2770,15 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) + static void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2804,16 +2798,16 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +MY_ATTRIBUTE((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; @@ -2835,15 +2829,15 @@ 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; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void yypop_buffer_state (void) +MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; @@ -2854,7 +2848,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2864,15 +2858,15 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; - + yy_size_t num_to_alloc; + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * 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*) ); @@ -2889,10 +2883,9 @@ 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 = static_cast( - (yy_buffer_stack_max) + grow_size); + 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*) @@ -2910,9 +2903,9 @@ static void yyensure_buffer_stack (void) #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2936,81 +2929,81 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int yyget_lineno (void) +MY_ATTRIBUTE((unused)) static int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ -FILE *yyget_in (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_in (void) { return yyin; } /** Get the output stream. - * + * */ -FILE *yyget_out (void) +MY_ATTRIBUTE((unused)) static FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t yyget_leng (void) +MY_ATTRIBUTE((unused)) static int yyget_leng (void) { return yyleng; } /** Get the current token. - * + * */ -char *yyget_text (void) +MY_ATTRIBUTE((unused)) static char *yyget_text (void) { return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void yyset_lineno (int line_number ) +MY_ATTRIBUTE((unused)) static 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 ) +MY_ATTRIBUTE((unused)) static void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +MY_ATTRIBUTE((unused)) static void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } -int yyget_debug (void) +MY_ATTRIBUTE((unused)) static int yyget_debug (void) { return yy_flex_debug; } -void yyset_debug (int bdebug ) +MY_ATTRIBUTE((unused)) static void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -3019,10 +3012,10 @@ static int yy_init_globals (void) * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -3031,8 +3024,8 @@ static int yy_init_globals (void) 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 @@ -3044,10 +3037,10 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ MY_ATTRIBUTE((unused)) static 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(); } @@ -3068,18 +3061,19 @@ MY_ATTRIBUTE((unused)) static 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, const char * s2, int n ) { - register int i; + + int 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 (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3087,13 +3081,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *yyalloc (yy_size_t size ) +static void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) +static 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 @@ -3101,12 +3096,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 realloc(ptr, size); } -void yyfree (void * ptr ) +static void yyfree (void * ptr ) { - free( (char*) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -3114,7 +3109,6 @@ void yyfree (void * ptr ) #line 691 "pars0lex.l" - /********************************************************************** Release any resources used by the lexer. */ UNIV_INTERN diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index c3db8aea298..2ddb1460640 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,6 +1,7 @@ #!/bin/bash # # Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2017, MariaDB Corporation. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; +s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; @@ -38,11 +40,12 @@ s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/; s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/; s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/; s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/; -s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/; +s/extern int yy\(leng\|_flex_debug\|lineno\);//; +s/\(int yy\(leng\|lineno\|_flex_debug\)\)/static \1/; s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/; -s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/; s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/; -s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/; +s/^extern \(\(FILE\|char\) *\* *yy\).*//; +s/^\(FILE\|char\) *\* *yy/static &/; ' < $TMPFILE >> $OUTFILE rm $TMPFILE diff --git a/storage/innobase/pars/pars0lex.l b/storage/innobase/pars/pars0lex.l index 83c3af4b6c5..60756413c0a 100644 --- a/storage/innobase/pars/pars0lex.l +++ b/storage/innobase/pars/pars0lex.l @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -64,9 +65,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - pars_get_lex_chars(buf, (int*) &result, max_size) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index ce61d6e1e3b..24bbeb1d36d 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2153,16 +2154,14 @@ pars_stored_procedure_call( /*************************************************************//** Retrieves characters to the lexical analyzer. */ UNIV_INTERN -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size) /*!< in: maximum number of characters which fit + size_t max_size) /*!< in: maximum number of characters which fit in the buffer */ { - int len; - - len = static_cast( + size_t len = size_t( pars_sym_tab_global->string_len - pars_sym_tab_global->next_char_pos); if (len == 0) { -- cgit v1.2.1 From b88f3786484e22759c8402494b8b9cc1e7a1cc46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 2 Apr 2019 08:48:54 +0300 Subject: Omit the definition of unused function yyset_extra() This is follow-up for commit 619d22dde54ffe483ef8a57e49ec802b0e30c6bf to fix the cmake -DWITH_EMBEDDED_SERVER build. --- storage/innobase/pars/lexyy.cc | 2 +- storage/innobase/pars/make_flex.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'storage/innobase/pars') diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index 54fe182ae6b..33de48e7b2f 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -1017,7 +1017,7 @@ MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); -MY_ATTRIBUTE((unused)) static void yyset_extra ( YY_EXTRA_TYPE user_defined ); + MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index 2ddb1460640..54aebb259d9 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2017, MariaDB Corporation. +# Copyright (c) 2017, 2019, MariaDB Corporation. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -32,7 +32,7 @@ echo '#include "univ.i"' > $OUTFILE # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; -s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// +s/^void *yyset_extra *( *YY_EXTRA_TYPE *user_defined *) *;// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; -- cgit v1.2.1