From fa61517ea6f7aac3151fede27061e88acd94b5a6 Mon Sep 17 00:00:00 2001 From: wlestes Date: Sun, 24 Jun 2001 22:33:13 +0000 Subject: change some int types to size_t as per FreeBSD 28364 from avn@any.ru --- flex.skl | 6 +++--- gen.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/flex.skl b/flex.skl index 460c744..eb37101 100644 --- a/flex.skl +++ b/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 ) diff --git a/gen.c b/gen.c index 20a23d3..4048d38 100644 --- a/gen.c +++ b/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; \\" ); -- cgit v1.2.1