public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 2/3] Remove LA_PRINT_CHAR
Date: Thu, 10 Feb 2022 16:31:51 -0700	[thread overview]
Message-ID: <20220210233152.2181913-3-tom@tromey.com> (raw)
In-Reply-To: <20220210233152.2181913-1-tom@tromey.com>

This removes the LA_PRINT_CHAR macro, in favor of using ordinary
method calls.
---
 gdb/ada-valprint.c | 2 +-
 gdb/c-valprint.c   | 3 ++-
 gdb/language.h     | 2 --
 gdb/typeprint.c    | 2 +-
 gdb/valprint.c     | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index adab6b42f5b..a59c392bef4 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -402,7 +402,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
       break;
 
     case TYPE_CODE_CHAR:
-      LA_PRINT_CHAR (val, type, stream);
+      current_language->printchar (val, type, stream);
       break;
 
     case TYPE_CODE_BOOL:
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index fadbc5b7022..047e5687b0a 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -409,7 +409,8 @@ c_value_print_int (struct value *val, struct ui_file *stream,
       if (c_textual_element_type (type, options->format))
 	{
 	  fputs_filtered (" ", stream);
-	  LA_PRINT_CHAR (unpack_long (type, valaddr), type, stream);
+	  current_language->printchar (unpack_long (type, valaddr), type,
+				       stream);
 	}
     }
 }
diff --git a/gdb/language.h b/gdb/language.h
index 3930f5bd223..4eb414bbe12 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -755,8 +755,6 @@ extern enum language set_language (enum language);
    the current setting of working_lang, which the user sets
    with the "set language" command.  */
 
-#define LA_PRINT_CHAR(ch, type, stream) \
-  (current_language->printchar (ch, type, stream))
 #define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \
   (current_language->printstr (stream, elttype, string, length, \
 			       encoding, force_ellipses,options))
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index c15a9c6b59f..8cb34ad1921 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -647,7 +647,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
       break;
 
     case TYPE_CODE_CHAR:
-      LA_PRINT_CHAR ((unsigned char) val, type, stream);
+      current_language->printchar ((unsigned char) val, type, stream);
       break;
 
     case TYPE_CODE_BOOL:
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 25e4a8dc8e1..07bc324be5d 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -791,7 +791,7 @@ generic_value_print_char (struct value *value, struct ui_file *stream,
       else
 	fprintf_filtered (stream, "%d", (int) val);
       fputs_filtered (" ", stream);
-      LA_PRINT_CHAR (val, unresolved_type, stream);
+      current_language->printchar (val, unresolved_type, stream);
     }
 }
 
-- 
2.31.1


  parent reply	other threads:[~2022-02-10 23:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 23:31 [PATCH 0/3] Remove remaining LA_* macros Tom Tromey
2022-02-10 23:31 ` [PATCH 1/3] Remove LA_PRINT_TYPE Tom Tromey
2022-02-10 23:31 ` Tom Tromey [this message]
2022-02-10 23:31 ` [PATCH 3/3] Remove LA_PRINT_STRING Tom Tromey
2022-02-11  1:18 ` [PATCH 0/3] Remove remaining LA_* macros Simon Marchi

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=20220210233152.2181913-3-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).