]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid all use of the "LL" suffix for long-long integer literals.
authordrh <drh@noemail.net>
Mon, 30 Mar 2009 12:42:45 +0000 (12:42 +0000)
committerdrh <drh@noemail.net>
Mon, 30 Mar 2009 12:42:45 +0000 (12:42 +0000)
Ticket #3759. (CVS 6408)

FossilOrigin-Name: 7ef36935424013a1b211906620954a97ffe08de7

manifest
manifest.uuid
src/os_win.c

index 3eb66d1dc18d03489e3aa67753b4edc76edec331..ce8eacce56d1b7a5070fb5030bef88dd6dd204ca 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Display\sa\swarning\sthat\sthe\snotify2-3\stest\ssometimes\sfails\son\ssingle-core\nmachines.\s(CVS\s6407)
-D 2009-03-30T11:59:31
+C Avoid\sall\suse\sof\sthe\s"LL"\ssuffix\sfor\slong-long\sinteger\sliterals.\nTicket\s#3759.\s(CVS\s6408)
+D 2009-03-30T12:42:45
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -142,7 +142,7 @@ F src/os.h fa3f4aa0119ff721a2da4b47ffd74406ac864c05
 F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
 F src/os_unix.c 5d667f24615043c937a138faaed5f3e93b8619b0
-F src/os_win.c 40636702058ed4dcd35d68151bfab56d4997cdc1
+F src/os_win.c 07f7c803f5dc06c9e1d83c12d4e2341dea8a778d
 F src/pager.c 7a2b4b118708de09e580de66d46e51c1b655f76a
 F src/pager.h 0c9f3520c00d8a3b8e792ca56c9a11b6b02b4b0f
 F src/parse.y b9ba0946a13e9f32a96044e64a3e8780269b08b0
@@ -711,7 +711,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 50fbcdea045f7d4266d9afa721616c720564aa93
-R bcce255946acb766df25717e23479ac7
+P ab7c718dec56859c51bfb0b1c1d70a7c84feffd1
+R 2e61a49062eb7ec1ad9d521cf4e6d0e2
 U drh
-Z fdfb821831a77fcb2483bd1613327cdd
+Z d713a25fda34f520ce2e7bb6f817ef52
index e4ace916b13bb41ec38d4eaadcf32aa41a067882..223612c73332709c7448ba22cad63e909aa0394f 100644 (file)
@@ -1 +1 @@
-ab7c718dec56859c51bfb0b1c1d70a7c84feffd1
\ No newline at end of file
+7ef36935424013a1b211906620954a97ffe08de7
\ No newline at end of file
index 3722224ab25de466dc2f39d5339ace306fa89da1..26820fa346b7bb2d4158cf3091468181b1bbeb83 100644 (file)
@@ -12,7 +12,7 @@
 **
 ** This file contains code that is specific to windows.
 **
-** $Id: os_win.c,v 1.150 2009/03/05 05:54:55 shane Exp $
+** $Id: os_win.c,v 1.151 2009/03/30 12:42:45 drh Exp $
 */
 #include "sqliteInt.h"
 #if SQLITE_OS_WIN               /* This file is used for windows only */
@@ -1764,7 +1764,18 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){
   /* FILETIME structure is a 64-bit value representing the number of 
      100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). 
   */
-  sqlite3_int64 timeW, timeF;
+  sqlite3_int64 timeW;   /* Whole days */
+  sqlite3_int64 timeF;   /* Fractional Days */
+
+  /* Number of 100-nanosecond intervals in a single day */
+  static const sqlite3_int64 ntuPerDay = 
+      10000000*(sqlite3_int64)86400;
+
+  /* Number of 100-nanosecond intervals in half of a day */
+  static const sqlite3_int64 ntuPerHalfDay = 
+      10000000*(sqlite3_int64)43200;
+
+
 #if SQLITE_OS_WINCE
   SYSTEMTIME time;
   GetSystemTime(&time);
@@ -1776,25 +1787,14 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){
   GetSystemTimeAsFileTime( &ft );
 #endif
   UNUSED_PARAMETER(pVfs);
-#if defined(_MSC_VER)
   timeW = (((sqlite3_int64)ft.dwHighDateTime)*4294967296) + ft.dwLowDateTime;
-  timeF = timeW % 864000000000;           /* fractional days (100-nanoseconds) */
-  timeW = timeW / 864000000000;           /* whole days */
-  timeW = timeW + 2305813;                /* add whole days (from 2305813.5) */
-  timeF = timeF + 432000000000;           /* add half a day (from 2305813.5) */
-  timeW = timeW + (timeF / 864000000000); /* add whole day if half day made one */
-  timeF = timeF % 864000000000;           /* compute new fractional days */
-  *prNow = (double)timeW + ((double)timeF / (double)864000000000);
-#else
-  timeW = (((sqlite3_int64)ft.dwHighDateTime)*4294967296LL) + ft.dwLowDateTime;
-  timeF = timeW % 864000000000LL;           /* fractional days (100-nanoseconds) */
-  timeW = timeW / 864000000000LL;           /* whole days */
-  timeW = timeW + 2305813;                  /* add whole days (from 2305813.5) */
-  timeF = timeF + 432000000000LL;           /* add half a day (from 2305813.5) */
-  timeW = timeW + (timeF / 864000000000LL); /* add whole day if half day made one */
-  timeF = timeF % 864000000000LL;           /* compute new fractional days */
-  *prNow = (double)timeW + ((double)timeF / (double)864000000000LL);
-#endif
+  timeF = timeW % ntuPerDay;          /* fractional days (100-nanoseconds) */
+  timeW = timeW / ntuPerDay;          /* whole days */
+  timeW = timeW + 2305813;            /* add whole days (from 2305813.5) */
+  timeF = timeF + ntuPerHalfDay;      /* add half a day (from 2305813.5) */
+  timeW = timeW + (timeF/ntuPerDay);  /* add whole day if half day made one */
+  timeF = timeF % ntuPerDay;          /* compute new fractional days */
+  *prNow = (double)timeW + ((double)timeF / (double)ntuPerDay);
 #ifdef SQLITE_TEST
   if( sqlite3_current_time ){
     *prNow = ((double)sqlite3_current_time + (double)43200) / (double)86400 + (double)2440587;