[10/15] gdb/tui: make m_horizontal_offset private

Message ID fc871566cca0db31292c2786e6fed1167a64a0ca.1673000632.git.aburgess@redhat.com
State Committed
Commit 9bea9aa7d29330783541861d7498d51fbb0002c7
Series Mixed bag of TUI tests and fixes |

Commit Message

Andrew Burgess Jan. 6, 2023, 10:25 a.m. UTC
  I noticed that tui_source_window_base::m_horizontal_offset was
protected, but could be made private, so lets do that.

This makes more sense in the context of a later commit where I plan to
add another member variable that is similar to m_horizontal_offset.
The new member variable could also be private.

So I had to choose, place the new member variable next to
m_horizontal_offset making it protected, but grouping similar
variables together, or make m_horizontal_offset private, and then add
the new variable as private too.

I chose to make m_horizontal_offset private, which is this commit.

There should be no user visible changes after this commit.
 gdb/tui/tui-winsource.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 7d6d64d35c4..bf0ca96c09b 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -124,8 +124,7 @@  struct tui_source_window_base : public tui_win_info
   /* Redraw the complete line of a source or disassembly window.  */
   void show_source_line (int lineno);
-  /* Used for horizontal scroll.  */
-  int m_horizontal_offset = 0;
+  /* Where to start generating content from.  */
   struct tui_line_or_address m_start_line_or_addr;
   /* Architecture associated with code at this location.  */
@@ -179,6 +178,9 @@  struct tui_source_window_base : public tui_win_info
+  /* Used for horizontal scroll.  */
+  int m_horizontal_offset = 0;
   void show_source_content ();
   /* Called when the user "set style enabled" setting is changed.  */