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/dist fix vax floating point ov...



details:   https://anonhg.NetBSD.org/src/rev/b68b1f8edad3
branches:  trunk
changeset: 770935:b68b1f8edad3
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 02 23:19:48 2011 +0000

description:
fix vax floating point overflows.

diffstat:

 external/public-domain/sqlite/dist/sqlite3.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r b41a059a18c7 -r b68b1f8edad3 external/public-domain/sqlite/dist/sqlite3.c
--- a/external/public-domain/sqlite/dist/sqlite3.c      Wed Nov 02 23:06:08 2011 +0000
+++ b/external/public-domain/sqlite/dist/sqlite3.c      Wed Nov 02 23:19:48 2011 +0000
@@ -7615,10 +7615,19 @@
 # define SQLITE_OMIT_TRACE 1
 # undef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
 # undef SQLITE_HAVE_ISNAN
+#else
+# ifdef __vax__
+#  include <float.h>
+#  define SQLITE_BIG_DBL DBL_MAX
+#  define SQLITE_HUGE_DBL DBL_MAX
+# endif
 #endif
 #ifndef SQLITE_BIG_DBL
 # define SQLITE_BIG_DBL (1e99)
 #endif
+#ifndef SQLITE_HUGE_DBL
+# define SQLITE_HUGE_DBL (1.0e+308)
+#endif
 
 /*
 ** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0
@@ -21000,10 +21009,10 @@
         while( e%308 ) { scale *= 1.0e+1; e -= 1; }
         if( esign<0 ){
           result = s / scale;
-          result /= 1.0e+308;
+          result /= SQLITE_HUGE_DBL;
         }else{
           result = s * scale;
-          result *= 1.0e+308;
+          result *= SQLITE_HUGE_DBL;
         }
       }else{
         /* 1.0e+22 is the largest power of 10 than can be 
@@ -130632,7 +130641,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: sqlite3.c,v 1.1.1.1 2011/10/13 21:38:52 joerg Exp $
+** $Id: sqlite3.c,v 1.2 2011/11/02 23:19:48 christos 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