aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-winsource.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-17 12:56:39 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:41 -0600
commitc3bd716ffc20cada32e8a18a209638b578d47f5e (patch)
treea3b5f316344b173b61903b7b9d19998716e22914 /gdb/tui/tui-winsource.c
parent21c32dca764039afd3517954f6dd0a23d0c9e16c (diff)
downloadgdb-c3bd716ffc20cada32e8a18a209638b578d47f5e.zip
gdb-c3bd716ffc20cada32e8a18a209638b578d47f5e.tar.gz
gdb-c3bd716ffc20cada32e8a18a209638b578d47f5e.tar.bz2
Remove tui_scroll_direction enum
The tui_scroll_direction enum is not really needed, because it's simple to adapt the various scrolling methods to use the sign of their argument as the direction in which to scroll. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_source_window_base::do_scroll_horizontal): Remove direction parameter. * tui/tui-windata.c (tui_data_window::do_scroll_vertical): Remove direction parameter. * tui/tui-win.c (tui_win_info::forward_scroll) (tui_win_info::backward_scroll, tui_win_info::left_scroll) (tui_win_info::right_scroll): Update. * tui/tui-source.c (tui_source_window::do_scroll_vertical): Remove direction parameter. * tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Remove direction parameter. * tui/tui-data.h (enum tui_scroll_direction): Remove. (struct tui_win_info) <do_scroll_vertical, do_scroll_horizontal>: Remove direction parameter. (struct tui_source_window_base, struct tui_source_window) (struct tui_disasm_window, struct tui_data_window) (struct tui_cmd_window): Update.
Diffstat (limited to 'gdb/tui/tui-winsource.c')
-rw-r--r--gdb/tui/tui-winsource.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index e55ce40..e56fbcb 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -332,21 +332,13 @@ tui_source_window_base::refill ()
/* Scroll the source forward or backward horizontally. */
void
-tui_source_window_base::do_scroll_horizontal
- (enum tui_scroll_direction direction, int num_to_scroll)
+tui_source_window_base::do_scroll_horizontal (int num_to_scroll)
{
if (content != NULL)
{
- int offset;
-
- if (direction == LEFT_SCROLL)
- offset = horizontal_offset + num_to_scroll;
- else
- {
- offset = horizontal_offset - num_to_scroll;
- if (offset < 0)
- offset = 0;
- }
+ int offset = horizontal_offset + num_to_scroll;
+ if (offset < 0)
+ offset = 0;
horizontal_offset = offset;
refill ();
}