diff options
author | Gabriel Dos Reis <gdr@codesourcery.com> | 2000-09-06 18:43:35 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2000-09-06 18:43:35 +0000 |
commit | e65130238972b658dabb12bf569e5ed8dd316948 (patch) | |
tree | 16f3efac73c54ac9d4bfcc86c3e390ff99b00405 /gcc/diagnostic.c | |
parent | 112c7aeab151b463751a3b7ea085f4080c7ce83a (diff) | |
download | gcc-e65130238972b658dabb12bf569e5ed8dd316948.tar.gz |
toplev.c (display_help): Fix thinko in documentation.
* toplev.c (display_help): Fix thinko in documentation.
* diagnostic.h (output_buffer::indent_skip): New fields.
(output_indentation): New macro.
* diagnostic.c (output_indent): New function.
(output_set_prefix, clear_diagnostic_info): Use.
(output_emit_prefix): Predict future indentation.
From-SVN: r36205
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 075f439a0e2..afb25c1ef3b 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -67,6 +67,7 @@ static void output_do_verbatim PARAMS ((output_buffer *, const char *, va_list *)); static void output_to_stream PARAMS ((output_buffer *, FILE *)); static void output_format PARAMS ((output_buffer *)); +static void output_indent PARAMS ((output_buffer *)); static char *vbuild_message_string PARAMS ((const char *, va_list)); static char *build_message_string PARAMS ((const char *, ...)) @@ -267,6 +268,7 @@ output_set_prefix (buffer, prefix) output_prefix (buffer) = prefix; set_real_maximum_length (buffer); prefix_was_emitted_for (buffer) = 0; + output_indentation (buffer) = 0; } /* Free BUFFER's prefix, a previously malloc'd string. */ @@ -301,6 +303,7 @@ clear_diagnostic_info (buffer) output_buffer_text_cursor (buffer) = NULL; output_buffer_ptr_to_format_args (buffer) = NULL; prefix_was_emitted_for (buffer) = 0; + output_indentation (buffer) = 0; } /* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH @@ -395,8 +398,12 @@ output_emit_prefix (buffer) case DIAGNOSTICS_SHOW_PREFIX_ONCE: if (prefix_was_emitted_for (buffer)) - break; - /* Else fall through. */ + { + output_indent (buffer); + break; + } + output_indentation (buffer) += 3; + /* Fall through. */ case DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: { @@ -549,6 +556,17 @@ output_append (buffer, start, end) output_append_r (buffer, start, end - start); } +static void +output_indent (buffer) + output_buffer *buffer; +{ + int n = output_indentation (buffer); + int i; + + for (i = 0; i < n; ++i) + output_add_character (buffer, ' '); +} + /* Wrap a text delimited by START and END into BUFFER. */ static void |