flex-max_size.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. commit 3946924ed5e77420c453bf841603c7278766093a
  2. Author: rlar <rlar>
  3. Date: Sun Feb 28 15:20:31 2016 +0100
  4. generated code, `max_size' seems to be of type `int', fix casts accordingly
  5. Index: b/src/gen.c
  6. ===================================================================
  7. --- a/src/gen.c
  8. +++ b/src/gen.c
  9. @@ -1875,7 +1875,7 @@ void make_tables (void)
  10. if (!C_plus_plus) {
  11. if (use_read) {
  12. outn ("\terrno=0; \\");
  13. - outn ("\twhile ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \\");
  14. + outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\");
  15. outn ("\t{ \\");
  16. outn ("\t\tif( errno != EINTR) \\");
  17. outn ("\t\t{ \\");
  18. @@ -1891,7 +1891,7 @@ void make_tables (void)
  19. outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
  20. outn ("\t\t{ \\");
  21. outn ("\t\tint c = '*'; \\");
  22. - outn ("\t\tsize_t n; \\");
  23. + outn ("\t\tint n; \\");
  24. outn ("\t\tfor ( n = 0; n < max_size && \\");
  25. outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
  26. outn ("\t\t\tbuf[n] = (char) c; \\");
  27. @@ -1904,7 +1904,7 @@ void make_tables (void)
  28. outn ("\telse \\");
  29. outn ("\t\t{ \\");
  30. outn ("\t\terrno=0; \\");
  31. - outn ("\t\twhile ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
  32. + outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\");
  33. outn ("\t\t\t{ \\");
  34. outn ("\t\t\tif( errno != EINTR) \\");
  35. outn ("\t\t\t\t{ \\");