summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m411
-rw-r--r--mpfr.texi31
-rw-r--r--tests/tfprintf.c13
-rw-r--r--tests/tprintf.c13
-rw-r--r--vasprintf.c22
5 files changed, 23 insertions, 67 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 8cd34e6e5..47cba75dd 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -119,8 +119,7 @@ AC_CHECK_TYPE([long long int],
AC_DEFINE(HAVE_LONG_LONG, 1, [Define if compiler supports long long]),,)
dnl intmax_t is C99
-dnl quad_t is BSD specific
-AC_CHECK_TYPES([intmax_t, quad_t])
+AC_CHECK_TYPES([intmax_t])
AC_CHECK_TYPE( [union fpc_csr],
AC_DEFINE(HAVE_FPC_CSR,1,[Define if union fpc_csr is available]), ,
@@ -713,14 +712,6 @@ if test "$ac_cv_type_intmax_t" == yes; then
[AC_DEFINE([NPRINTF_J], 1, [gmp_printf cannot read intmax_t])])
fi
-if test "$ac_cv_type_quad_t" == yes; then
- MPFR_FUNC_PRINTF_SPEC([%qd], [quad_t], [
-#include <sys/types.h>
-#include <gmp.h>
- ], [gmp_],,
- [AC_DEFINE([NPRINTF_Q], 1, [gmp_printf cannot read quad_t])])
-fi
-
MPFR_FUNC_PRINTF_SPEC([%.0Lf], [long double], [
#include <gmp.h>
], [gmp_],,
diff --git a/mpfr.texi b/mpfr.texi
index aa2799005..681b98169 100644
--- a/mpfr.texi
+++ b/mpfr.texi
@@ -1915,23 +1915,36 @@ The format specification accepted by @code{mpfr_printf} is an extension of the
the standard C function @code{printf} (in particular, notice that the
precision is related to the number of digits displayed in the base chosen by
@samp{conv} and not related to the internal precision of the @code{mpfr_t}
-variable). @code{mpfr_printf} is an extension to the @code{gmp_printf}
-function, hence it accepts the same @samp{type} specifiers plus the following
-two:
+variable). @code{mpfr_printf} accepts the same @samp{type} specifiers (except
+@samp{q} which is not supported) as @code{gmp}, plus @samp{R} and @samp{P}:
@quotation
@multitable {(space)} {MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM}
+@item @samp{h} @tab @code{short}
+@item @samp{hh} @tab @code{char}
+@item @samp{j} @tab @code{intmax_t} or @code{uintmax_t}
+@item @samp{l} @tab @code{long} or @code{wchar_t}
+@item @samp{ll} @tab @code{long long}
+@item @samp{L} @tab @code{long double}
+@item @samp{t} @tab @code{ptrdiff_t}
+@item @samp{z} @tab @code{size_t}
+
+@item @samp{F} @tab @code{mpf_t}, float conversions
+@item @samp{Q} @tab @code{mpq_t}, integer conversions
+@item @samp{M} @tab @code{mp_limb_t}, integer conversions
+@item @samp{N} @tab @code{mp_limb_t} array, integer conversions
+@item @samp{Z} @tab @code{mpz_t}, integer conversions
+
@item @samp{R} @tab @code{mpfr_t} input, float conversions
@item @samp{P} @tab @code{mpfr_prec_t} input, integer conversions
@end multitable
@end quotation
The @samp{type} specifiers have the same restrictions as those mentioned in
the GMP documentation, for instance, only @samp{h} and @samp{l} are portable;
-moreover, @samp{M}, @samp{j}, @samp{ll}, or @samp{q} are not supported if your
-GMP library does not support them.
-The @samp{rounding} specifier is specific to @code{mpfr_t}
-parameter and shall not be used with other types. @code{mpfr_printf} accepts
-the same conversion specifier character @samp{conv} as @code{gmp_printf} plus
-@samp{b}.
+moreover, @samp{M}, @samp{j}, or @samp{ll} are not supported if your GMP
+library does not support them.
+The @samp{rounding} specifier is specific to @code{mpfr_t} parameter and shall
+not be used with other types. @code{mpfr_printf} accepts the same conversion
+specifier character @samp{conv} as @code{gmp_printf} plus @samp{b}.
The @samp{P} type outputs the precision of an @code{mpfr_t} variable.
It is needed because the @code{mpfr_prec_t} type doesn't necessarily
diff --git a/tests/tfprintf.c b/tests/tfprintf.c
index 965abfaf0..29091f534 100644
--- a/tests/tfprintf.c
+++ b/tests/tfprintf.c
@@ -34,10 +34,6 @@ MA 02110-1301, USA. */
# endif
#endif
-#ifdef HAVE_QUAD_T
-#include <sys/types.h>
-#endif
-
#include "mpfr-test.h"
#if MPFR_VERSION >= MPFR_VERSION_NUM(2,4,0)
@@ -249,15 +245,6 @@ check_mixed (FILE *fout)
}
#endif
-#if defined(HAVE_QUAD_T) && !defined(NPRINTF_Q)
- {
- quad_t q = -1;
-
- check_vfprintf (fout, "a. %qi, b. %Rf%Fn", q, mpfr, &mpf);
- check_length_with_cmp (21, mpf, 12, mpf_cmp_ui (mpf, 12), Fg);
- }
-#endif
-
#if defined(_MPFR_H_HAVE_INTMAX_T) && !defined(NPRINTF_J)
{
intmax_t im = -1;
diff --git a/tests/tprintf.c b/tests/tprintf.c
index 82ae47834..c4756e8ca 100644
--- a/tests/tprintf.c
+++ b/tests/tprintf.c
@@ -33,10 +33,6 @@ MA 02110-1301, USA. */
# endif
#endif
-#ifdef HAVE_QUAD_T
-#include <sys/types.h>
-#endif
-
#include "mpfr-test.h"
#define STDOUT_FILENO 1
@@ -220,15 +216,6 @@ check_mixed ()
}
#endif
-#if defined(HAVE_QUAD_T) && !defined(NPRINTF_Q)
- {
- quad_t q = -1;
-
- check_vprintf ("a. %qi, b. %Rf%Fn", q, mpfr, &mpf);
- check_length_with_cmp (21, mpf, 12, mpf_cmp_ui (mpf, 12), Fg);
- }
-#endif
-
#if defined(_MPFR_H_HAVE_INTMAX_T) && !defined(NPRINTF_J)
{
intmax_t im = -1;
diff --git a/vasprintf.c b/vasprintf.c
index f522e48f6..4ea97b1e9 100644
--- a/vasprintf.c
+++ b/vasprintf.c
@@ -49,10 +49,6 @@ MA 02110-1301, USA. */
# endif
#endif
-#ifdef HAVE_QUAD_T
-#include <sys/types.h>
-#endif
-
#include <string.h> /* for strlen, memcpy and others */
#include "mpfr-impl.h"
@@ -262,14 +258,6 @@ parse_arg_type (const char *format, struct printf_spec *specinfo)
specinfo->arg_type = LONG_ARG;
break;
}
- case 'q':
- ++format;
-#if defined(HAVE_QUAD_T) && !defined(NPRINTF_Q)
- specinfo->arg_type = QUAD_ARG;
-#else
- specinfo->arg_type = UNSUPPORTED;
-#endif
- break;
case 'j':
++format;
#if defined(_MPFR_H_HAVE_INTMAX_T) && !defined(NPRINTF_J)
@@ -375,15 +363,6 @@ parse_arg_type (const char *format, struct printf_spec *specinfo)
#define CASE_LONG_LONG_ARG(specinfo, ap)
#endif
-#ifdef HAVE_QUAD_T
-#define CASE_QUAD_ARG(specinfo, ap) \
- case QUAD_ARG: \
- (void) va_arg ((ap), quad_t); \
- break;
-#else
-#define CASE_QUAD_ARG(specinfo, ap)
-#endif
-
#define CONSUME_VA_ARG(specinfo, ap) \
do { \
switch ((specinfo).arg_type) \
@@ -394,7 +373,6 @@ parse_arg_type (const char *format, struct printf_spec *specinfo)
break; \
CASE_LONG_ARG (specinfo, ap) \
CASE_LONG_LONG_ARG (specinfo, ap) \
- CASE_QUAD_ARG(specinfo, ap) \
CASE_INTMAX_ARG (specinfo, ap) \
case SIZE_ARG: \
(void) va_arg ((ap), size_t); \