/ Check-in [1f0a93e1]
Login

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

Overview
Comment:Fixed some compiler warnings in WINCE only sections when using the MSVC compiler.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1f0a93e17d6291268da909699ce1a5a7619ae637
User & Date: shane 2009-08-12 15:34:03
References
2009-09-14
16:50 Ticket [03b198a2] Getting several warnings when compiling in eVC++ 4 status still Fixed with 1 other change artifact: b35459b1 user: drh
Context
2009-08-13
07:09
Changes to the query planner that improve the order in which tables/indexes are scanned in join queries. check-in: 19f799b3 user: dan tags: trunk
2009-08-12
15:34
Fixed some compiler warnings in WINCE only sections when using the MSVC compiler. check-in: 1f0a93e1 user: shane tags: trunk
11:45
Make sure the large-file support macros occur first in sqliteInt.h. Fix for CVSTrac ticket #4022. check-in: b0848925 user: drh tags: trunk, cvs-to-fossil-cutover
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

configure became a regular file.


Changes to src/os_win.c.

   305    305   {
   306    306     static struct tm y;
   307    307     FILETIME uTm, lTm;
   308    308     SYSTEMTIME pTm;
   309    309     sqlite3_int64 t64;
   310    310     t64 = *t;
   311    311     t64 = (t64 + 11644473600)*10000000;
   312         -  uTm.dwLowDateTime = t64 & 0xFFFFFFFF;
   313         -  uTm.dwHighDateTime= t64 >> 32;
          312  +  uTm.dwLowDateTime = (DWORD)(t64 & 0xFFFFFFFF);
          313  +  uTm.dwHighDateTime= (DWORD)(t64 >> 32);
   314    314     FileTimeToLocalFileTime(&uTm,&lTm);
   315    315     FileTimeToSystemTime(&lTm,&pTm);
   316    316     y.tm_year = pTm.wYear - 1900;
   317    317     y.tm_mon = pTm.wMonth - 1;
   318    318     y.tm_wday = pTm.wDayOfWeek;
   319    319     y.tm_mday = pTm.wDay;
   320    320     y.tm_hour = pTm.wHour;
................................................................................
   326    326   /* This will never be called, but defined to make the code compile */
   327    327   #define GetTempPathA(a,b)
   328    328   
   329    329   #define LockFile(a,b,c,d,e)       winceLockFile(&a, b, c, d, e)
   330    330   #define UnlockFile(a,b,c,d,e)     winceUnlockFile(&a, b, c, d, e)
   331    331   #define LockFileEx(a,b,c,d,e,f)   winceLockFileEx(&a, b, c, d, e, f)
   332    332   
   333         -#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-offsetof(winFile,h)]
          333  +#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
   334    334   
   335    335   /*
   336    336   ** Acquire a lock on the handle h
   337    337   */
   338    338   static void winceMutexAcquire(HANDLE h){
   339    339      DWORD dwErr;
   340    340      do {
................................................................................
   465    465     DWORD dwFileOffsetHigh,
   466    466     DWORD nNumberOfBytesToLockLow,
   467    467     DWORD nNumberOfBytesToLockHigh
   468    468   ){
   469    469     winFile *pFile = HANDLE_TO_WINFILE(phFile);
   470    470     BOOL bReturn = FALSE;
   471    471   
          472  +  UNUSED_PARAMETER(dwFileOffsetHigh);
          473  +  UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
          474  +
   472    475     if (!pFile->hMutex) return TRUE;
   473    476     winceMutexAcquire(pFile->hMutex);
   474    477   
   475    478     /* Wanting an exclusive lock? */
   476    479     if (dwFileOffsetLow == SHARED_FIRST
   477    480          && nNumberOfBytesToLockLow == SHARED_SIZE){
   478    481       if (pFile->shared->nReaders == 0 && pFile->shared->bExclusive == 0){
................................................................................
   526    529     DWORD dwFileOffsetHigh,
   527    530     DWORD nNumberOfBytesToUnlockLow,
   528    531     DWORD nNumberOfBytesToUnlockHigh
   529    532   ){
   530    533     winFile *pFile = HANDLE_TO_WINFILE(phFile);
   531    534     BOOL bReturn = FALSE;
   532    535   
          536  +  UNUSED_PARAMETER(dwFileOffsetHigh);
          537  +  UNUSED_PARAMETER(nNumberOfBytesToUnlockHigh);
          538  +
   533    539     if (!pFile->hMutex) return TRUE;
   534    540     winceMutexAcquire(pFile->hMutex);
   535    541   
   536    542     /* Releasing a reader lock or an exclusive lock */
   537         -  if (dwFileOffsetLow >= SHARED_FIRST &&
   538         -       dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE){
          543  +  if (dwFileOffsetLow == SHARED_FIRST){
   539    544       /* Did we have an exclusive lock? */
   540    545       if (pFile->local.bExclusive){
          546  +      assert(nNumberOfBytesToUnlockLow == SHARED_SIZE);
   541    547         pFile->local.bExclusive = FALSE;
   542    548         pFile->shared->bExclusive = FALSE;
   543    549         bReturn = TRUE;
   544    550       }
   545    551   
   546    552       /* Did we just have a reader lock? */
   547    553       else if (pFile->local.nReaders){
          554  +      assert(nNumberOfBytesToUnlockLow == 1);
   548    555         pFile->local.nReaders --;
   549    556         if (pFile->local.nReaders == 0)
   550    557         {
   551    558           pFile->shared->nReaders --;
   552    559         }
   553    560         bReturn = TRUE;
   554    561       }
................................................................................
   582    589     HANDLE *phFile,
   583    590     DWORD dwFlags,
   584    591     DWORD dwReserved,
   585    592     DWORD nNumberOfBytesToLockLow,
   586    593     DWORD nNumberOfBytesToLockHigh,
   587    594     LPOVERLAPPED lpOverlapped
   588    595   ){
          596  +  UNUSED_PARAMETER(dwReserved);
          597  +  UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
          598  +
   589    599     /* If the caller wants a shared read lock, forward this call
   590    600     ** to winceLockFile */
   591    601     if (lpOverlapped->Offset == SHARED_FIRST &&
   592    602         dwFlags == 1 &&
   593    603         nNumberOfBytesToLockLow == SHARED_SIZE){
   594    604       return winceLockFile(phFile, SHARED_FIRST, 0, 1, 0);
   595    605     }
................................................................................
  1588   1598   ** file.
  1589   1599   */
  1590   1600   static int getSectorSize(
  1591   1601       sqlite3_vfs *pVfs,
  1592   1602       const char *zRelative     /* UTF-8 file name */
  1593   1603   ){
  1594   1604     DWORD bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
         1605  +  /* GetDiskFreeSpace is not supported under WINCE */
         1606  +#if SQLITE_OS_WINCE
         1607  +  UNUSED_PARAMETER(pVfs);
         1608  +  UNUSED_PARAMETER(zRelative);
         1609  +#else
  1595   1610     char zFullpath[MAX_PATH+1];
  1596   1611     int rc;
  1597         -  DWORD dwRet = 0, dwDummy;
         1612  +  DWORD dwRet = 0;
         1613  +  DWORD dwDummy;
  1598   1614   
  1599   1615     /*
  1600   1616     ** We need to get the full path name of the file
  1601   1617     ** to get the drive letter to look up the sector
  1602   1618     ** size.
  1603   1619     */
  1604   1620     rc = winFullPathname(pVfs, zRelative, MAX_PATH, zFullpath);
................................................................................
  1616   1632             }
  1617   1633           }
  1618   1634           dwRet = GetDiskFreeSpaceW((WCHAR*)zConverted,
  1619   1635                                     &dwDummy,
  1620   1636                                     &bytesPerSector,
  1621   1637                                     &dwDummy,
  1622   1638                                     &dwDummy);
  1623         -#if SQLITE_OS_WINCE==0
  1624   1639         }else{
  1625   1640           /* trim path to just drive reference */
  1626   1641           CHAR *p = (CHAR *)zConverted;
  1627   1642           for(;*p;p++){
  1628   1643             if( *p == '\\' ){
  1629   1644               *p = '\0';
  1630   1645               break;
................................................................................
  1631   1646             }
  1632   1647           }
  1633   1648           dwRet = GetDiskFreeSpaceA((CHAR*)zConverted,
  1634   1649                                     &dwDummy,
  1635   1650                                     &bytesPerSector,
  1636   1651                                     &dwDummy,
  1637   1652                                     &dwDummy);
  1638         -#endif
  1639   1653         }
  1640   1654         free(zConverted);
  1641   1655       }
  1642   1656       if( !dwRet ){
  1643   1657         bytesPerSector = SQLITE_DEFAULT_SECTOR_SIZE;
  1644   1658       }
  1645   1659     }
         1660  +#endif
  1646   1661     return (int) bytesPerSector; 
  1647   1662   }
  1648   1663   
  1649   1664   #ifndef SQLITE_OMIT_LOAD_EXTENSION
  1650   1665   /*
  1651   1666   ** Interfaces for opening a shared library, finding entry points
  1652   1667   ** within the shared library, and closing the shared library.

test/progress.test became a regular file.


tool/mkopts.tcl became a regular file.