]> granicus.if.org Git - flex/commitdiff
change some int types to size_t as per FreeBSD 28364 from avn@any.ru
authorWill Estes <wlestes@users.sourceforge.net>
Sun, 24 Jun 2001 22:33:13 +0000 (22:33 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Sun, 24 Jun 2001 22:33:13 +0000 (22:33 +0000)
flex.skl
gen.c

index 460c744ea54627353635afb4ae653ba7a9c3a04d..eb371011ccecddc9af82a0d416842dba4455f2ec 100644 (file)
--- 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 20a23d3b1e8cac4660006247bc215c86f6e344b6..4048d38dc14c8532c62059daddc2407bbd7acfe6 100644 (file)
--- 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; \\" );