Remove tui_gen_win_info::viewport_height
authorTom Tromey <tom@tromey.com>
Sat, 21 Dec 2019 17:35:59 +0000 (10:35 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 27 Dec 2019 16:33:36 +0000 (09:33 -0700)
tui_gen_win_info::viewport_height is only used in a couple of spots,
and is redundant with "height".  This patch removes viewport_height.

gdb/ChangeLog
2019-12-27  Tom Tromey  <tom@tromey.com>

* tui/tui-source.c (tui_source_window::maybe_update): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from):
Update.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-data.h (struct tui_gen_win_info) <viewport_height>:
Remove.
* tui/tui-command.c (tui_cmd_window::resize): Update.

Change-Id: I020e026fbe289adda8e2fdfebca91bdbdbc312e8

gdb/ChangeLog
gdb/tui/tui-command.c
gdb/tui/tui-data.h
gdb/tui/tui-layout.c
gdb/tui/tui-regs.c
gdb/tui/tui-source.c

index 8600e2ee19ecbc0de118bd75e987316dfaae6fc1..ee11a3f6e1f072bd5dd6bba7027838f563f825eb 100644 (file)
@@ -1,3 +1,13 @@
+2019-12-27  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-source.c (tui_source_window::maybe_update): Update.
+       * tui/tui-regs.c (tui_data_window::display_registers_from):
+       Update.
+       * tui/tui-layout.c (tui_gen_win_info::resize): Update.
+       * tui/tui-data.h (struct tui_gen_win_info) <viewport_height>:
+       Remove.
+       * tui/tui-command.c (tui_cmd_window::resize): Update.
+
 2019-12-26  Christian Biesinger  <cbiesinger@google.com>
 
        * ada-lang.c (ada_decode_symbol): Update.
index e4c3a1b749161298a057a9e83339793951222d38..5f676b2e6593b164143afeb834deeff5029adab4 100644 (file)
@@ -42,14 +42,6 @@ tui_cmd_window::resize (int height_, int width_, int origin_x, int origin_y)
 {
   width = width_;
   height = height_;
-  if (height > 1)
-    {
-      /* Note this differs from the base class implementation, because
-        this window can't be boxed.  */
-      viewport_height = height - 1;
-    }
-  else
-    viewport_height = 1;
   x = origin_x;
   y = origin_y;
 
index a0e296fa68c5ed2480c7c8c1c23b7a652c1122c2..2a822487fcef89b2e3d5b11736d852a130615a32 100644 (file)
@@ -110,8 +110,6 @@ public:
   /* Origin of window.  */
   int x = 0;
   int y = 0;
-  /* Viewport height.  */
-  int viewport_height = 0;
 };
 
 /* Constant definitions.  */
index 9ab89a87fa4154bfa3d7eff7b957aa8dd1265e0f..bd2e6aee651787d33a817eacf8bc51209f1a1f42 100644 (file)
@@ -373,10 +373,6 @@ tui_gen_win_info::resize (int height_, int width_,
 
   width = width_;
   height = height_;
-  if (height > 1)
-    viewport_height = height - 2;
-  else
-    viewport_height = 1;
   x = origin_x_;
   y = origin_y_;
 
index 1d936f712b6e95406cfca45e60d0f93b0ddd6676..85c7a31b0b692bcded7eef030d159a93716aaceb 100644 (file)
@@ -266,8 +266,7 @@ tui_data_window::display_registers_from (int start_element_no)
   /* Now create each data "sub" window, and write the display into
      it.  */
   cur_y = 1;
-  while (i < m_regs_content.size ()
-        && cur_y <= viewport_height)
+  while (i < m_regs_content.size () && cur_y <= height - 2)
     {
       for (j = 0;
           j < m_regs_column_count && i < m_regs_content.size ();
index 0728263b8c5f180fdc5b425473d80861774baf7a..2d8ecee74731c395a5b9a11293e60dce49fb1106 100644 (file)
@@ -193,7 +193,7 @@ tui_source_window::line_is_displayed (int line) const
 void
 tui_source_window::maybe_update (struct frame_info *fi, symtab_and_line sal)
 {
-  int start_line = (sal.line - (viewport_height / 2)) + 1;
+  int start_line = (sal.line - ((height - 2) / 2)) + 1;
   if (start_line <= 0)
     start_line = 1;
 
This page took 0.036608 seconds and 4 git commands to generate.