From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 01/11] Use complete_on_enum in tui_reggroup_completer
Date: Wed, 17 Jun 2020 20:15:13 -0600 [thread overview]
Message-ID: <20200618021523.10681-2-tom@tromey.com> (raw)
In-Reply-To: <20200618021523.10681-1-tom@tromey.com>
tui_reggroup_completer has an "XXXX" comment suggesting the use of
complete_on_enum. This patch implements this suggestion.
2020-06-14 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reggroup_completer): Use complete_on_enum.
---
gdb/ChangeLog | 4 ++++
gdb/tui/tui-regs.c | 11 ++---------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index d33f0aadef8..b99e29972de 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -631,18 +631,11 @@ tui_reggroup_completer (struct cmd_list_element *ignore,
completion_tracker &tracker,
const char *text, const char *word)
{
- static const char *extra[] = { "next", "prev", NULL };
- size_t len = strlen (word);
- const char **tmp;
+ static const char * const extra[] = { "next", "prev", NULL };
reggroup_completer (ignore, tracker, text, word);
- /* XXXX use complete_on_enum instead? */
- for (tmp = extra; *tmp != NULL; ++tmp)
- {
- if (strncmp (word, *tmp, len) == 0)
- tracker.add_completion (make_unique_xstrdup (*tmp));
- }
+ complete_on_enum (tracker, extra, text, word);
}
void _initialize_tui_regs ();
--
2.17.2
next prev parent reply other threads:[~2020-06-18 2:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 2:15 [PATCH 00/11] TUI cleanups Tom Tromey
2020-06-18 2:15 ` Tom Tromey [this message]
2020-06-18 2:15 ` [PATCH 02/11] Remove tui_expand_tabs Tom Tromey
2020-06-18 2:15 ` [PATCH 03/11] Move some code out of tui-data.h Tom Tromey
2020-06-18 2:15 ` [PATCH 04/11] Remove tui_data_window::name Tom Tromey
2020-06-18 2:15 ` [PATCH 05/11] Remove useless "if' from tui-regs.c Tom Tromey
2020-06-18 2:15 ` [PATCH 06/11] Rename tui_data_item_window::item_no Tom Tromey
2020-06-18 2:15 ` [PATCH 07/11] Don't derive tui_data_item_window from tui_gen_win_info Tom Tromey
2020-06-18 2:15 ` [PATCH 08/11] Remove body of tui_locator_window constructor Tom Tromey
2020-06-18 2:15 ` [PATCH 09/11] Derive tui_locator_window from tui_win_info Tom Tromey
2020-09-20 0:58 ` Simon Marchi
2020-06-18 2:15 ` [PATCH 10/11] Remove tui_gen_win_info Tom Tromey
2020-06-18 2:15 ` [PATCH 11/11] Make tui_win_info::name pure virtual Tom Tromey
2020-07-02 3:24 ` [PATCH 00/11] TUI cleanups 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=20200618021523.10681-2-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@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: 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).