From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/6] Remove LS_TOKEN_KEYWORD macro
Date: Thu, 06 Jun 2024 08:45:48 -0600 [thread overview]
Message-ID: <20240606-linespec-no-macros-v1-5-a748ab917e12@adacore.com> (raw)
In-Reply-To: <20240606-linespec-no-macros-v1-0-a748ab917e12@adacore.com>
This removes the LS_TOKEN_KEYWORD macro from linespec.c.
---
gdb/linespec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gdb/linespec.c b/gdb/linespec.c
index b85d57c13c2..3db00300a58 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -276,7 +276,6 @@ struct linespec_token
};
#define LS_TOKEN_STOKEN(TOK) (TOK).data.string
-#define LS_TOKEN_KEYWORD(TOK) (TOK).data.keyword
/* An instance of the linespec parser. */
@@ -572,7 +571,7 @@ copy_token_string (linespec_token token)
const char *str, *s;
if (token.type == LSTOKEN_KEYWORD)
- return make_unique_xstrdup (LS_TOKEN_KEYWORD (token));
+ return make_unique_xstrdup (token.data.keyword);
str = LS_TOKEN_STOKEN (token).ptr;
s = remove_trailing_whitespace (str, str + LS_TOKEN_STOKEN (token).length);
@@ -905,7 +904,7 @@ linespec_lexer_lex_one (linespec_parser *parser)
if (keyword != NULL)
{
parser->lexer.current.type = LSTOKEN_KEYWORD;
- LS_TOKEN_KEYWORD (parser->lexer.current) = keyword;
+ parser->lexer.current.data.keyword = keyword;
/* We do not advance the stream here intentionally:
we would like lexing to stop when a keyword is seen.
--
2.44.0
next prev parent reply other threads:[~2024-06-06 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 14:45 [PATCH 0/6] Remove accessor macros from linespec.c Tom Tromey
2024-06-06 14:45 ` [PATCH 1/6] Remove PARSER_STATE macro Tom Tromey
2024-06-06 14:45 ` [PATCH 2/6] Remove PARSER_RESULT macro Tom Tromey
2024-06-06 14:45 ` [PATCH 3/6] Remove PARSER_EXPLICIT macro Tom Tromey
2024-06-06 14:45 ` [PATCH 4/6] Remove PARSER_STREAM macro Tom Tromey
2024-06-06 14:45 ` Tom Tromey [this message]
2024-06-06 14:45 ` [PATCH 6/6] Remove LS_TOKEN_STOKEN macro Tom Tromey
2024-06-12 16:03 ` [PATCH 0/6] Remove accessor macros from linespec.c Keith Seitz
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=20240606-linespec-no-macros-v1-5-a748ab917e12@adacore.com \
--to=tromey@adacore.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).