]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Make tui_register_info::highlight private
authorTom Tromey <tom@tromey.com>
Fri, 31 May 2024 20:25:09 +0000 (14:25 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 16 Jun 2024 02:54:04 +0000 (20:54 -0600)
This changes tui_register_info::highlight to be private, renaming it
to m_highlight.

gdb/tui/tui-regs.c
gdb/tui/tui-regs.h

index 43b519ac127c2047c76ddb0b3c744572fe99bf38..2be81876010fe97d7d989e9ed9341bc8b19597bd 100644 (file)
@@ -95,13 +95,13 @@ tui_register_format (const frame_info_ptr &frame, int regnum)
 }
 
 /* Compute the register value from the given frame and format it for
-   the display.  update 'content' and set 'highlight' if the contents
-   changed.  */
+   the display.  Update 'content' and set 'm_highlight' if the
+   contents changed.  */
 void
 tui_register_info::update (const frame_info_ptr &frame)
 {
   std::string new_content = tui_register_format (frame, m_regno);
-  highlight = content != new_content;
+  m_highlight = content != new_content;
   content = std::move (new_content);
 }
 
@@ -404,12 +404,11 @@ tui_data_window::check_register_values (const frame_info_ptr &frame)
        {
          for (tui_register_info &data_item_win : m_regs_content)
            {
-             bool was_hilighted = data_item_win.highlight;
+             bool was_hilighted = data_item_win.highlighted ();
 
              data_item_win.update (frame);
 
-             /* Register windows whose y == 0 are outside the visible area.  */
-             if ((data_item_win.highlight || was_hilighted)
+             if ((data_item_win.highlighted () || was_hilighted)
                  && data_item_win.visible ())
                data_item_win.rerender (handle.get (), m_item_width);
            }
@@ -418,12 +417,11 @@ tui_data_window::check_register_values (const frame_info_ptr &frame)
     }
 }
 
-/* Display a register in a window.  If hilite is TRUE, then the value
-   will be displayed in reverse video.  */
+/* Display a register in a window.  */
 void
 tui_register_info::rerender (WINDOW *handle, int field_width)
 {
-  if (highlight)
+  if (m_highlight)
     /* We ignore the return value, casting it to void in order to avoid
        a compiler warning.  The warning itself was introduced by a patch
        to ncurses 5.7 dated 2009-08-29, changing this macro to expand
@@ -435,7 +433,7 @@ tui_register_info::rerender (WINDOW *handle, int field_width)
   if (content.size () < field_width)
     waddstr (handle, n_spaces (field_width - content.size ()));
 
-  if (highlight)
+  if (m_highlight)
     /* We ignore the return value, casting it to void in order to avoid
        a compiler warning.  The warning itself was introduced by a patch
        to ncurses 5.7 dated 2009-08-29, changing this macro to expand
index 69ba10724e7c2f325ca9d3e1e8fb995656c975f4..61bfdd20d6f57d209fdafb0e8af26a91fe3a7272 100644 (file)
@@ -34,7 +34,6 @@ struct tui_register_info
     : m_regno (regno)
   {
     update (frame);
-    highlight = false;
   }
 
   DISABLE_COPY_AND_ASSIGN (tui_register_info);
@@ -48,14 +47,19 @@ struct tui_register_info
   bool visible () const
   { return y > 0; }
 
+  bool highlighted () const
+  { return m_highlight; }
+
   /* Location.  */
   int x = 0;
   int y = 0;
-  bool highlight = false;
   std::string content;
 
 private:
 
+  /* True if currently highlighted.  */
+  bool m_highlight = false;
+
   /* The register number.  */
   const int m_regno;
 };