public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH OBV] Use floatformat_totalsize_bytes
@ 2017-04-24 20:35 Yao Qi
  0 siblings, 0 replies; only message in thread
From: Yao Qi @ 2017-04-24 20:35 UTC (permalink / raw)
  To: gdb-patches

The code can be replaced by floatformat_totalsize_bytes.

gdb:

2017-04-24  Yao Qi  <yao.qi@linaro.org>

	* doublest.c (convert_doublest_to_floatformat): Call
	floatformat_totalsize_bytes.
---
 gdb/ChangeLog  | 5 +++++
 gdb/doublest.c | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 28ae0a7..33dd53b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-24  Yao Qi  <yao.qi@linaro.org>
+
+	* doublest.c (convert_doublest_to_floatformat): Call
+	floatformat_totalsize_bytes.
+
 2017-04-22  Tom Tromey  <tom@tromey.com>
 
 	* mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
diff --git a/gdb/doublest.c b/gdb/doublest.c
index d9e1fc6..e464177 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -360,8 +360,7 @@ convert_doublest_to_floatformat (const struct floatformat *fmt,
     uto = newto;
 
   memcpy (&dfrom, from, sizeof (dfrom));
-  memset (uto, 0, (fmt->totalsize + FLOATFORMAT_CHAR_BIT - 1) 
-                    / FLOATFORMAT_CHAR_BIT);
+  memset (uto, 0, floatformat_totalsize_bytes (fmt));
 
   if (fmt->split_half)
     {
-- 
1.9.1

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

only message in thread, other threads:[~2017-04-24 20:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 20:35 [PATCH OBV] Use floatformat_totalsize_bytes Yao Qi

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