diff options
Diffstat (limited to 'stdio-common')
-rw-r--r-- | stdio-common/printf_fp.c | 3 | ||||
-rw-r--r-- | stdio-common/printf_fphex.c | 14 | ||||
-rw-r--r-- | stdio-common/printf_size.c | 12 |
3 files changed, 12 insertions, 17 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index e20eab6a34..2b93e6c57a 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -332,8 +332,7 @@ ___printf_fp (FILE *fp, int res; if (__isnanl (fpnum.ldbl)) { - union ieee854_long_double u = { .d = fpnum.ldbl }; - is_neg = u.ieee.negative != 0; + is_neg = signbit (fpnum.ldbl); if (isupper (info->spec)) { special = "NAN"; diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c index 3da2eec40c..50b6fbfbc7 100644 --- a/stdio-common/printf_fphex.c +++ b/stdio-common/printf_fphex.c @@ -93,7 +93,7 @@ __printf_fphex (FILE *fp, union { union ieee754_double dbl; - union ieee854_long_double ldbl; + long double ldbl; } fpnum; @@ -162,12 +162,11 @@ __printf_fphex (FILE *fp, #ifndef __NO_LONG_DOUBLE_MATH if (info->is_long_double && sizeof (long double) > sizeof (double)) { - fpnum.ldbl.d = *(const long double *) args[0]; + fpnum.ldbl = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - if (__isnanl (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl)) { - negative = fpnum.ldbl.ieee.negative != 0; if (isupper (info->spec)) { special = "NAN"; @@ -181,8 +180,7 @@ __printf_fphex (FILE *fp, } else { - int res = __isinfl (fpnum.ldbl.d); - if (res) + if (__isinfl (fpnum.ldbl)) { if (isupper (info->spec)) { @@ -194,11 +192,9 @@ __printf_fphex (FILE *fp, special = "inf"; wspecial = L"inf"; } - negative = res < 0; } - else - negative = signbit (fpnum.ldbl.d); } + negative = signbit (fpnum.ldbl); } else #endif /* no long double */ diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c index 2c496e5b2f..dfb3a539b9 100644 --- a/stdio-common/printf_size.c +++ b/stdio-common/printf_size.c @@ -103,7 +103,7 @@ __printf_size (FILE *fp, const struct printf_info *info, union { union ieee754_double dbl; - union ieee854_long_double ldbl; + long double ldbl; } fpnum; const void *ptr = &fpnum; @@ -123,25 +123,25 @@ __printf_size (FILE *fp, const struct printf_info *info, #ifndef __NO_LONG_DOUBLE_MATH if (info->is_long_double && sizeof (long double) > sizeof (double)) { - fpnum.ldbl.d = *(const long double *) args[0]; + fpnum.ldbl = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - if (__isnanl (fpnum.ldbl.d)) + if (__isnanl (fpnum.ldbl)) { special = "nan"; wspecial = L"nan"; // fpnum_sign = 0; Already zero } - else if ((res = __isinfl (fpnum.ldbl.d))) + else if ((res = __isinfl (fpnum.ldbl))) { fpnum_sign = res; special = "inf"; wspecial = L"inf"; } else - while (fpnum.ldbl.d >= divisor && tag[1] != '\0') + while (fpnum.ldbl >= divisor && tag[1] != '\0') { - fpnum.ldbl.d /= divisor; + fpnum.ldbl /= divisor; ++tag; } } |