aboutsummaryrefslogtreecommitdiff
path: root/src/os_win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_win.c')
-rw-r--r--src/os_win.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/os_win.c b/src/os_win.c
index 64e89969b..a95340d9e 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -12,7 +12,7 @@
**
** This file contains code that is specific to windows.
**
-** $Id: os_win.c,v 1.152 2009/03/30 13:04:18 drh Exp $
+** $Id: os_win.c,v 1.153 2009/03/31 03:41:57 shane Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_WIN /* This file is used for windows only */
@@ -1775,6 +1775,9 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){
static const sqlite3_int64 ntuPerHalfDay =
10000000*(sqlite3_int64)43200;
+ /* 2^32 - to avoid use of LL and warnings in gcc */
+ static const sqlite3_int64 max32BitValue =
+ (sqlite3_int64)2000000000 + (sqlite3_int64)2000000000 + (sqlite3_int64)294967296;
#if SQLITE_OS_WINCE
SYSTEMTIME time;
@@ -1787,7 +1790,7 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){
GetSystemTimeAsFileTime( &ft );
#endif
UNUSED_PARAMETER(pVfs);
- timeW = (((sqlite3_int64)ft.dwHighDateTime)*4294967296) + ft.dwLowDateTime;
+ timeW = (((sqlite3_int64)ft.dwHighDateTime)*max32BitValue) + (sqlite3_int64)ft.dwLowDateTime;
timeF = timeW % ntuPerDay; /* fractional days (100-nanoseconds) */
timeW = timeW / ntuPerDay; /* whole days */
timeW = timeW + 2305813; /* add whole days (from 2305813.5) */