public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Introduce enum tui_box Date: Tue, 25 Jun 2019 14:01:00 -0000 [thread overview] Message-ID: <20190625140157.56818.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=17374de40e7be36e4eb27d29bb8aac89586ce4a1 commit 17374de40e7be36e4eb27d29bb8aac89586ce4a1 Author: Tom Tromey <tom@tromey.com> Date: Mon Jun 17 17:15:23 2019 -0600 Introduce enum tui_box This adds a new enum to the TUI, replacing two #define constants, providing better type safety. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_make_window): Change type of "box_it" parameter. * tui/tui-wingeneral.c (tui_make_window): Change type of "box_it" parameter. (tui_gen_win_info::make_visible): Update. * tui/tui-layout.c (init_and_make_win): Change type of "box_it" parameter. * tui/tui-data.h (enum tui_box): New enum. (BOX_WINDOW, DONT_BOX_WINDOW): Remove defines. Diff: --- gdb/ChangeLog | 12 ++++++++++++ gdb/tui/tui-data.h | 9 +++++++-- gdb/tui/tui-layout.c | 5 +++-- gdb/tui/tui-wingeneral.c | 5 +++-- gdb/tui/tui-wingeneral.h | 2 +- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index db76928..3188663 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-wingeneral.h (tui_make_window): Change type of "box_it" + parameter. + * tui/tui-wingeneral.c (tui_make_window): Change type of "box_it" + parameter. + (tui_gen_win_info::make_visible): Update. + * tui/tui-layout.c (init_and_make_win): Change type of "box_it" + parameter. + * tui/tui-data.h (enum tui_box): New enum. + (BOX_WINDOW, DONT_BOX_WINDOW): Remove defines. + +2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-layout.c (make_source_or_disasm_window): Always use init_and_make_win for EXEC_INFO_WIN. * tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>: No diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 9c45d6f..95c9161 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -91,6 +91,13 @@ struct tui_gen_win_info char *title = nullptr; }; +/* Whether or not a window should be drawn with a box. */ +enum tui_box +{ + DONT_BOX_WINDOW = 0, + BOX_WINDOW +}; + /* Constant definitions. */ #define DEFAULT_TAB_LEN 8 #define NO_SRC_STRING "[ No Source Available ]" @@ -104,8 +111,6 @@ struct tui_gen_win_info #define DISASSEM_NAME "asm" #define TUI_NULL_STR "" #define DEFAULT_HISTORY_COUNT 25 -#define BOX_WINDOW TRUE -#define DONT_BOX_WINDOW FALSE #define HILITE TRUE #define NO_HILITE FALSE #define WITH_LOCATOR TRUE diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 695fa35..6507b06 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -45,7 +45,8 @@ static void show_layout (enum tui_layout_type); static tui_gen_win_info *init_and_make_win (tui_gen_win_info *, enum tui_win_type, - int, int, int, int, int); + int, int, int, int, + enum tui_box); static void show_source_or_disasm_and_command (enum tui_layout_type); static struct tui_win_info *make_source_or_disasm_window (enum tui_win_type, int, int); @@ -793,7 +794,7 @@ init_and_make_win (tui_gen_win_info *win_info, enum tui_win_type win_type, int height, int width, int origin_x, int origin_y, - int box_it) + enum tui_box box_it) { if (win_info == NULL) { diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index acb8a26..cfa4a08 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -146,7 +146,7 @@ tui_check_and_display_highlight_if_needed (struct tui_win_info *win_info) void -tui_make_window (struct tui_gen_win_info *win_info, int box_it) +tui_make_window (struct tui_gen_win_info *win_info, enum tui_box box_it) { WINDOW *handle; @@ -175,7 +175,8 @@ tui_gen_win_info::make_visible (bool visible) { if (!is_visible) { - tui_make_window (this, !tui_win_is_auxillary (type)); + tui_make_window (this, (tui_win_is_auxillary (type) + ? DONT_BOX_WINDOW : BOX_WINDOW)); is_visible = true; } } diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h index 15e61c9..e925606 100644 --- a/gdb/tui/tui-wingeneral.h +++ b/gdb/tui/tui-wingeneral.h @@ -32,7 +32,7 @@ extern void tui_make_visible (struct tui_gen_win_info *); extern void tui_make_invisible (struct tui_gen_win_info *); extern void tui_make_all_visible (void); extern void tui_make_all_invisible (void); -extern void tui_make_window (struct tui_gen_win_info *, int); +extern void tui_make_window (struct tui_gen_win_info *, enum tui_box); extern struct tui_win_info *tui_copy_win (struct tui_win_info *); extern void tui_box_win (struct tui_gen_win_info *, int); extern void tui_highlight_win (struct tui_win_info *);
reply other threads:[~2019-06-25 14:01 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190625140157.56818.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).