mirror of
https://github.com/westes/flex.git
synced 2026-01-26 15:39:06 +00:00
change some int types to size_t as per FreeBSD 28364 from avn@any.ru
This commit is contained in:
parent
3d75cab2a0
commit
61eb82e01b
6
flex.skl
6
flex.skl
@ -143,7 +143,7 @@ int yylex_destroy YY_PROTO((void* scanner));
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
|
||||
#ifndef YY_REENTRANT
|
||||
extern int yyleng;
|
||||
extern size_t yyleng;
|
||||
#endif
|
||||
|
||||
%-
|
||||
@ -275,7 +275,7 @@ static char yy_hold_char;
|
||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
|
||||
|
||||
int yyleng;
|
||||
size_t yyleng;
|
||||
|
||||
/* Points to current character in buffer. */
|
||||
static char *yy_c_buf_p = (char *) 0;
|
||||
@ -1006,7 +1006,7 @@ int yyFlexLexer::yy_get_next_buffer()
|
||||
|
||||
else
|
||||
{
|
||||
int num_to_read =
|
||||
size_t num_to_read =
|
||||
YY_G(yy_current_buffer)->yy_buf_size - number_to_move - 1;
|
||||
|
||||
while ( num_to_read <= 0 )
|
||||
|
||||
7
gen.c
7
gen.c
@ -1074,11 +1074,11 @@ void make_tables()
|
||||
if ( yymore_used && ! yytext_is_array )
|
||||
{
|
||||
indent_puts( "YY_G(yytext_ptr) -= YY_G(yy_more_len); \\" );
|
||||
indent_puts( "YY_G(yyleng) = (int) (yy_cp - YY_G(yytext_ptr)); \\" );
|
||||
indent_puts( "YY_G(yyleng) = (size_t) (yy_cp - YY_G(yytext_ptr)); \\" );
|
||||
}
|
||||
|
||||
else
|
||||
indent_puts( "YY_G(yyleng) = (int) (yy_cp - yy_bp); \\" );
|
||||
indent_puts( "YY_G(yyleng) = (size_t) (yy_cp - yy_bp); \\" );
|
||||
|
||||
/* Now also deal with copying yytext_ptr to yytext if needed. */
|
||||
skelout();
|
||||
@ -1355,7 +1355,8 @@ void make_tables()
|
||||
outn(
|
||||
"\tif ( YY_G(yy_current_buffer)->yy_is_interactive ) \\" );
|
||||
outn( "\t\t{ \\" );
|
||||
outn( "\t\tint c = '*', n; \\" );
|
||||
outn( "\t\tint c = '*'; \\");
|
||||
outn( "\t\tsize_t n; \\" );
|
||||
outn( "\t\tfor ( n = 0; n < max_size && \\" );
|
||||
outn( "\t\t\t (c = getc( YY_G(yyin) )) != EOF && c != '\\n'; ++n ) \\" );
|
||||
outn( "\t\t\tbuf[n] = (char) c; \\" );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user