summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-27 18:03:03 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-27 18:03:03 +0000
commit910f6d8fb59a077e0d9e3270d609b34cb12e0208 (patch)
tree31587bd16906560e230a3ecb24be524cab04216a /gcc/diagnostic.c
parentddcade82ba2f7dd608afb8af75eeb65b81b5cb6a (diff)
downloadgcc-910f6d8fb59a077e0d9e3270d609b34cb12e0208.tar.gz
2001-06-27 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.h: Add documentation. Make macros polymorphic. * diagnostic.c (ideal_line_wrap_cutoff): Remove definition. Replace with diagnostic_line_cutoff. (prefixing_policy): Remove. Replace with diagnostic_prefixing_rule. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43616 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c3ab80c0f49..c306355ff25 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -52,9 +52,7 @@ Boston, MA 02111-1307, USA. */
#define is_starting_newline(BUFFER) (output_text_length (BUFFER) == 0)
#define output_prefix(BUFFER) (BUFFER)->state.prefix
#define line_wrap_cutoff(BUFFER) (BUFFER)->state.maximum_length
-#define ideal_line_wrap_cutoff(BUFFER) (BUFFER)->state.ideal_maximum_length
#define prefix_was_emitted_for(BUFFER) (BUFFER)->state.emitted_prefix_p
-#define prefixing_policy(BUFFER) (BUFFER)->state.prefixing_rule
#define output_buffer_ptr_to_format_args(BUFFER) (BUFFER)->state.format_args
#define diagnostic_args output_buffer_ptr_to_format_args (diagnostic_buffer)
@@ -189,7 +187,7 @@ int
output_is_line_wrapping (buffer)
output_buffer *buffer;
{
- return ideal_line_wrap_cutoff (buffer) > 0;
+ return diagnostic_line_cutoff (buffer) > 0;
}
/* Return BUFFER's prefix. */
@@ -212,19 +210,19 @@ set_real_maximum_length (buffer)
we'll emit prefix only once per diagnostic message, it is appropriate
not to increase unncessarily the line-length cut-off. */
if (! output_is_line_wrapping (buffer)
- || prefixing_policy (buffer) == DIAGNOSTICS_SHOW_PREFIX_ONCE
- || prefixing_policy (buffer) == DIAGNOSTICS_SHOW_PREFIX_NEVER)
- line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer);
+ || diagnostic_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_ONCE
+ || diagnostic_prefixing_rule (buffer) == DIAGNOSTICS_SHOW_PREFIX_NEVER)
+ line_wrap_cutoff (buffer) = diagnostic_line_cutoff (buffer);
else
{
int prefix_length =
output_prefix (buffer) ? strlen (output_prefix (buffer)) : 0;
/* If the prefix is ridiculously too long, output at least
32 characters. */
- if (ideal_line_wrap_cutoff (buffer) - prefix_length < 32)
- line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer) + 32;
+ if (diagnostic_line_cutoff (buffer) - prefix_length < 32)
+ line_wrap_cutoff (buffer) = diagnostic_line_cutoff (buffer) + 32;
else
- line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer);
+ line_wrap_cutoff (buffer) = diagnostic_line_cutoff (buffer);
}
}
@@ -236,7 +234,7 @@ output_set_maximum_length (buffer, length)
output_buffer *buffer;
int length;
{
- ideal_line_wrap_cutoff (buffer) = length;
+ diagnostic_line_cutoff (buffer) = length;
set_real_maximum_length (buffer);
}
@@ -313,8 +311,8 @@ init_output_buffer (buffer, prefix, maximum_length)
memset (buffer, 0, sizeof (output_buffer));
obstack_init (&buffer->obstack);
output_buffer_attached_stream (buffer) = stderr;
- ideal_line_wrap_cutoff (buffer) = maximum_length;
- prefixing_policy (buffer) = diagnostic_prefixing_rule (global_dc);
+ diagnostic_line_cutoff (buffer) = maximum_length;
+ diagnostic_prefixing_rule (buffer) = diagnostic_prefixing_rule (global_dc);
output_set_prefix (buffer, prefix);
output_text_length (buffer) = 0;
clear_diagnostic_info (buffer);
@@ -366,7 +364,7 @@ output_emit_prefix (buffer)
{
if (output_prefix (buffer) != NULL)
{
- switch (prefixing_policy (buffer))
+ switch (diagnostic_prefixing_rule (buffer))
{
default:
case DIAGNOSTICS_SHOW_PREFIX_NEVER:
@@ -1559,7 +1557,7 @@ output_do_verbatim (buffer, msgid, args_ptr)
os = output_buffer_state (buffer);
output_prefix (buffer) = NULL;
- prefixing_policy (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
+ diagnostic_prefixing_rule (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
output_buffer_text_cursor (buffer) = _(msgid);
output_buffer_ptr_to_format_args (buffer) = args_ptr;
output_set_maximum_length (buffer, 0);