From b5dd2c76f8df15a148f5f40e7f4894b22dae04d0 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Thu, 28 Sep 2000 12:50:37 +0000 Subject: [PATCH] diagnostic.h (output_clear_message_text): New function. * diagnostic.h (output_clear_message_text): New function. (output_message_text): New macro. * diagnostic.c (clear_text_info): Rename to output_clear_message_text. (output_clear): Adjust. (output_finish): Rename to output_finalize_message. Tweek. (output_to_stream): Adjust. From-SVN: r36658 --- gcc/ChangeLog | 11 +++++++++++ gcc/diagnostic.c | 15 +++++++-------- gcc/diagnostic.h | 5 ++++- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1e9439..3cbe478 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2000-09-28 Gabriel Dos Reis + + * diagnostic.h (output_clear_message_text): New function. + (output_message_text): New macro. + + * diagnostic.c (clear_text_info): Rename to + output_clear_message_text. + (output_clear): Adjust. + (output_finish): Rename to output_finalize_message. Tweek. + (output_to_stream): Adjust. + 2000-09-28 Neil Booth * cpperror.c (_cpp_begin_message): Do the test for suppression diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 687375f..3884edd 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -93,7 +93,6 @@ static void output_append_r PARAMS ((output_buffer *, const char *, int)); static void wrap_text PARAMS ((output_buffer *, const char *, const char *)); static void maybe_wrap_text PARAMS ((output_buffer *, const char *, const char *)); -static void clear_text_info PARAMS ((output_buffer *)); static void clear_diagnostic_info PARAMS ((output_buffer *)); static void default_diagnostic_starter PARAMS ((output_buffer *, @@ -303,8 +302,8 @@ output_destroy_prefix (buffer) /* Zero out any text output so far in BUFFER. */ -static void -clear_text_info (buffer) +void +output_clear_message_text (buffer) output_buffer *buffer; { obstack_free (&buffer->obstack, obstack_base (&buffer->obstack)); @@ -367,7 +366,7 @@ void output_clear (buffer) output_buffer *buffer; { - clear_text_info (buffer); + output_clear_message_text (buffer); clear_diagnostic_info (buffer); } @@ -375,11 +374,11 @@ output_clear (buffer) the BUFFERed message. */ const char * -output_finish (buffer) +output_finalize_message (buffer) output_buffer *buffer; { obstack_1grow (&buffer->obstack, '\0'); - return (const char *) obstack_finish (&buffer->obstack); + return output_message_text (buffer); } void @@ -652,9 +651,9 @@ output_to_stream (buffer, file) output_buffer *buffer; FILE *file; { - const char *text = output_finish (buffer); + const char *text = output_finalize_message (buffer); fputs (text, file); - clear_text_info (buffer); + output_clear_message_text (buffer); } /* Format a message pointed to by output_buffer_text_cursor (BUFFER) using diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 8748929..6d693fc 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -93,6 +93,8 @@ struct output_buffer #define output_needs_newline(BUFFER) (BUFFER)->state.need_newline_p #define output_buffer_state(BUFFER) (BUFFER)->state #define output_indentation(BUFFER) (BUFFER)->state.indent_skip +#define output_message_text(BUFFER) \ + ((const char *) obstack_base (&(BUFFER)->obstack)) /* This data structure bundles altogether any information relevent to the context of a diagnostic message. */ @@ -189,7 +191,8 @@ void output_append PARAMS ((output_buffer *, const char *, void output_add_character PARAMS ((output_buffer *, int)); void output_decimal PARAMS ((output_buffer *, int)); void output_add_string PARAMS ((output_buffer *, const char *)); -const char *output_finish PARAMS ((output_buffer *)); +const char *output_finalize_message PARAMS ((output_buffer *)); +void output_clear_message_text PARAMS ((output_buffer *)); void output_printf PARAMS ((output_buffer *, const char *, ...)) ATTRIBUTE_PRINTF_2; int output_is_line_wrapping PARAMS ((output_buffer *)); -- 2.7.4