From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 3/4] [gdb/tui] Merge tui border-kind corner translation tables
Date: Fri, 23 Jun 2023 13:15:35 +0200 [thread overview]
Message-ID: <20230623111536.1623-3-tdevries@suse.de> (raw)
In-Reply-To: <20230623111536.1623-1-tdevries@suse.de>
The tables:
- tui_border_kind_translate_ulcorner
- tui_border_kind_translate_urcorner
- tui_border_kind_translate_llcorner
- tui_border_kind_translate_lrcorner
are identical.
Merge and rename to tui_border_kind_translate_corner.
Tested on x86_64-linux.
---
gdb/tui/tui-win.c | 32 +++++++-------------------------
1 file changed, 7 insertions(+), 25 deletions(-)
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 1406e072c43..2cc81778f3a 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -128,8 +128,8 @@ static struct tui_translate tui_border_mode_translate[] = {
{ 0, 0 }
};
-/* Translation tables for border-kind (acs excluded), one for each border
- character (see wborder, border curses operations). */
+/* Translation tables for border-kind (acs excluded), one for vline, hline and
+ corners (see wborder, border curses operations). */
static struct tui_translate tui_border_kind_translate_vline[] = {
{ "space", ' ' },
{ "ascii", '|' },
@@ -142,25 +142,7 @@ static struct tui_translate tui_border_kind_translate_hline[] = {
{ 0, 0 }
};
-static struct tui_translate tui_border_kind_translate_ulcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { 0, 0 }
-};
-
-static struct tui_translate tui_border_kind_translate_urcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { 0, 0 }
-};
-
-static struct tui_translate tui_border_kind_translate_llcorner[] = {
- { "space", ' ' },
- { "ascii", '+' },
- { 0, 0 }
-};
-
-static struct tui_translate tui_border_kind_translate_lrcorner[] = {
+static struct tui_translate tui_border_kind_translate_corner[] = {
{ "space", ' ' },
{ "ascii", '+' },
{ 0, 0 }
@@ -287,20 +269,20 @@ tui_update_variables ()
/* If one corner changes, all characters are changed. Only check the first
one. */
- int val = translate_acs (tui_border_kind, tui_border_kind_translate_lrcorner,
+ int val = translate_acs (tui_border_kind, tui_border_kind_translate_corner,
ACS_LRCORNER);
need_redraw |= assign_return_if_changed<chtype> (tui_border_lrcorner, val);
tui_border_llcorner
- = translate_acs (tui_border_kind, tui_border_kind_translate_llcorner,
+ = translate_acs (tui_border_kind, tui_border_kind_translate_corner,
ACS_LLCORNER);
tui_border_ulcorner
- = translate_acs (tui_border_kind, tui_border_kind_translate_ulcorner,
+ = translate_acs (tui_border_kind, tui_border_kind_translate_corner,
ACS_ULCORNER);
tui_border_urcorner =
- translate_acs (tui_border_kind, tui_border_kind_translate_urcorner,
+ translate_acs (tui_border_kind, tui_border_kind_translate_corner,
ACS_URCORNER);
tui_border_hline
--
2.35.3
next prev parent reply other threads:[~2023-06-23 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 11:15 [PATCH 1/4] [gdb/tui] Remove default entries in TUI " Tom de Vries
2023-06-23 11:15 ` [PATCH 2/4] [gdb/tui] Introduce translate_acs Tom de Vries
2023-06-23 20:28 ` Tom Tromey
2023-06-23 11:15 ` Tom de Vries [this message]
2023-06-23 20:30 ` [PATCH 3/4] [gdb/tui] Merge tui border-kind corner translation tables Tom Tromey
2023-06-23 11:15 ` [PATCH 4/4] [gdb/tui] Make translate return entry->value instead of entry Tom de Vries
2023-06-23 20:30 ` Tom Tromey
2023-06-23 20:28 ` [PATCH 1/4] [gdb/tui] Remove default entries in TUI translation tables Tom Tromey
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=20230623111536.1623-3-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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: link
Be 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).