mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-20 20:31:53 +00:00
Merge pull request #36 from linkcheck/fix-pymem-resize-warnings
Fix "operation on ... may be undefined" [-Wsequence-point] warnings
This commit is contained in:
commit
d8efc82519
5 changed files with 128 additions and 112 deletions
|
|
@ -17,8 +17,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 1
|
||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||
#define FLEX_BETA
|
||||
#endif
|
||||
|
|
@ -118,25 +118,13 @@ typedef unsigned int flex_uint32_t;
|
|||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
|
||||
#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
|
||||
|
||||
/* %not-for-header */
|
||||
|
|
@ -275,12 +263,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
|
||||
|
|
@ -303,7 +291,7 @@ struct yy_buffer_state
|
|||
|
||||
int yy_bs_lineno; /**< The line count. */
|
||||
int yy_bs_column; /**< The column count. */
|
||||
|
||||
|
||||
/* Whether to try to fill the input buffer when we reach the
|
||||
* end of it.
|
||||
*/
|
||||
|
|
@ -377,7 +365,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
|
|||
|
||||
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
|
||||
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
|
||||
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
|
||||
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
|
||||
|
||||
/* %endif */
|
||||
|
||||
|
|
@ -412,7 +400,7 @@ void yyfree (void * ,yyscan_t yyscanner );
|
|||
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
|
||||
/* Begin user sect3 */
|
||||
|
||||
#define yywrap(yyscanner) 1
|
||||
#define yywrap(yyscanner) (/*CONSTCOND*/1)
|
||||
#define YY_SKIP_YYWRAP
|
||||
|
||||
#define FLEX_DEBUG
|
||||
|
|
@ -2497,7 +2485,7 @@ static yyconst flex_int32_t yy_nxt[][38] =
|
|||
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 yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
|
||||
static void yynoreturn yy_fatal_error (yyconst char* msg ,yyscan_t yyscanner );
|
||||
|
||||
/* %endif */
|
||||
|
||||
|
|
@ -2507,7 +2495,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
|
|||
#define YY_DO_BEFORE_ACTION \
|
||||
yyg->yytext_ptr = yy_bp; \
|
||||
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
|
||||
yyleng = (size_t) (yy_cp - yy_bp); \
|
||||
yyleng = (int) (yy_cp - yy_bp); \
|
||||
yyg->yy_hold_char = *yy_cp; \
|
||||
*yy_cp = '\0'; \
|
||||
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
|
||||
|
|
@ -2557,7 +2545,7 @@ static yyconst flex_int32_t yy_accept[279] =
|
|||
77, 0, 69, 17, 20, 54, 0, 40
|
||||
} ;
|
||||
|
||||
static yyconst flex_int32_t yy_ec[256] =
|
||||
static yyconst YY_CHAR yy_ec[256] =
|
||||
{ 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 2, 2, 3,
|
||||
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
|
@ -2662,7 +2650,7 @@ static yyconst flex_int32_t yy_rule_linenum[131] =
|
|||
|
||||
/* resize buffer b, returning T_ERROR on error */
|
||||
#define RESIZE_BUF(b, n) \
|
||||
CHECK_NULL((b) = PyMem_Resize((b), char, (n))); \
|
||||
CHECK_NULL(PyMem_Resize((b), char, (n))); \
|
||||
(b)[(n)-1] = '\0'
|
||||
|
||||
/* make python unicode string from tmp_buf and assign it to a */
|
||||
|
|
@ -2820,7 +2808,7 @@ void yyfree (void* ptr, void* yyscanner) {
|
|||
|
||||
|
||||
/* regular expression definitions used below */
|
||||
#line 2823 "htmllex.c"
|
||||
#line 2811 "htmllex.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define S_PI 1
|
||||
|
|
@ -2882,8 +2870,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;
|
||||
|
|
@ -2940,23 +2928,23 @@ void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
|
|||
|
||||
FILE *yyget_in (yyscan_t yyscanner );
|
||||
|
||||
void yyset_in (FILE * in_str ,yyscan_t yyscanner );
|
||||
void yyset_in (FILE * _in_str ,yyscan_t yyscanner );
|
||||
|
||||
FILE *yyget_out (yyscan_t yyscanner );
|
||||
|
||||
void yyset_out (FILE * out_str ,yyscan_t yyscanner );
|
||||
void yyset_out (FILE * _out_str ,yyscan_t yyscanner );
|
||||
|
||||
yy_size_t yyget_leng (yyscan_t yyscanner );
|
||||
int yyget_leng (yyscan_t yyscanner );
|
||||
|
||||
char *yyget_text (yyscan_t yyscanner );
|
||||
|
||||
int yyget_lineno (yyscan_t yyscanner );
|
||||
|
||||
void yyset_lineno (int line_number ,yyscan_t yyscanner );
|
||||
void yyset_lineno (int _line_number ,yyscan_t yyscanner );
|
||||
|
||||
int yyget_column (yyscan_t yyscanner );
|
||||
|
||||
void yyset_column (int column_no ,yyscan_t yyscanner );
|
||||
void yyset_column (int _column_no ,yyscan_t yyscanner );
|
||||
|
||||
/* %if-bison-bridge */
|
||||
|
||||
|
|
@ -2980,6 +2968,9 @@ extern int yywrap (yyscan_t yyscanner );
|
|||
|
||||
/* %not-for-header */
|
||||
|
||||
#ifndef YY_NO_UNPUT
|
||||
|
||||
#endif
|
||||
/* %ok-for-header */
|
||||
|
||||
/* %endif */
|
||||
|
|
@ -3026,7 +3017,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 */
|
||||
/* %if-c++-only C++ definition */
|
||||
/* %endif */
|
||||
|
|
@ -3039,7 +3030,7 @@ static int input (yyscan_t yyscanner );
|
|||
#define YY_INPUT(buf,result,max_size) \
|
||||
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
|
||||
errno=0; \
|
||||
while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
|
||||
while ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \
|
||||
{ \
|
||||
if( errno != EINTR) \
|
||||
{ \
|
||||
|
|
@ -3116,7 +3107,7 @@ extern int yylex \
|
|||
|
||||
/* Code executed at the end of each rule. */
|
||||
#ifndef YY_BREAK
|
||||
#define YY_BREAK break;
|
||||
#define YY_BREAK /*LINTED*/break;
|
||||
#endif
|
||||
|
||||
/* %% [6.0] YY_RULE_SETUP definition goes here */
|
||||
|
|
@ -3129,9 +3120,9 @@ extern int yylex \
|
|||
*/
|
||||
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;
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
yylval = yylval_param;
|
||||
|
|
@ -3176,9 +3167,9 @@ YY_DECL
|
|||
|
||||
|
||||
/*********************** EOF ************************/
|
||||
#line 3179 "htmllex.c"
|
||||
#line 3170 "htmllex.c"
|
||||
|
||||
while ( 1 ) /* loops until end-of-file is reached */
|
||||
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
|
||||
{
|
||||
/* %% [8.0] yymore()-related code goes here */
|
||||
yy_cp = yyg->yy_c_buf_p;
|
||||
|
|
@ -4717,7 +4708,7 @@ YY_RULE_SETUP
|
|||
#line 1091 "htmllex.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 4720 "htmllex.c"
|
||||
#line 4711 "htmllex.c"
|
||||
|
||||
case YY_END_OF_BUFFER:
|
||||
{
|
||||
|
|
@ -4740,7 +4731,11 @@ ECHO;
|
|||
* back-up) that will match for the new input source.
|
||||
*/
|
||||
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
||||
/* %if-c-only */
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
|
||||
/* %endif */
|
||||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
|
||||
}
|
||||
|
||||
|
|
@ -4872,9 +4867,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
/* %endif */
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
||||
register char *source = yyg->yytext_ptr;
|
||||
register int number_to_move, i;
|
||||
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
||||
char *source = yyg->yytext_ptr;
|
||||
yy_size_t 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] )
|
||||
|
|
@ -4903,7 +4898,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 = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
|
||||
number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
|
||||
|
||||
for ( i = 0; i < number_to_move; ++i )
|
||||
*(dest++) = *(source++);
|
||||
|
|
@ -4916,7 +4911,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 )
|
||||
|
|
@ -4930,7 +4925,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;
|
||||
|
|
@ -4943,7 +4938,7 @@ static int yy_get_next_buffer (yyscan_t 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(
|
||||
|
|
@ -4985,9 +4980,9 @@ 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 ((int) (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);
|
||||
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
|
||||
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
|
||||
|
|
@ -5012,8 +5007,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
{
|
||||
register yy_state_type yy_current_state;
|
||||
register char *yy_cp;
|
||||
yy_state_type yy_current_state;
|
||||
char *yy_cp;
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
/* %% [15.0] code to get the start state into yy_current_state goes here */
|
||||
|
|
@ -5044,10 +5039,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
{
|
||||
register int yy_is_jam;
|
||||
int yy_is_jam;
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
|
||||
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
|
||||
register char *yy_cp = yyg->yy_c_buf_p;
|
||||
char *yy_cp = yyg->yy_c_buf_p;
|
||||
|
||||
yy_current_state = yy_nxt[yy_current_state][1];
|
||||
yy_is_jam = (yy_current_state <= 0);
|
||||
|
|
@ -5065,9 +5060,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
return yy_is_jam ? 0 : yy_current_state;
|
||||
}
|
||||
|
||||
#ifndef YY_NO_UNPUT
|
||||
/* %if-c-only */
|
||||
|
||||
/* %endif */
|
||||
#endif
|
||||
|
||||
/* %if-c-only */
|
||||
#ifndef YY_NO_INPUT
|
||||
|
|
@ -5098,7 +5095,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 = yyg->yy_c_buf_p - yyg->yytext_ptr;
|
||||
++yyg->yy_c_buf_p;
|
||||
|
||||
switch ( yy_get_next_buffer( yyscanner ) )
|
||||
|
|
@ -5122,7 +5119,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
case EOB_ACT_END_OF_FILE:
|
||||
{
|
||||
if ( yywrap(yyscanner ) )
|
||||
return EOF;
|
||||
return 0;
|
||||
|
||||
if ( ! yyg->yy_did_buffer_switch_on_eof )
|
||||
YY_NEW_FILE;
|
||||
|
|
@ -5175,6 +5172,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
yy_load_buffer_state(yyscanner );
|
||||
}
|
||||
|
||||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
|
||||
/** Switch to a different input buffer.
|
||||
* @param new_buffer The new input buffer.
|
||||
* @param yyscanner The scanner object.
|
||||
|
|
@ -5224,7 +5224,11 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
|
|||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
||||
yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
|
||||
/* %if-c-only */
|
||||
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
|
||||
/* %endif */
|
||||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
yyg->yy_hold_char = *yyg->yy_c_buf_p;
|
||||
}
|
||||
|
||||
|
|
@ -5246,7 +5250,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
|
|||
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.
|
||||
|
|
@ -5262,6 +5266,9 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
|
|||
return b;
|
||||
}
|
||||
|
||||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
|
||||
/** Destroy the buffer.
|
||||
* @param b a buffer created with yy_create_buffer()
|
||||
* @param yyscanner The scanner object.
|
||||
|
|
@ -5302,7 +5309,11 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
|
|||
|
||||
yy_flush_buffer(b ,yyscanner);
|
||||
|
||||
/* %if-c-only */
|
||||
b->yy_input_file = file;
|
||||
/* %endif */
|
||||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
b->yy_fill_buffer = 1;
|
||||
|
||||
/* If b is the current buffer, then yy_init_buffer was _probably_
|
||||
|
|
@ -5432,7 +5443,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
|
|||
/* %if-c++-only */
|
||||
/* %endif */
|
||||
{
|
||||
yy_size_t num_to_alloc;
|
||||
int num_to_alloc;
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
if (!yyg->yy_buffer_stack) {
|
||||
|
|
@ -5441,15 +5452,15 @@ static void 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;
|
||||
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
|
||||
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
|
||||
(num_to_alloc * sizeof(struct yy_buffer_state*)
|
||||
, yyscanner);
|
||||
if ( ! yyg->yy_buffer_stack )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
|
||||
|
||||
|
||||
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
||||
|
||||
|
||||
yyg->yy_buffer_stack_max = num_to_alloc;
|
||||
yyg->yy_buffer_stack_top = 0;
|
||||
return;
|
||||
|
|
@ -5458,7 +5469,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
|
|||
if (yyg->yy_buffer_stack_top >= (yyg->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 = yyg->yy_buffer_stack_max + grow_size;
|
||||
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
|
||||
|
|
@ -5480,7 +5491,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
|
|||
* @param base the character buffer
|
||||
* @param size the size in bytes of the character buffer
|
||||
* @param yyscanner The scanner object.
|
||||
* @return the newly allocated buffer state object.
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
|
||||
{
|
||||
|
|
@ -5490,7 +5501,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
|
|||
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) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
|
||||
if ( ! b )
|
||||
|
|
@ -5499,7 +5510,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
|
|||
b->yy_buf_size = 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;
|
||||
|
|
@ -5524,7 +5535,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
|
|||
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
|
||||
{
|
||||
|
||||
return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
|
||||
return yy_scan_bytes(yystr,(int) strlen(yystr) ,yyscanner);
|
||||
}
|
||||
/* %endif */
|
||||
|
||||
|
|
@ -5536,7 +5547,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
|
|||
* @param yyscanner The scanner object.
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
|
||||
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
|
||||
{
|
||||
YY_BUFFER_STATE b;
|
||||
char *buf;
|
||||
|
|
@ -5544,7 +5555,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
|||
yy_size_t 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 *) yyalloc(n ,yyscanner );
|
||||
if ( ! buf )
|
||||
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
|
||||
|
|
@ -5572,9 +5583,11 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
|
|||
#endif
|
||||
|
||||
/* %if-c-only */
|
||||
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
|
||||
static void yynoreturn yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
|
||||
{
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
(void)yyg;
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
exit( YY_EXIT_FAILURE );
|
||||
}
|
||||
/* %endif */
|
||||
|
|
@ -5620,7 +5633,7 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
|
|||
int yyget_lineno (yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
|
||||
if (! YY_CURRENT_BUFFER)
|
||||
return 0;
|
||||
|
||||
|
|
@ -5633,7 +5646,7 @@ int yyget_lineno (yyscan_t yyscanner)
|
|||
int yyget_column (yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
|
||||
if (! YY_CURRENT_BUFFER)
|
||||
return 0;
|
||||
|
||||
|
|
@ -5661,7 +5674,7 @@ FILE *yyget_out (yyscan_t yyscanner)
|
|||
/** Get the length of the current token.
|
||||
* @param yyscanner The scanner object.
|
||||
*/
|
||||
yy_size_t yyget_leng (yyscan_t yyscanner)
|
||||
int yyget_leng (yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
return yyleng;
|
||||
|
|
@ -5692,10 +5705,10 @@ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
|
|||
/* %endif */
|
||||
|
||||
/** Set the current line number.
|
||||
* @param line_number
|
||||
* @param _line_number line number
|
||||
* @param yyscanner The scanner object.
|
||||
*/
|
||||
void yyset_lineno (int line_number , yyscan_t yyscanner)
|
||||
void yyset_lineno (int _line_number , yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
|
|
@ -5703,14 +5716,14 @@ void yyset_lineno (int line_number , yyscan_t yyscanner)
|
|||
if (! YY_CURRENT_BUFFER )
|
||||
YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
|
||||
|
||||
yylineno = line_number;
|
||||
yylineno = _line_number;
|
||||
}
|
||||
|
||||
/** Set the current column.
|
||||
* @param line_number
|
||||
* @param _column_no column number
|
||||
* @param yyscanner The scanner object.
|
||||
*/
|
||||
void yyset_column (int column_no , yyscan_t yyscanner)
|
||||
void yyset_column (int _column_no , yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
|
||||
|
|
@ -5718,25 +5731,25 @@ void yyset_column (int column_no , yyscan_t yyscanner)
|
|||
if (! YY_CURRENT_BUFFER )
|
||||
YY_FATAL_ERROR( "yyset_column called with no buffer" );
|
||||
|
||||
yycolumn = column_no;
|
||||
yycolumn = _column_no;
|
||||
}
|
||||
|
||||
/** Set the input stream. This does not discard the current
|
||||
* input buffer.
|
||||
* @param in_str A readable stream.
|
||||
* @param _in_str A readable stream.
|
||||
* @param yyscanner The scanner object.
|
||||
* @see yy_switch_to_buffer
|
||||
*/
|
||||
void yyset_in (FILE * in_str , yyscan_t yyscanner)
|
||||
void yyset_in (FILE * _in_str , yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
yyin = in_str ;
|
||||
yyin = _in_str ;
|
||||
}
|
||||
|
||||
void yyset_out (FILE * out_str , yyscan_t yyscanner)
|
||||
void yyset_out (FILE * _out_str , yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
yyout = out_str ;
|
||||
yyout = _out_str ;
|
||||
}
|
||||
|
||||
int yyget_debug (yyscan_t yyscanner)
|
||||
|
|
@ -5745,10 +5758,10 @@ int yyget_debug (yyscan_t yyscanner)
|
|||
return yy_flex_debug;
|
||||
}
|
||||
|
||||
void yyset_debug (int bdebug , yyscan_t yyscanner)
|
||||
void yyset_debug (int _bdebug , yyscan_t yyscanner)
|
||||
{
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
yy_flex_debug = bdebug ;
|
||||
yy_flex_debug = _bdebug ;
|
||||
}
|
||||
|
||||
/* %endif */
|
||||
|
|
@ -5819,20 +5832,20 @@ int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
|
|||
errno = EINVAL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
|
||||
|
||||
|
||||
if (*ptr_yy_globals == NULL){
|
||||
errno = ENOMEM;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* By setting to 0xAA, we expose bugs in
|
||||
yy_init_globals. Leave at 0x00 for releases. */
|
||||
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
|
||||
|
||||
|
||||
yyset_extra (yy_user_defined, *ptr_yy_globals);
|
||||
|
||||
|
||||
return yy_init_globals ( *ptr_yy_globals );
|
||||
}
|
||||
|
||||
|
|
@ -5846,10 +5859,10 @@ static int yy_init_globals (yyscan_t yyscanner)
|
|||
* This function is called from 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;
|
||||
|
||||
|
|
@ -5862,8 +5875,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
|
||||
|
|
@ -5914,7 +5927,10 @@ int yylex_destroy (yyscan_t yyscanner)
|
|||
#ifndef yytext_ptr
|
||||
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
|
||||
{
|
||||
register int i;
|
||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||
(void)yyg;
|
||||
|
||||
int i;
|
||||
for ( i = 0; i < n; ++i )
|
||||
s1[i] = s2[i];
|
||||
}
|
||||
|
|
@ -5923,7 +5939,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
|
|||
#ifdef YY_NEED_STRLEN
|
||||
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
|
||||
{
|
||||
register int n;
|
||||
int n;
|
||||
for ( n = 0; s[n]; ++n )
|
||||
;
|
||||
|
||||
|
|
@ -5938,7 +5954,7 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
|
|||
|
||||
/* %ok-for-header */
|
||||
|
||||
#line 1090 "htmllex.l"
|
||||
#line 1091 "htmllex.l"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
/* resize buffer b, returning T_ERROR on error */
|
||||
#define RESIZE_BUF(b, n) \
|
||||
CHECK_NULL((b) = PyMem_Resize((b), char, (n))); \
|
||||
CHECK_NULL(PyMem_Resize((b), char, (n))); \
|
||||
(b)[(n)-1] = '\0'
|
||||
|
||||
/* make python unicode string from tmp_buf and assign it to a */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* A Bison parser, made by GNU Bison 3.0.2. */
|
||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
|
||||
/* Bison implementation for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "3.0.2"
|
||||
#define YYBISON_VERSION "3.0.4"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
|
|
@ -142,13 +142,13 @@ static PyObject* u_meta;
|
|||
|
||||
/* clear buffer b, returning NULL on error */
|
||||
#define CLEAR_BUF(b) \
|
||||
b = PyMem_Resize(b, char, 1); \
|
||||
PyMem_Resize(b, char, 1); \
|
||||
if (b == NULL) return NULL; \
|
||||
(b)[0] = '\0'
|
||||
|
||||
/* clear buffer b, returning NULL and decref self on error */
|
||||
#define CLEAR_BUF_DECREF(self, b) \
|
||||
b = PyMem_Resize(b, char, 1); \
|
||||
PyMem_Resize(b, char, 1); \
|
||||
if (b == NULL) { Py_DECREF(self); return NULL; } \
|
||||
(b)[0] = '\0'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* A Bison parser, made by GNU Bison 3.0.2. */
|
||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@ static PyObject* u_meta;
|
|||
|
||||
/* clear buffer b, returning NULL on error */
|
||||
#define CLEAR_BUF(b) \
|
||||
b = PyMem_Resize(b, char, 1); \
|
||||
PyMem_Resize(b, char, 1); \
|
||||
if (b == NULL) return NULL; \
|
||||
(b)[0] = '\0'
|
||||
|
||||
/* clear buffer b, returning NULL and decref self on error */
|
||||
#define CLEAR_BUF_DECREF(self, b) \
|
||||
b = PyMem_Resize(b, char, 1); \
|
||||
PyMem_Resize(b, char, 1); \
|
||||
if (b == NULL) { Py_DECREF(self); return NULL; } \
|
||||
(b)[0] = '\0'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue