/ Check-in [b951c867]
Login

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

Overview
Comment:Fix some MSVC compiler warnings in the ASYNC extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b951c8675df3e719c30a1dd94200b7c04252a3ea
User & Date: shaneh 2010-07-07 16:49:46
Context
2010-07-07
16:51
When using MSVC to build test code, suppress the popup dialog when abort is called from the sqlite_abort() test function. check-in: 55d3d39f user: shaneh tags: trunk
16:49
Fix some MSVC compiler warnings in the ASYNC extension. check-in: b951c867 user: shaneh tags: trunk
16:23
Merge together another accidental fork. check-in: c41f04ed user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/async/sqlite3async.c.

   686    686       sqlite3_int64 nRead;
   687    687       rc = pBase->pMethods->xFileSize(pBase, &filesize);
   688    688       if( rc!=SQLITE_OK ){
   689    689         goto asyncread_out;
   690    690       }
   691    691       nRead = MIN(filesize - iOffset, iAmt64);
   692    692       if( nRead>0 ){
   693         -      rc = pBase->pMethods->xRead(pBase, zOut, nRead, iOffset);
          693  +      rc = pBase->pMethods->xRead(pBase, zOut, (int)nRead, iOffset);
   694    694         ASYNC_TRACE(("READ %s %d bytes at %d\n", p->zName, nRead, iOffset));
   695    695       }
   696    696     }
   697    697   
   698    698     if( rc==SQLITE_OK ){
   699    699       AsyncWrite *pWrite;
   700    700       char *zName = p->zName;
................................................................................
   702    702       for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){
   703    703         if( pWrite->op==ASYNC_WRITE && (
   704    704           (pWrite->pFileData==p) ||
   705    705           (zName && pWrite->pFileData->zName==zName)
   706    706         )){
   707    707           sqlite3_int64 nCopy;
   708    708           sqlite3_int64 nByte64 = (sqlite3_int64)pWrite->nByte;
   709         -        filesize = MAX(filesize, pWrite->iOffset+nByte64);
   710    709   
   711    710           /* Set variable iBeginIn to the offset in buffer pWrite->zBuf[] from
   712    711           ** which data should be copied. Set iBeginOut to the offset within
   713    712           ** the output buffer to which data should be copied. If either of
   714    713           ** these offsets is a negative number, set them to 0.
   715    714           */
   716    715           sqlite3_int64 iBeginOut = (pWrite->iOffset-iOffset);
   717    716           sqlite3_int64 iBeginIn = -iBeginOut;
   718    717           if( iBeginIn<0 ) iBeginIn = 0;
   719    718           if( iBeginOut<0 ) iBeginOut = 0;
   720    719   
          720  +        filesize = MAX(filesize, pWrite->iOffset+nByte64);
          721  +
   721    722           nCopy = MIN(nByte64-iBeginIn, iAmt64-iBeginOut);
   722    723           if( nCopy>0 ){
   723         -          memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy);
          724  +          memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], (size_t)nCopy);
   724    725             ASYNC_TRACE(("OVERREAD %d bytes at %d\n", nCopy, iBeginOut+iOffset));
   725    726           }
   726    727         }
   727    728       }
   728    729     }
   729    730   
   730    731   asyncread_out:
................................................................................
  1232   1233     /* Because of the way intra-process file locking works, this backend
  1233   1234     ** needs to return a canonical path. The following block assumes the
  1234   1235     ** file-system uses unix style paths. 
  1235   1236     */
  1236   1237     if( rc==SQLITE_OK ){
  1237   1238       int i, j;
  1238   1239       char *z = zPathOut;
  1239         -    int n = strlen(z);
         1240  +    int n = (int)strlen(z);
  1240   1241       while( n>1 && z[n-1]=='/' ){ n--; }
  1241   1242       for(i=j=0; i<n; i++){
  1242   1243         if( z[i]=='/' ){
  1243   1244           if( z[i+1]=='/' ) continue;
  1244   1245           if( z[i+1]=='.' && i+2<n && z[i+2]=='/' ){
  1245   1246             i += 1;
  1246   1247             continue;