diff options
author | tjr <tjr@FreeBSD.org> | 2003-03-13 05:49:09 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-03-13 05:49:09 +0000 |
commit | 91582a72236ba029026cf1c53c7d4ca04c5dc699 (patch) | |
tree | 464c41a727872009ec7e2f556e6593ef0e8cbdba /lib/libc/stdio | |
parent | ba71de6a3bcb835f9c33ad32bae78e18b78e0a5b (diff) | |
download | FreeBSD-src-91582a72236ba029026cf1c53c7d4ca04c5dc699.zip FreeBSD-src-91582a72236ba029026cf1c53c7d4ca04c5dc699.tar.gz |
MFp4: Catch up to recent __dtoa() interface changes and removal of cvt()'s
last argument.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/vfwprintf.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index 1415dd3..1e69880 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -39,7 +39,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.45 2002/09/06 11:23:55 tjr Exp "); +__FBSDID("$FreeBSD$"); #endif __FBSDID("$FreeBSD$"); @@ -406,8 +406,10 @@ vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, va_list ap) #define BUF ((MAXEXP*2)+MAXFRACT+1) /* + decimal point */ #define DEFPREC 6 -static wchar_t *cvt(double, int, int, char *, int *, wchar_t, int *, - wchar_t **); +extern char *__dtoa(double, int, int, int *, int *, char **); +extern void __freedtoa(char *s); + +static wchar_t *cvt(double, int, int, char *, int *, wchar_t, int *); static int exponent(wchar_t *, int, wchar_t); #else /* no FLOATING_POINT */ @@ -807,8 +809,8 @@ fp_begin: if (prec == -1) free(dtoaresult); dtoaresult = NULL; } - cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig, &dtoaresult); + dtoaresult = cp = cvt(_double, prec, flags, &softsign, + &expt, ch, &ndig); if (ch == 'g' || ch == 'G') { if (expt <= -4 || expt > prec) ch = (ch == 'g') ? 'e' : 'E'; @@ -1472,11 +1474,9 @@ __grow_type_table (int nextarg, enum typeid **typetable, int *tablesize) #ifdef FLOATING_POINT -extern char *__dtoa(double, int, int, int *, int *, char **, char **); - static wchar_t * cvt(double value, int ndigits, int flags, char *sign, int *decpt, - wchar_t ch, int *length, wchar_t **dtoaresultp) + wchar_t ch, int *length) { int i, mode, dsgn; wchar_t *digits, *bp, *result, *rve; @@ -1494,14 +1494,13 @@ cvt(double value, int ndigits, int flags, char *sign, int *decpt, ndigits++; mode = 2; /* ndigits significant digits */ } - __dtoa(value, mode, ndigits, decpt, &dsgn, &trve, &tresult); + tresult = __dtoa(value, mode, ndigits, decpt, &dsgn, &trve); if ((result = malloc((trve - tresult + 1) * sizeof(*result))) == NULL) abort(); /* XXX handle better */ for (i = 0; i < trve - tresult + 1; i++) result[i] = (wchar_t)(unsigned char)tresult[i]; rve = result + (trve - tresult); - free(tresult); - *dtoaresultp = result; + __freedtoa(tresult); digits = result; *sign = dsgn != 0; if ((ch != 'g' && ch != 'G') || flags & ALT) { |