]> granicus.if.org Git - flex/commitdiff
generated code, `max_size' seems to be of type `int', fix casts accordingly
authorrlar <rlar>
Sun, 28 Feb 2016 14:20:31 +0000 (15:20 +0100)
committerWill Estes <westes575@gmail.com>
Sat, 12 Mar 2016 19:25:34 +0000 (14:25 -0500)
src/gen.c

index 21b27ae86e5bf0f5fbcc5b286f950e95d906bc7f..d31aab394a4e66938bcf9f51909ad726b5bf8f48 100644 (file)
--- a/src/gen.c
+++ b/src/gen.c
@@ -1875,7 +1875,7 @@ void make_tables (void)
        if (!C_plus_plus) {
                if (use_read) {
                        outn ("\terrno=0; \\");
-                       outn ("\twhile ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \\");
+                       outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\");
                        outn ("\t{ \\");
                        outn ("\t\tif( errno != EINTR) \\");
                        outn ("\t\t{ \\");
@@ -1891,7 +1891,7 @@ void make_tables (void)
                        outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
                        outn ("\t\t{ \\");
                        outn ("\t\tint c = '*'; \\");
-                       outn ("\t\tsize_t n; \\");
+                       outn ("\t\tint n; \\");
                        outn ("\t\tfor ( n = 0; n < max_size && \\");
                        outn ("\t\t\t     (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
                        outn ("\t\t\tbuf[n] = (char) c; \\");
@@ -1904,7 +1904,7 @@ void make_tables (void)
                        outn ("\telse \\");
                        outn ("\t\t{ \\");
                        outn ("\t\terrno=0; \\");
-                       outn ("\t\twhile ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
+                       outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\");
                        outn ("\t\t\t{ \\");
                        outn ("\t\t\tif( errno != EINTR) \\");
                        outn ("\t\t\t\t{ \\");