gdb/amd64: clean up unused variable
[binutils-gdb.git] / gdb / cli-out.c
index a7fcc6238975e94c9bfe750cb663244a45cde66a..fdbed6f5e91feb2d1950d38880ef6744e93ad55b 100644 (file)
@@ -171,10 +171,10 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align,
 
   if (string)
     {
-      if (test_flags (unfiltered_output))
-       fputs_styled_unfiltered (string, style, m_streams.back ());
-      else
-       fputs_styled (string, style, m_streams.back ());
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
+      stream->puts (string);
+      stream->emit_style_escape (ui_file_style ());
     }
 
   if (after)
@@ -205,10 +205,7 @@ cli_ui_out::do_spaces (int numspaces)
   if (m_suppress_output)
     return;
 
-  if (test_flags (unfiltered_output))
-    fprintf_unfiltered (m_streams.back (), "%*s", numspaces, "");
-  else
-    print_spaces_filtered (numspaces, m_streams.back ());
+  print_spaces (numspaces, m_streams.back ());
 }
 
 void
@@ -217,10 +214,7 @@ cli_ui_out::do_text (const char *string)
   if (m_suppress_output)
     return;
 
-  if (test_flags (unfiltered_output))
-    fputs_unfiltered (string, m_streams.back ());
-  else
-    fputs_filtered (string, m_streams.back ());
+  gdb_puts (string, m_streams.back ());
 }
 
 void
@@ -233,10 +227,10 @@ cli_ui_out::do_message (const ui_file_style &style,
   std::string str = string_vprintf (format, args);
   if (!str.empty ())
     {
-      if (test_flags (unfiltered_output))
-       fputs_styled_unfiltered (str.c_str (), style, m_streams.back ());
-      else
-       fputs_styled (str.c_str (), style, m_streams.back ());
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
+      stream->puts (str.c_str ());
+      stream->emit_style_escape (ui_file_style ());
     }
 }
 
@@ -289,7 +283,7 @@ cli_ui_out::do_progress_start (const std::string &name, bool should_print)
   meter.name = name;
   if (!stream->isatty ())
     {
-      fprintf_unfiltered (stream, "%s...", meter.name.c_str ());
+      gdb_printf (stream, "%s...", meter.name.c_str ());
       gdb_flush (stream);
       meter.printing = WORKING;
     }
@@ -316,7 +310,7 @@ cli_ui_out::do_progress_notify (double howmuch)
 
   if (meter.printing == START)
     {
-      fprintf_unfiltered (stream, "%s\n", meter.name.c_str ());
+      gdb_printf (stream, "%s\n", meter.name.c_str ());
       gdb_flush (stream);
       meter.printing = WORKING;
     }
@@ -334,10 +328,10 @@ cli_ui_out::do_progress_notify (double howmuch)
       int width = chars_per_line - 3;
 
       max = width * howmuch;
-      fprintf_unfiltered (stream, "\r[");
+      gdb_printf (stream, "\r[");
       for (i = 0; i < width; ++i)
-       fprintf_unfiltered (stream, i < max ? "#" : " ");
-      fprintf_unfiltered (stream, "]");
+       gdb_printf (stream, i < max ? "#" : " ");
+      gdb_printf (stream, "]");
       gdb_flush (stream);
       meter.printing = PROGRESS;
     }
@@ -351,7 +345,7 @@ cli_ui_out::do_progress_end ()
 
   if (!stream->isatty ())
     {
-      fprintf_unfiltered (stream, "\n");
+      gdb_printf (stream, "\n");
       gdb_flush (stream);
     }
   else if (meter.printing == PROGRESS)
@@ -359,10 +353,10 @@ cli_ui_out::do_progress_end ()
       int i;
       int width = get_chars_per_line () - 3;
 
-      fprintf_unfiltered (stream, "\r");
+      gdb_printf (stream, "\r");
       for (i = 0; i < width + 2; ++i)
-       fprintf_unfiltered (stream, " ");
-      fprintf_unfiltered (stream, "\r");
+       gdb_printf (stream, " ");
+      gdb_printf (stream, "\r");
       gdb_flush (stream);
     }
 
@@ -374,10 +368,7 @@ cli_ui_out::do_progress_end ()
 void
 cli_ui_out::field_separator ()
 {
-  if (test_flags (unfiltered_output))
-    fputc_unfiltered (' ', m_streams.back ());
-  else
-    fputc_filtered (' ', m_streams.back ());
+  gdb_putc (' ', m_streams.back ());
 }
 
 /* Constructor for cli_ui_out.  */
@@ -395,14 +386,6 @@ cli_ui_out::~cli_ui_out ()
 {
 }
 
-/* Initialize private members at startup.  */
-
-cli_ui_out *
-cli_out_new (struct ui_file *stream)
-{
-  return new cli_ui_out (stream, ui_source_list);
-}
-
 ui_file *
 cli_ui_out::set_stream (struct ui_file *stream)
 {