/ Check-in [138d3fcc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Replace "i64" with "sqlite3_int64" in the w32 VFS. (CVS 4441)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:138d3fcc5a74eb570107ae1299184a318b5417df
User & Date: drh 2007-09-20 14:39:24
Context
2007-09-20
21:40
Initial attempt of the new OS/2 mutex implementation. (Compiles and an attempt to create a new table does not crash in mutex_os2 any more.) (CVS 4442) check-in: aa61b244 user: pweilbacher tags: trunk
14:39
Replace "i64" with "sqlite3_int64" in the w32 VFS. (CVS 4441) check-in: 138d3fcc user: drh tags: trunk
12:53
Cleanup the hash functions in FTS3. (CVS 4440) check-in: ac645c8f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
...
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
*/
#include <time.h>
struct tm *__cdecl localtime(const time_t *t)
{
  static struct tm y;
  FILETIME uTm, lTm;
  SYSTEMTIME pTm;
  i64 t64;
  t64 = *t;
  t64 = (t64 + 11644473600)*10000000;
  uTm.dwLowDateTime = t64 & 0xFFFFFFFF;
  uTm.dwHighDateTime= t64 >> 32;
  FileTimeToLocalFileTime(&uTm,&lTm);
  FileTimeToSystemTime(&lTm,&pTm);
  y.tm_year = pTm.wYear - 1900;
................................................................................
  }
  return SQLITE_OK;
}

/*
** Truncate an open file to a specified size
*/
static int winTruncate(sqlite3_file *id, i64 nByte){
  LONG upperBits = (nByte>>32) & 0x7fffffff;
  LONG lowerBits = nByte & 0xffffffff;
  winFile *pFile = (winFile*)id;
  OSTRACE3("TRUNCATE %d %lld\n", pFile->h, nByte);
  SimulateIOError(return SQLITE_IOERR_TRUNCATE);
  SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN);
  SetEndOfFile(pFile->h);







|







 







|







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
...
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
*/
#include <time.h>
struct tm *__cdecl localtime(const time_t *t)
{
  static struct tm y;
  FILETIME uTm, lTm;
  SYSTEMTIME pTm;
  sqlite3_int64 t64;
  t64 = *t;
  t64 = (t64 + 11644473600)*10000000;
  uTm.dwLowDateTime = t64 & 0xFFFFFFFF;
  uTm.dwHighDateTime= t64 >> 32;
  FileTimeToLocalFileTime(&uTm,&lTm);
  FileTimeToSystemTime(&lTm,&pTm);
  y.tm_year = pTm.wYear - 1900;
................................................................................
  }
  return SQLITE_OK;
}

/*
** Truncate an open file to a specified size
*/
static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
  LONG upperBits = (nByte>>32) & 0x7fffffff;
  LONG lowerBits = nByte & 0xffffffff;
  winFile *pFile = (winFile*)id;
  OSTRACE3("TRUNCATE %d %lld\n", pFile->h, nByte);
  SimulateIOError(return SQLITE_IOERR_TRUNCATE);
  SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN);
  SetEndOfFile(pFile->h);