/ Check-in [f42ec993]
Login

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

Overview
Comment:Fixed some warnings and an assert in the WINCE code when compiling under MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f42ec993ac9d42ca31305f26b09924108c36d9f4
User & Date: shane 2009-09-10 20:23:30
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-09-10
22:30
Omit the mutexIsInit test variable when mutexes are disabled. check-in: 3ea10434 user: drh tags: trunk
20:23
Fixed some warnings and an assert in the WINCE code when compiling under MSVC. check-in: f42ec993 user: shane tags: trunk
19:20
Make sure the threadsOverrideEachOthersLocks variable is only referenced by linux systems on a threadsafe compile. check-in: e9d064bd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/date.c.

   444    444     } else {
   445    445       int s = (int)(x.s + 0.5);
   446    446       x.s = s;
   447    447     }
   448    448     x.tz = 0;
   449    449     x.validJD = 0;
   450    450     computeJD(&x);
   451         -  t = x.iJD/1000 - 21086676*(i64)10000;
          451  +  t = (time_t)(x.iJD/1000 - 21086676*(i64)10000);
   452    452   #ifdef HAVE_LOCALTIME_R
   453    453     {
   454    454       struct tm sLocal;
   455    455       localtime_r(&t, &sLocal);
   456    456       y.Y = sLocal.tm_year + 1900;
   457    457       y.M = sLocal.tm_mon + 1;
   458    458       y.D = sLocal.tm_mday;

Changes to src/os_win.c.

   470    470     UNUSED_PARAMETER(dwFileOffsetHigh);
   471    471     UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
   472    472   
   473    473     if (!pFile->hMutex) return TRUE;
   474    474     winceMutexAcquire(pFile->hMutex);
   475    475   
   476    476     /* Wanting an exclusive lock? */
   477         -  if (dwFileOffsetLow == SHARED_FIRST
   478         -       && nNumberOfBytesToLockLow == SHARED_SIZE){
          477  +  if (dwFileOffsetLow == (DWORD)SHARED_FIRST
          478  +       && nNumberOfBytesToLockLow == (DWORD)SHARED_SIZE){
   479    479       if (pFile->shared->nReaders == 0 && pFile->shared->bExclusive == 0){
   480    480          pFile->shared->bExclusive = TRUE;
   481    481          pFile->local.bExclusive = TRUE;
   482    482          bReturn = TRUE;
   483    483       }
   484    484     }
   485    485   
   486    486     /* Want a read-only lock? */
   487         -  else if (dwFileOffsetLow == SHARED_FIRST &&
          487  +  else if (dwFileOffsetLow == (DWORD)SHARED_FIRST &&
   488    488              nNumberOfBytesToLockLow == 1){
   489    489       if (pFile->shared->bExclusive == 0){
   490    490         pFile->local.nReaders ++;
   491    491         if (pFile->local.nReaders == 1){
   492    492           pFile->shared->nReaders ++;
   493    493         }
   494    494         bReturn = TRUE;
   495    495       }
   496    496     }
   497    497   
   498    498     /* Want a pending lock? */
   499         -  else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToLockLow == 1){
          499  +  else if (dwFileOffsetLow == (DWORD)PENDING_BYTE && nNumberOfBytesToLockLow == 1){
   500    500       /* If no pending lock has been acquired, then acquire it */
   501    501       if (pFile->shared->bPending == 0) {
   502    502         pFile->shared->bPending = TRUE;
   503    503         pFile->local.bPending = TRUE;
   504    504         bReturn = TRUE;
   505    505       }
   506    506     }
   507    507   
   508    508     /* Want a reserved lock? */
   509         -  else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToLockLow == 1){
          509  +  else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE && nNumberOfBytesToLockLow == 1){
   510    510       if (pFile->shared->bReserved == 0) {
   511    511         pFile->shared->bReserved = TRUE;
   512    512         pFile->local.bReserved = TRUE;
   513    513         bReturn = TRUE;
   514    514       }
   515    515     }
   516    516   
................................................................................
   534    534     UNUSED_PARAMETER(dwFileOffsetHigh);
   535    535     UNUSED_PARAMETER(nNumberOfBytesToUnlockHigh);
   536    536   
   537    537     if (!pFile->hMutex) return TRUE;
   538    538     winceMutexAcquire(pFile->hMutex);
   539    539   
   540    540     /* Releasing a reader lock or an exclusive lock */
   541         -  if (dwFileOffsetLow == SHARED_FIRST){
          541  +  if (dwFileOffsetLow == (DWORD)SHARED_FIRST){
   542    542       /* Did we have an exclusive lock? */
   543    543       if (pFile->local.bExclusive){
   544         -      assert(nNumberOfBytesToUnlockLow == SHARED_SIZE);
          544  +      assert(nNumberOfBytesToUnlockLow == (DWORD)SHARED_SIZE);
   545    545         pFile->local.bExclusive = FALSE;
   546    546         pFile->shared->bExclusive = FALSE;
   547    547         bReturn = TRUE;
   548    548       }
   549    549   
   550    550       /* Did we just have a reader lock? */
   551    551       else if (pFile->local.nReaders){
   552         -      assert(nNumberOfBytesToUnlockLow == 1);
          552  +      assert(nNumberOfBytesToUnlockLow == (DWORD)SHARED_SIZE || nNumberOfBytesToUnlockLow == 1);
   553    553         pFile->local.nReaders --;
   554    554         if (pFile->local.nReaders == 0)
   555    555         {
   556    556           pFile->shared->nReaders --;
   557    557         }
   558    558         bReturn = TRUE;
   559    559       }
   560    560     }
   561    561   
   562    562     /* Releasing a pending lock */
   563         -  else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToUnlockLow == 1){
          563  +  else if (dwFileOffsetLow == (DWORD)PENDING_BYTE && nNumberOfBytesToUnlockLow == 1){
   564    564       if (pFile->local.bPending){
   565    565         pFile->local.bPending = FALSE;
   566    566         pFile->shared->bPending = FALSE;
   567    567         bReturn = TRUE;
   568    568       }
   569    569     }
   570    570     /* Releasing a reserved lock */
   571         -  else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToUnlockLow == 1){
          571  +  else if (dwFileOffsetLow == (DWORD)RESERVED_BYTE && nNumberOfBytesToUnlockLow == 1){
   572    572       if (pFile->local.bReserved) {
   573    573         pFile->local.bReserved = FALSE;
   574    574         pFile->shared->bReserved = FALSE;
   575    575         bReturn = TRUE;
   576    576       }
   577    577     }
   578    578   
................................................................................
   592    592     LPOVERLAPPED lpOverlapped
   593    593   ){
   594    594     UNUSED_PARAMETER(dwReserved);
   595    595     UNUSED_PARAMETER(nNumberOfBytesToLockHigh);
   596    596   
   597    597     /* If the caller wants a shared read lock, forward this call
   598    598     ** to winceLockFile */
   599         -  if (lpOverlapped->Offset == SHARED_FIRST &&
          599  +  if (lpOverlapped->Offset == (DWORD)SHARED_FIRST &&
   600    600         dwFlags == 1 &&
   601         -      nNumberOfBytesToLockLow == SHARED_SIZE){
          601  +      nNumberOfBytesToLockLow == (DWORD)SHARED_SIZE){
   602    602       return winceLockFile(phFile, SHARED_FIRST, 0, 1, 0);
   603    603     }
   604    604     return FALSE;
   605    605   }
   606    606   /*
   607    607   ** End of the special code for wince
   608    608   *****************************************************************************/