Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/public-domain/sqlite When converting long double va...



details:   https://anonhg.NetBSD.org/src/rev/5e7932c80ec9
branches:  trunk
changeset: 784942:5e7932c80ec9
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Feb 14 17:12:23 2013 +0000

description:
When converting long double values to decimal, convert to int via a call
to floor(), so the conversion does not depend on current rounding mode.
Fixes PR port-sparc64/47535.

diffstat:

 external/public-domain/sqlite/bin/Makefile   |   4 ++--
 external/public-domain/sqlite/dist/sqlite3.c |  10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r bf78814d5085 -r 5e7932c80ec9 external/public-domain/sqlite/bin/Makefile
--- a/external/public-domain/sqlite/bin/Makefile        Thu Feb 14 16:16:25 2013 +0000
+++ b/external/public-domain/sqlite/bin/Makefile        Thu Feb 14 17:12:23 2013 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2012/12/16 20:31:07 christos Exp $
+# $NetBSD: Makefile,v 1.4 2013/02/14 17:12:23 martin Exp $
 
 PROG=          sqlite3
 
 SRCS=          shell.c
 
 DPADD+=                ${LIBSQLITE3} ${LIBEDIT} ${LIBTERIMINFO}
-LDADD+=                -lsqlite3 -ledit -lterminfo
+LDADD+=                -lsqlite3 -ledit -lterminfo -lm
 
 BINDIR=                /usr/bin
 
diff -r bf78814d5085 -r 5e7932c80ec9 external/public-domain/sqlite/dist/sqlite3.c
--- a/external/public-domain/sqlite/dist/sqlite3.c      Thu Feb 14 16:16:25 2013 +0000
+++ b/external/public-domain/sqlite/dist/sqlite3.c      Thu Feb 14 17:12:23 2013 +0000
@@ -19422,11 +19422,14 @@
 ** 16 (the number of significant digits in a 64-bit float) '0' is
 ** always returned.
 */
+#ifdef SQLITE_HAVE_ISNAN
+# include <math.h>
+#endif
 static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
   int digit;
   LONGDOUBLE_TYPE d;
   if( (*cnt)++ >= 16 ) return '0';
-  digit = (int)*val;
+  digit = (int)floor(*val);
   d = digit;
   digit += '0';
   *val = (*val - d)*10.0;
@@ -20998,9 +21001,6 @@
 **
 */
 /* #include <stdarg.h> */
-#ifdef SQLITE_HAVE_ISNAN
-# include <math.h>
-#endif
 
 /*
 ** Routine needed to support the testcase() macro.
@@ -132872,7 +132872,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: sqlite3.c,v 1.6 2012/02/06 17:24:49 matt Exp $
+** $Id: sqlite3.c,v 1.7 2013/02/14 17:12:23 martin Exp $
 **
 ** This file implements an integration between the ICU library 
 ** ("International Components for Unicode", an open-source library 



Home | Main Index | Thread Index | Old Index