]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove ui_file::reset_style
authorTom Tromey <tom@tromey.com>
Wed, 9 Apr 2025 23:34:10 +0000 (17:34 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 22 Apr 2025 15:05:14 +0000 (09:05 -0600)
ui_file::reset_style doesn't seem to be needed.  This patch removes
it.  Regression tested on x86-64 Fedora 40.

gdb/cli/cli-cmds.c
gdb/pager.h
gdb/printcmd.c
gdb/ui-file.c
gdb/ui-file.h
gdb/utils.c

index 7e13ef8062a08d415d83aab14ae283e3a9631375..9a5021f9d089def3743d9a0e26b249c5db14bccf 100644 (file)
@@ -833,7 +833,7 @@ echo_command (const char *text, int from_tty)
          gdb_printf ("%c", c);
       }
 
-  gdb_stdout->reset_style ();
+  gdb_stdout->emit_style_escape (ui_file_style ());
 
   /* Force this output to appear now.  */
   gdb_flush (gdb_stdout);
index 3c4fcdfd08f748422552e1eb84ea8a90a476567c..052337d976eeb9d374fcb967b3db85d021df255c 100644 (file)
@@ -50,7 +50,6 @@ public:
   }
 
   void emit_style_escape (const ui_file_style &style) override;
-  void reset_style () override;
 
   void flush () override;
 
index e8be470e21109e56a22dc1bd07f69b946ee3dbe8..2be5eaa15a20dc231ad380e7fd07f60fd541a946 100644 (file)
@@ -2883,7 +2883,7 @@ static void
 printf_command (const char *arg, int from_tty)
 {
   ui_printf (arg, gdb_stdout);
-  gdb_stdout->reset_style ();
+  gdb_stdout->emit_style_escape (ui_file_style ());
   gdb_stdout->wrap_here (0);
   gdb_stdout->flush ();
 }
index 09e8b0b1d2019d26e44c7852016ba7e024fd8766..f86b6b171f24048320b06c97dc65708057b941f6 100644 (file)
@@ -87,18 +87,6 @@ ui_file::emit_style_escape (const ui_file_style &style)
 
 /* See ui-file.h.  */
 
-void
-ui_file::reset_style ()
-{
-  if (can_emit_style_escape ())
-    {
-      m_applied_style = ui_file_style ();
-      this->puts (m_applied_style.to_ansi ().c_str ());
-    }
-}
-
-/* See ui-file.h.  */
-
 void
 ui_file::printchar (int c, int quoter, bool async_safe)
 {
index 351cf1f574747f9f338460ef96013a208c3d152c..3919e528da91247b192defac6f0e53c533fc5aa7 100644 (file)
@@ -123,9 +123,6 @@ public:
   /* Emit an ANSI style escape for STYLE.  */
   virtual void emit_style_escape (const ui_file_style &style);
 
-  /* Rest the current output style to the empty style.  */
-  virtual void reset_style ();
-
   /* Print STR, bypassing any paging that might be done by this
      ui_file.  Note that nearly no code should call this -- it's
      intended for use by gdb_printf, but nothing else.  */
@@ -353,12 +350,6 @@ public:
     m_two->emit_style_escape (style);
   }
 
-  void reset_style () override
-  {
-    m_one->reset_style ();
-    m_two->reset_style ();
-  }
-
   void puts_unfiltered (const char *str) override
   {
     m_one->puts_unfiltered (str);
@@ -389,10 +380,6 @@ public:
   void emit_style_escape (const ui_file_style &style) override
   {
   }
-
-  void reset_style () override
-  {
-  }
 };
 
 /* A base class for ui_file types that wrap another ui_file.  */
@@ -419,10 +406,6 @@ public:
   void emit_style_escape (const ui_file_style &style) override
   { m_stream->emit_style_escape (style); }
 
-  /* Rest the current output style to the empty style.  */
-  void reset_style () override
-  { m_stream->reset_style (); }
-
   int fd () const override
   { return m_stream->fd (); }
 
index 986b90699e99e616848ccfd8e52fadc67d11ff28..ce3c26ef1402e99303f4a53e55824e7c7fb03604 100644 (file)
@@ -1407,18 +1407,6 @@ pager_file::emit_style_escape (const ui_file_style &style)
     }
 }
 
-/* See pager.h.  */
-
-void
-pager_file::reset_style ()
-{
-  if (can_emit_style_escape ())
-    {
-      m_applied_style = ui_file_style ();
-      m_wrap_buffer.append (m_applied_style.to_ansi ());
-    }
-}
-
 /* Wait, so the user can read what's on the screen.  Prompt the user
    to continue by pressing RETURN.  'q' is also provided because
    telling users what to do in the prompt is more user-friendly than