Use floatformat_totalsize_bytes
authorYao Qi <yao.qi@linaro.org>
Mon, 24 Apr 2017 20:29:12 +0000 (21:29 +0100)
committerYao Qi <yao.qi@linaro.org>
Mon, 24 Apr 2017 20:29:12 +0000 (21:29 +0100)
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
gdb/doublest.c

index 28ae0a7717c10a97909d43fd3afa3ca98e993212..33dd53bb3960b785b4acea59b92cdd2c6d9806d8 100644 (file)
@@ -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
index d9e1fc60c0fe9913dc7ccf5a69b0742acee049f3..e464177bcc77767b06935cbfc7adc32966f90488 100644 (file)
@@ -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)
     {