]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/ia64/fpu/printf_fphex.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / ia64 / fpu / printf_fphex.c
index 42f64b2ab22e63094fdcf4eb0c235ac1e838b433..3cb0ee5ebf8d92af98218cfafb2c00ad83e2f040 100644 (file)
@@ -1,5 +1,5 @@
 /* Print floating point number in hexadecimal notation according to ISO C99.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef LONG_DOUBLE_DENORM_BIAS
 # define LONG_DOUBLE_DENORM_BIAS (IEEE854_LONG_DOUBLE_BIAS - 1)
@@ -26,9 +25,11 @@ do {                                                                       \
       /* The "strange" 80 bit format on ia64 has an explicit                 \
         leading digit in the 64 bit mantissa.  */                            \
       unsigned long long int num;                                            \
+      union ieee854_long_double u;                                           \
+      u.d = fpnum.ldbl;                                                              \
                                                                              \
-      num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32              \
-            | fpnum.ldbl.ieee.mantissa1);                                    \
+      num = (((unsigned long long int) u.ieee.mantissa0) << 32               \
+            | u.ieee.mantissa1);                                             \
                                                                              \
       zero_mantissa = num == 0;                                                      \
                                                                              \
@@ -50,8 +51,8 @@ do {                                                                        \
                                                                              \
       /* We have 3 bits from the mantissa in the leading nibble.             \
         Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'.  */      \
-      exponent = fpnum.ldbl.ieee.exponent;                                   \
-                                                                            \
+      exponent = u.ieee.exponent;                                            \
+                                                                             \
       if (exponent == 0)                                                     \
        {                                                                     \
          if (zero_mantissa)                                                  \
@@ -78,4 +79,4 @@ do {                                                                        \
        }                                                                     \
 } while (0)
 
-#include <sysdeps/generic/printf_fphex.c>
+#include <stdio-common/printf_fphex.c>