public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Remove unused parameter from generic_val_print_float
@ 2020-06-07 14:24 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2020-06-07 14:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

generic_val_print_float has an "embedded_offset" parameter, but it can
only ever be 0.  I believe it is a leftover from the val_print
removal.  This patch removes this parameter.

gdb/ChangeLog
2020-06-07  Tom Tromey  <tom@tromey.com>

	* valprint.c (generic_val_print_float): Remove "embedded_offset"
	parameter.
	(generic_value_print): Update.
---
 gdb/ChangeLog  |  6 ++++++
 gdb/valprint.c | 11 +++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/gdb/valprint.c b/gdb/valprint.c
index d678ad3091a..ca7dab680ae 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -781,19 +781,15 @@ generic_value_print_char (struct value *value, struct ui_file *stream,
 /* generic_val_print helper for TYPE_CODE_FLT and TYPE_CODE_DECFLOAT.  */
 
 static void
-generic_val_print_float (struct type *type,
-			 int embedded_offset, struct ui_file *stream,
+generic_val_print_float (struct type *type, struct ui_file *stream,
 			 struct value *original_value,
 			 const struct value_print_options *options)
 {
-  struct gdbarch *gdbarch = get_type_arch (type);
-  int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
-
   gdb_assert (!options->format);
 
   const gdb_byte *valaddr = value_contents_for_printing (original_value);
 
-  print_floating (valaddr + embedded_offset * unit_size, type, stream);
+  print_floating (valaddr, type, stream);
 }
 
 /* generic_value_print helper for TYPE_CODE_COMPLEX.  */
@@ -896,8 +892,7 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse,
       if (options->format)
 	value_print_scalar_formatted (val, options, 0, stream);
       else
-	generic_val_print_float (type, 0, stream,
-				 val, options);
+	generic_val_print_float (type, stream, val, options);
       break;
 
     case TYPE_CODE_VOID:
-- 
2.17.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-07 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07 14:24 [pushed] Remove unused parameter from generic_val_print_float Tom Tromey

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).