/ Check-in [c7771c0b]
Login

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

Overview
Comment:Fix some warnings under MSVC in fts3 module.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c7771c0b22f2b45a47070cf84b9ecf1011e40404
User & Date: shaneh 2010-12-01 15:36:01
Context
2010-12-01
19:00
Change the type of a variable in struct SrcList so that it fits in a 100 byte lookaside buffer on a 64-bit architecture. check-in: 7df43f48 user: dan tags: trunk
15:36
Fix some warnings under MSVC in fts3 module. check-in: c7771c0b user: shaneh tags: trunk
11:46
Add test file e_resolve.test. check-in: 6858df9c user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

configure became a regular file.


Changes to ext/fts3/fts3.c.

   652    652     const char *zCsr = z;
   653    653   
   654    654     while( *zCsr!='=' ){
   655    655       if( *zCsr=='\0' ) return 0;
   656    656       zCsr++;
   657    657     }
   658    658   
   659         -  *pnKey = zCsr-z;
          659  +  *pnKey = (int)(zCsr-z);
   660    660     zValue = sqlite3_mprintf("%s", &zCsr[1]);
   661    661     if( zValue ){
   662    662       sqlite3Fts3Dequote(zValue);
   663    663     }
   664    664     *pzValue = zValue;
   665    665     return 1;
   666    666   }
