diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2002-10-22 04:53:49 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2002-10-22 04:53:49 +0000 |
commit | 0ae6073a18a8f31ececdef5e0e0bf1c645b46ad6 (patch) | |
tree | 5703c8df400244b219a35930bf31d64c5b083d92 /src | |
parent | 8307162d58343d40c8e6630326575edd71771957 (diff) | |
download | bison-0ae6073a18a8f31ececdef5e0e0bf1c645b46ad6.tar.gz |
(warning_issued): Renamed from warn_message_count,
so that we needn't worry about integer overflow (!).
Now of type bool. All uses changed.
(complaint_issued): Renamed from complain_message_count; likewise.
(fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
Diffstat (limited to 'src')
-rw-r--r-- | src/complain.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/complain.c b/src/complain.c index 01cda949..1ad672ba 100644 --- a/src/complain.c +++ b/src/complain.c @@ -83,11 +83,11 @@ private_strerror (int errnum) # endif /* HAVE_STRERROR */ #endif /* not _LIBC */ -/* This variable is incremented each time `warn' is called. */ -unsigned int warn_message_count; +/* This variable is set each time `warn' is called. */ +bool warning_issued; -/* This variable is incremented each time `complain' is called. */ -unsigned int complain_message_count; +/* This variable is set each time `complain' is called. */ +bool complaint_issued; /*--------------------------------. @@ -108,7 +108,7 @@ warn_at (location_t location, const char *message, ...) vfprintf (stderr, message, args); va_end (args); - ++warn_message_count; + warning_issued = true; putc ('\n', stderr); fflush (stderr); } @@ -125,7 +125,7 @@ warn (const char *message, ...) vfprintf (stderr, message, args); va_end (args); - ++warn_message_count; + warning_issued = true; putc ('\n', stderr); fflush (stderr); } @@ -147,7 +147,7 @@ complain_at (location_t location, const char *message, ...) vfprintf (stderr, message, args); va_end (args); - ++complain_message_count; + complaint_issued = true; putc ('\n', stderr); fflush (stderr); } @@ -164,7 +164,7 @@ complain (const char *message, ...) vfprintf (stderr, message, args); va_end (args); - ++complain_message_count; + complaint_issued = true; putc ('\n', stderr); fflush (stderr); } @@ -188,7 +188,7 @@ fatal_at (location_t location, const char *message, ...) va_end (args); putc ('\n', stderr); fflush (stderr); - exit (1); + exit (EXIT_FAILURE); } void @@ -206,5 +206,5 @@ fatal (const char *message, ...) va_end (args); putc ('\n', stderr); fflush (stderr); - exit (1); + exit (EXIT_FAILURE); } |