summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/g_xLfmt.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2009-01-28 04:36:34 +0000
committerdas <das@FreeBSD.org>2009-01-28 04:36:34 +0000
commit1dd1bae7b6975b8f90638d416af36744406345b4 (patch)
treec4d28a7b5d5d1902de89c3a33988ed7f5638277b /contrib/gdtoa/g_xLfmt.c
parent0ae48d48ab38ccf64f5cda7e2bc3a30aa4b7c4c2 (diff)
parent5606fb59f1820207cf2c2c8709586e36f114a8f7 (diff)
downloadFreeBSD-src-1dd1bae7b6975b8f90638d416af36744406345b4.zip
FreeBSD-src-1dd1bae7b6975b8f90638d416af36744406345b4.tar.gz
Vendor import of gdtoa 20081205.
Diffstat (limited to 'contrib/gdtoa/g_xLfmt.c')
-rw-r--r--contrib/gdtoa/g_xLfmt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/gdtoa/g_xLfmt.c b/contrib/gdtoa/g_xLfmt.c
index 1bbc6e2..6fa1de2 100644
--- a/contrib/gdtoa/g_xLfmt.c
+++ b/contrib/gdtoa/g_xLfmt.c
@@ -49,15 +49,20 @@ THIS SOFTWARE.
char*
#ifdef KR_headers
-g_xLfmt(buf, V, ndig, bufsize) char *buf; char *V; int ndig; unsigned bufsize;
+g_xLfmt(buf, V, ndig, bufsize) char *buf; char *V; int ndig; size_t bufsize;
#else
-g_xLfmt(char *buf, void *V, int ndig, unsigned bufsize)
+g_xLfmt(char *buf, void *V, int ndig, size_t bufsize)
#endif
{
- static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, 0 };
+ static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, 0 };
char *b, *s, *se;
ULong bits[2], *L, sign;
int decpt, ex, i, mode;
+#ifdef Honor_FLT_ROUNDS
+#include "gdtoa_fltrnds.h"
+#else
+#define fpi &fpi0
+#endif
if (ndig < 0)
ndig = 0;
@@ -103,6 +108,6 @@ g_xLfmt(char *buf, void *V, int ndig, unsigned bufsize)
return 0;
mode = 0;
}
- s = gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se);
- return g__fmt(buf, s, se, decpt, sign);
+ s = gdtoa(fpi, ex, bits, &i, mode, ndig, &decpt, &se);
+ return g__fmt(buf, s, se, decpt, sign, bufsize);
}
OpenPOWER on IntegriCloud