................................................................................
   707    707     );
   708    708   
   709    709     nDb = (int)strlen(argv[1]) + 1;
   710    710     nName = (int)strlen(argv[2]) + 1;
   711    711   
   712    712     aCol = (const char **)sqlite3_malloc(sizeof(const char *) * (argc-2) );
   713    713     if( !aCol ) return SQLITE_NOMEM;
   714         -  memset(aCol, 0, sizeof(const char *) * (argc-2));
          714  +  memset((void *)aCol, 0, sizeof(const char *) * (argc-2));
   715    715   
   716    716     /* Loop through all of the arguments passed by the user to the FTS3/4
   717    717     ** module (i.e. all the column names and special arguments). This loop
   718    718     ** does the following:
   719    719     **
   720    720     **   + Figures out the number of columns the FTSX table will have, and
   721    721     **     the number of bytes of space that must be allocated to store copies
................................................................................
   839    839     fts3DatabasePageSize(&rc, p);
   840    840   
   841    841     /* Declare the table schema to SQLite. */
   842    842     fts3DeclareVtab(&rc, p);
   843    843   
   844    844   fts3_init_out:
   845    845   
   846         -  sqlite3_free(aCol);
          846  +  sqlite3_free((void *)aCol);
   847    847     if( rc!=SQLITE_OK ){
   848    848       if( p ){
   849    849         fts3DisconnectMethod((sqlite3_vtab *)p);
   850    850       }else if( pTokenizer ){
   851    851         pTokenizer->pModule->xDestroy(pTokenizer);
   852    852       }
   853    853     }else{
................................................................................
  2195   2195       while( p<aEnd ){
  2196   2196         sqlite3_int64 delta;
  2197   2197         p += sqlite3Fts3GetVarint(p, &delta);
  2198   2198         fts3PoslistCopy(0, &p);
  2199   2199         pOut += sqlite3Fts3PutVarint(pOut, delta);
  2200   2200       }
  2201   2201   
  2202         -    *pnList = (pOut - aList);
         2202  +    *pnList = (int)(pOut - aList);
  2203   2203     }
  2204   2204   }
  2205   2205   
  2206   2206   /* 
  2207   2207   ** Return a DocList corresponding to the phrase *pPhrase.
  2208   2208   **
  2209   2209   ** If this function returns SQLITE_OK, but *pnOut is set to a negative value,

Changes to ext/fts3/fts3_snippet.c.

  1028   1028     pRead += sqlite3Fts3GetVarint(pRead, &iRead);
  1029   1029     if( iRead==0 ){
  1030   1030       pIter->iCol = LCS_ITERATOR_FINISHED;
  1031   1031       rc = 1;
  1032   1032     }else{
  1033   1033       if( iRead==1 ){
  1034   1034         pRead += sqlite3Fts3GetVarint(pRead, &iRead);
  1035         -      pIter->iCol = iRead;
         1035  +      pIter->iCol = (int)iRead;
  1036   1036         pIter->iPos = pIter->iPosOffset;
  1037   1037         pRead += sqlite3Fts3GetVarint(pRead, &iRead);
  1038   1038         rc = 1;
  1039   1039       }
  1040         -    pIter->iPos += (iRead-2);
         1040  +    pIter->iPos += (int)(iRead-2);
  1041   1041     }
  1042   1042   
  1043   1043     pIter->pRead = pRead;
  1044   1044     return rc;
  1045   1045   }
  1046   1046     
  1047   1047   /*
................................................................................
  1182   1182   
  1183   1183             rc = fts3MatchinfoSelectDoctotal(pTab, &pSelect, &nDoc, &a);
  1184   1184             if( rc==SQLITE_OK ){
  1185   1185               int iCol;
  1186   1186               for(iCol=0; iCol<pInfo->nCol; iCol++){
  1187   1187                 sqlite3_int64 nToken;
  1188   1188                 a += sqlite3Fts3GetVarint(a, &nToken);
  1189         -              pInfo->aMatchinfo[iCol] = ((u32)(nToken&0xffffffff)+nDoc/2)/nDoc;
         1189  +              pInfo->aMatchinfo[iCol] = (u32)(((u32)(nToken&0xffffffff)+nDoc/2)/nDoc);
  1190   1190               }
  1191   1191             }
  1192   1192           }
  1193   1193           break;
  1194   1194   
  1195   1195         case FTS3_MATCHINFO_LENGTH: {
  1196   1196           sqlite3_stmt *pSelectDocsize = 0;
................................................................................
  1285   1285   
  1286   1286       /* Determine the number of integers in the buffer returned by this call. */
  1287   1287       for(i=0; zArg[i]; i++){
  1288   1288         nMatchinfo += fts3MatchinfoSize(&sInfo, zArg[i]);
  1289   1289       }
  1290   1290   
  1291   1291       /* Allocate space for Fts3Cursor.aMatchinfo[] and Fts3Cursor.zMatchinfo. */
  1292         -    nArg = strlen(zArg);
         1292  +    nArg = (int)strlen(zArg);
  1293   1293       pCsr->aMatchinfo = (u32 *)sqlite3_malloc(sizeof(u32)*nMatchinfo + nArg + 1);
  1294   1294       if( !pCsr->aMatchinfo ) return SQLITE_NOMEM;
  1295   1295   
  1296   1296       pCsr->zMatchinfo = (char *)&pCsr->aMatchinfo[nMatchinfo];
  1297   1297       pCsr->nMatchinfo = nMatchinfo;
  1298   1298       memcpy(pCsr->zMatchinfo, zArg, nArg+1);
  1299   1299       memset(pCsr->aMatchinfo, 0, sizeof(u32)*nMatchinfo);

Changes to ext/fts3/fts3_write.c.

  1112   1112             const char *pEnd = &a[sqlite3_column_bytes(pStmt, 0)];
  1113   1113             a += sqlite3Fts3GetVarint(a, &nDoc);
  1114   1114             while( a<pEnd ){
  1115   1115               a += sqlite3Fts3GetVarint(a, &nByte);
  1116   1116             }
  1117   1117           }
  1118   1118   
  1119         -        pCsr->nRowAvg = (((nByte / nDoc) + pgsz - 1) / pgsz);
         1119  +        pCsr->nRowAvg = (int)(((nByte / nDoc) + pgsz - 1) / pgsz);
  1120   1120         }
  1121   1121         rc = sqlite3_reset(pStmt);
  1122   1122         if( rc!=SQLITE_OK || pCsr->nRowAvg==0 ) return rc;
  1123   1123       }
  1124   1124   
  1125   1125       /* Assume that a blob flows over onto overflow pages if it is larger
  1126   1126       ** than (pgsz-35) bytes in size (the file-format documentation

install-sh became a regular file.