From: Paul Eggert Date: Wed, 13 Nov 2002 23:20:52 +0000 (+0000) Subject: (Badly Collapsed GLR States): Avoid // X-Git-Tag: BISON-1_875~268 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/c240826c065aec6b3d2a5f61c7c5a2d8c1d124f3 (Badly Collapsed GLR States): Avoid // comments, since they're not portable. Use GNU coding style. --- diff --git a/tests/glr-regr1.at b/tests/glr-regr1.at index 39b7b9a3..d0b558a5 100644 --- a/tests/glr-regr1.at +++ b/tests/glr-regr1.at @@ -25,7 +25,7 @@ AT_DATA([glr-regr1.y], /* Reported by Scott McPeak */ %{ -#include // fgetc, printf +#include #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); @@ -63,29 +63,29 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1) int main (void) { - yyparse(); + yyparse (); return 0; } int yyerror (char const *msg) { - printf("%s\n", msg); - exit(4); + fprintf (stderr, "%s\n", msg); + exit (4); } int yylex (void) { - while (1) { - int ch = fgetc(stdin); - if (ch == EOF) { - return 0; // bison's EOF - } else if (ch == 'B' || ch == 'P') { - return ch; + for (;;) + { + int ch = getchar (); + if (ch == EOF) + return 0; + else if (ch == 'B' || ch == 'P') + return ch; } - } } ]])