]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Simplify tui_data_win::erase_data_content
authorTom Tromey <tom@tromey.com>
Sun, 17 Dec 2023 18:37:35 +0000 (11:37 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 8 Feb 2024 19:16:07 +0000 (12:16 -0700)
There's only a single call to tui_data_win::erase_data_content now, so
remove the parameter and make it just render the "empty window" text.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/tui/tui-regs.c
gdb/tui/tui-regs.h

index 52cf6b7efdfb64bf53bf2df4b497848d22520e28..10d9bc6ef7d5029e097a42d22caf9ff0f94e4ef1 100644 (file)
@@ -347,21 +347,19 @@ tui_data_window::first_data_item_displayed ()
 }
 
 void
-tui_data_window::erase_data_content (const char *prompt)
+tui_data_window::erase_data_content ()
 {
   werase (handle.get ());
   check_and_display_highlight_if_needed ();
-  if (prompt != NULL)
-    {
-      int half_width = (width - box_size ()) / 2;
-      int x_pos;
 
-      if (strlen (prompt) >= half_width)
-       x_pos = 1;
-      else
-       x_pos = half_width - strlen (prompt);
-      display_string (height / 2, x_pos, prompt);
-    }
+  const char *prompt = _("[ Register Values Unavailable ]");
+  int half_width = (width - box_size ()) / 2;
+  int x_pos;
+  if (strlen (prompt) >= half_width)
+    x_pos = 1;
+  else
+    x_pos = half_width - strlen (prompt);
+  display_string (height / 2, x_pos, prompt);
 }
 
 /* See tui-regs.h.  */
@@ -370,7 +368,7 @@ void
 tui_data_window::rerender ()
 {
   if (m_regs_content.empty ())
-    erase_data_content (_("[ Register Values Unavailable ]"));
+    erase_data_content ();
   else
     display_registers_from (0);
   tui_wrefresh (handle.get ());
index 7f1c30ca5d6be4c3b75e85603d03130939002452..880f360bec68d4800081c3d9807fc2d90129354f 100644 (file)
@@ -130,7 +130,7 @@ private:
      past the register area (-1) is returned.  */
   int first_reg_element_no_inline (int line_no) const;
 
-  void erase_data_content (const char *prompt);
+  void erase_data_content ();
 
   /* Information about each register in the current register group.  */
   std::vector<tui_register_info> m_regs_content;