/ Check-in [360c0fd1]
Login

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

Overview
Comment:Fix several harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | winPreCache
Files: files | file ages | folders
SHA1: 360c0fd1cf9db5f1e4f670a4b95971daaeaa5879
User & Date: mistachkin 2014-05-09 00:36:06
Context
2014-05-09
00:36
Fix several harmless compiler warnings. Closed-Leaf check-in: 360c0fd1 user: mistachkin tags: winPreCache
2014-05-08
22:15
Fix typos in logging code. check-in: dc7f84df user: mistachkin tags: winPreCache
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  3226   3226     DWORD dwAmt;
  3227   3227     DWORD nRead;
  3228   3228   
  3229   3229     if( !osDuplicateHandle(GetCurrentProcess(), pFile->h, GetCurrentProcess(),
  3230   3230                            &dupHandle, 0, FALSE, DUPLICATE_SAME_ACCESS) ){
  3231   3231       pFile->lastErrno = osGetLastError();
  3232   3232       OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR\n", dupHandle));
  3233         -    return winLogError(SQLITE_IOERR, pFile->lastErrno,
  3234         -                       "winPreCacheThread1", pFile->zPath);
         3233  +    return SQLITE_INT_TO_PTR(winLogError(SQLITE_IOERR, pFile->lastErrno,
         3234  +                                         "winPreCacheThread1", pFile->zPath));
  3235   3235     }
  3236   3236     dwSize = osSetFilePointer(dupHandle, 0, 0, FILE_END);
  3237   3237     if( (dwSize==INVALID_SET_FILE_POINTER
  3238   3238         && ((lastErrno = osGetLastError())!=NO_ERROR)) ){
  3239   3239       pFile->lastErrno = lastErrno;
  3240   3240       osCloseHandle(dupHandle);
  3241   3241       OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SEEK\n", dupHandle));
  3242         -    return winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
  3243         -                       "winPreCacheThread2", pFile->zPath);
         3242  +    return SQLITE_INT_TO_PTR(winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
         3243  +                                         "winPreCacheThread2", pFile->zPath));
  3244   3244     }
  3245   3245     dwRet = osSetFilePointer(dupHandle, 0, 0, FILE_BEGIN);
  3246   3246     if( (dwRet==INVALID_SET_FILE_POINTER
  3247   3247         && ((lastErrno = osGetLastError())!=NO_ERROR)) ){
  3248   3248       pFile->lastErrno = lastErrno;
  3249   3249       osCloseHandle(dupHandle);
  3250   3250       OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SEEK\n", dupHandle));
  3251         -    return winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
  3252         -                       "winPreCacheThread3", pFile->zPath);
         3251  +    return SQLITE_INT_TO_PTR(winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
         3252  +                                         "winPreCacheThread3", pFile->zPath));
  3253   3253     }
  3254   3254     dwAmt = 4194304; /* TODO: Tuning. */
  3255   3255     if( dwSize<dwAmt ){
  3256   3256       dwAmt = dwSize;
  3257   3257     }
  3258   3258     pBuf = sqlite3MallocZero( dwAmt );
  3259   3259     if( pBuf==0 ){
  3260   3260       osCloseHandle(dupHandle);
  3261   3261       OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_NOMEM\n", dupHandle));
  3262         -    return SQLITE_IOERR_NOMEM;
         3262  +    return SQLITE_INT_TO_PTR(SQLITE_IOERR_NOMEM);
  3263   3263     }
  3264   3264     while( 1 ){
  3265   3265       if( !osReadFile(dupHandle, pBuf, dwAmt, &nRead, 0) ){
  3266   3266         pFile->lastErrno = osGetLastError();
  3267   3267         sqlite3_free(pBuf);
  3268   3268         osCloseHandle(dupHandle);
  3269   3269         OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_READ\n", dupHandle));
  3270         -      return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
  3271         -                         "winPreCacheThread4", pFile->zPath);
         3270  +      return SQLITE_INT_TO_PTR(winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
         3271  +                                           "winPreCacheThread4", pFile->zPath));
  3272   3272       }
  3273   3273       if( nRead<dwAmt ){
  3274   3274         sqlite3_free(pBuf);
  3275   3275         osCloseHandle(dupHandle);
  3276   3276         OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SHORT_READ\n", dupHandle));
  3277         -      return winLogError(SQLITE_IOERR_SHORT_READ, pFile->lastErrno,
  3278         -                         "winPreCacheThread5", pFile->zPath);
         3277  +      return SQLITE_INT_TO_PTR(winLogError(SQLITE_IOERR_SHORT_READ,
         3278  +                                           pFile->lastErrno,
         3279  +                                           "winPreCacheThread5", pFile->zPath));
  3279   3280       }
  3280   3281       dwSize -= dwAmt;
  3281   3282       if( dwSize==0 ){
  3282   3283         break;
  3283   3284       }
  3284   3285     }
  3285   3286     sqlite3_free(pBuf);
  3286   3287     osCloseHandle(dupHandle);
  3287         -  return SQLITE_OK;
         3288  +  return SQLITE_INT_TO_PTR(SQLITE_OK);
  3288   3289   }
  3289   3290   #endif
  3290   3291   
  3291   3292   /* 
  3292   3293   ** Windows will only let you create file view mappings
  3293   3294   ** on allocation size granularity boundaries.
  3294   3295   ** During sqlite3_os_init() we do a GetSystemInfo()