Assume the 'long double' type.

This commit is contained in:
Bruno Haible 2007-04-06 14:43:14 +00:00
parent 5c909be06e
commit c6c8db98b4
11 changed files with 20 additions and 37 deletions

View File

@ -1,6 +1,13 @@
2007-04-06 Bruno Haible <bruno@clisp.org>
* printf-args.h: Assume HAVE_LONG_DOUBLE to be true.
* printf-args.c: Likewise.
* printf-parse.c: Likewise.
* vasnprintf.c: Likewise.
2007-03-25 Bruno Haible <bruno@clisp.org>
* lib/printf-parse.c [!IN_LIBINTL]: Include <stdint.h>, for intmax_t.
* printf-parse.c [!IN_LIBINTL]: Include <stdint.h>, for intmax_t.
(PRINTF_PARSE): Make the support for size specifier 'j' unconditional.
2007-03-04 Bruno Haible <bruno@clisp.org>

View File

@ -68,11 +68,9 @@ printf_fetchargs (va_list args, arguments *a)
case TYPE_DOUBLE:
ap->a.a_double = va_arg (args, double);
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
ap->a.a_longdouble = va_arg (args, long double);
break;
#endif
case TYPE_CHAR:
ap->a.a_char = va_arg (args, int);
break;

View File

@ -53,9 +53,7 @@ typedef enum
TYPE_ULONGLONGINT,
#endif
TYPE_DOUBLE,
#if HAVE_LONG_DOUBLE
TYPE_LONGDOUBLE,
#endif
TYPE_CHAR,
#if HAVE_WINT_T
TYPE_WIDE_CHAR,
@ -94,9 +92,7 @@ typedef struct
#endif
float a_float;
double a_double;
#if HAVE_LONG_DOUBLE
long double a_longdouble;
#endif
int a_char;
#if HAVE_WINT_T
wint_t a_wide_char;

View File

@ -422,12 +422,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
break;
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
case 'a': case 'A':
#if HAVE_LONG_DOUBLE
if (flags >= 16 || (flags & 4))
type = TYPE_LONGDOUBLE;
else
#endif
type = TYPE_DOUBLE;
type = TYPE_DOUBLE;
break;
case 'c':
if (flags >= 8)

View File

@ -409,7 +409,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'f': case 'F':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_MAX_EXP
@ -419,7 +418,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
+ 1 /* turn floor into ceil */
+ 10; /* sign, decimal point etc. */
else
# endif
tmp_length =
(unsigned int) (DBL_MAX_EXP
* 0.30103 /* binary -> decimal */
@ -437,7 +435,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'a': case 'A':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_DIG
@ -445,7 +442,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
)
+ 1; /* turn floor into ceil */
else
# endif
tmp_length =
(unsigned int) (DBL_DIG
* 0.831 /* decimal -> hexadecimal */
@ -564,11 +560,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
#endif
*p++ = 'l';
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
*p++ = 'L';
break;
#endif
default:
break;
}
@ -722,14 +716,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
SNPRINTF_BUF (arg);
}
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
SNPRINTF_BUF (arg);
}
break;
#endif
case TYPE_CHAR:
{
int arg = a.arg[dp->arg_index].a.a_char;

View File

@ -1,3 +1,10 @@
2007-04-06 Bruno Haible <bruno@clisp.org>
* printf-args.h: Assume HAVE_LONG_DOUBLE to be true.
* printf-args.c: Likewise.
* printf-parse.c: Likewise.
* vasnprintf.c: Likewise.
2007-03-29 Bruno Haible <bruno@clisp.org>
* Makefile.am (DEFS): New variable.
@ -6,7 +13,7 @@
2007-03-25 Bruno Haible <bruno@clisp.org>
* lib/printf-parse.c [!IN_LIBINTL]: Include <stdint.h>, for intmax_t.
* printf-parse.c [!IN_LIBINTL]: Include <stdint.h>, for intmax_t.
(PRINTF_PARSE): Make the support for size specifier 'j' unconditional.
2007-02-25 Bruno Haible <bruno@clisp.org>

View File

@ -68,11 +68,9 @@ printf_fetchargs (va_list args, arguments *a)
case TYPE_DOUBLE:
ap->a.a_double = va_arg (args, double);
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
ap->a.a_longdouble = va_arg (args, long double);
break;
#endif
case TYPE_CHAR:
ap->a.a_char = va_arg (args, int);
break;

View File

@ -53,9 +53,7 @@ typedef enum
TYPE_ULONGLONGINT,
#endif
TYPE_DOUBLE,
#if HAVE_LONG_DOUBLE
TYPE_LONGDOUBLE,
#endif
TYPE_CHAR,
#if HAVE_WINT_T
TYPE_WIDE_CHAR,
@ -94,9 +92,7 @@ typedef struct
#endif
float a_float;
double a_double;
#if HAVE_LONG_DOUBLE
long double a_longdouble;
#endif
int a_char;
#if HAVE_WINT_T
wint_t a_wide_char;

View File

@ -422,12 +422,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
break;
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
case 'a': case 'A':
#if HAVE_LONG_DOUBLE
if (flags >= 16 || (flags & 4))
type = TYPE_LONGDOUBLE;
else
#endif
type = TYPE_DOUBLE;
type = TYPE_DOUBLE;
break;
case 'c':
if (flags >= 8)

View File

@ -409,7 +409,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'f': case 'F':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_MAX_EXP
@ -419,7 +418,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
+ 1 /* turn floor into ceil */
+ 10; /* sign, decimal point etc. */
else
# endif
tmp_length =
(unsigned int) (DBL_MAX_EXP
* 0.30103 /* binary -> decimal */
@ -437,7 +435,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
break;
case 'a': case 'A':
# if HAVE_LONG_DOUBLE
if (type == TYPE_LONGDOUBLE)
tmp_length =
(unsigned int) (LDBL_DIG
@ -445,7 +442,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
)
+ 1; /* turn floor into ceil */
else
# endif
tmp_length =
(unsigned int) (DBL_DIG
* 0.831 /* decimal -> hexadecimal */
@ -564,11 +560,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
#endif
*p++ = 'l';
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
*p++ = 'L';
break;
#endif
default:
break;
}
@ -722,14 +716,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
SNPRINTF_BUF (arg);
}
break;
#if HAVE_LONG_DOUBLE
case TYPE_LONGDOUBLE:
{
long double arg = a.arg[dp->arg_index].a.a_longdouble;
SNPRINTF_BUF (arg);
}
break;
#endif
case TYPE_CHAR:
{
int arg = a.arg[dp->arg_index].a.a_char;

View File

@ -2,7 +2,8 @@
Assume the 'long double' type.
* longdouble.m4: Remove file.
* Makefile.am (EXTRA_DIST): Remove it.
* intl.m4: Remove gt_TYPE_LONGDOUBLE invocation.
* Makefile.am (EXTRA_DIST): Remove longdouble.m4.
2007-03-04 Bruno Haible <bruno@clisp.org>