Undo the parts of the unlocked-I/O change that substituted

putc or puts for printf.  This might hurt performance a bit,
but some people prefer the printf style.
* data/c.m4 (yysymprint): Prefer printf to puts and putc.
* data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
All uses replaced by YYFPRINTF and YYDPRINTF.
* data/yacc.c: Likewise.
* lib/bitset.c (bitset_print): Likewise.
* lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
putc and puts.
* lib/lbitset.c (debug_lbitset): Likewise.
* src/closure.c (print_firsts, print_fderives): Likewise.
* src/gram.c (grammar_dump): Likewise.
* src/lalr.c (look_ahead_tokens_print): Likewise.
* src/output.c (escaped_output): Likewise.
(user_actions_output): Break apart two printfs.
* src/parse-gram.y (%printer): Prefer printf to putc and puts.
* src/reduce.c (reduce_print): Likewise.
* src/state.c (state_rule_look_ahead_tokens_print): Likewise.
* src/system.h: Include unlocked-io.h rathe than stdio.h.
This commit is contained in:
Paul Eggert
2005-10-05 06:39:08 +00:00
parent 88c6637fa9
commit 2f4f028d8b
14 changed files with 82 additions and 87 deletions

View File

@@ -604,14 +604,9 @@ while (0)
/* Enable debugging if requested. */
#if YYDEBUG
# ifdef YYFPRINTF
# define YYFPUTC(Char, Stream) YYFPRINTF (Stream, "%c", Char)
# define YYFPUTS(Char, Stream) YYFPRINTF (Stream, "%s", String)
# else
# ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
# define YYFPRINTF fprintf
# define YYFPUTC fputc
# define YYFPUTS fputs
# endif
# define YYDPRINTF(Args) \
@@ -620,12 +615,6 @@ do { \
YYFPRINTF Args; \
} while (0)
# define YYDPUTS(String, Stream) \
do { \
if (yydebug) \
YYFPUTS (String, Stream); \
} while (0)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
if (yydebug) \
@@ -633,7 +622,7 @@ do { \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
Type, Value]b4_location_if([, Location])[); \
YYFPUTC ('\n', stderr); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
@@ -646,10 +635,10 @@ do { \
[[short int *bottom], [bottom]],
[[short int *top], [top]])[
{
YYFPUTS ("Stack now", stderr);
YYFPRINTF (stderr, "Stack now");
for (/* Nothing. */; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPUTC ('\n', stderr);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
@@ -685,15 +674,11 @@ do { \
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPUTS(String, File)
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
@@ -1035,7 +1020,7 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
rule. */
int yylen;
YYDPUTS ("Starting parse\n", stderr);
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
@@ -1173,14 +1158,14 @@ yybackup:
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPUTS ("Reading a token: ", stderr);
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
YYDPUTS ("Now at end of input.\n", stderr);
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{