]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Updates to FTS3 to correct compiler warnings under MSVC.
authorshaneh <shaneh@noemail.net>
Thu, 3 Dec 2009 06:26:46 +0000 (06:26 +0000)
committershaneh <shaneh@noemail.net>
Thu, 3 Dec 2009 06:26:46 +0000 (06:26 +0000)
FossilOrigin-Name: 37495b55ffbdc2db4482367ac7d8e32d4d71d58e

12 files changed:
ext/fts3/fts3.c
ext/fts3/fts3Int.h
ext/fts3/fts3_expr.c
ext/fts3/fts3_hash.c
ext/fts3/fts3_hash.h
ext/fts3/fts3_porter.c
ext/fts3/fts3_snippet.c
ext/fts3/fts3_tokenizer.c
ext/fts3/fts3_tokenizer1.c
ext/fts3/fts3_write.c
manifest
manifest.uuid

index 7df78033715f6a4af7cfec880ecc18baf4aad68d..ad3cf6f77321c2d74d9e4735679ac56ee226773f 100644 (file)
@@ -447,7 +447,7 @@ void sqlite3Fts3Dequote(char *z){
   for(i=1, j=0; z[i]; i++){
     if( z[i]==quote ){
       if( z[i+1]==quote ){
-        z[j++] = quote;
+        z[j++] = (char)quote;
         i++;
       }else{
         z[j++] = 0;
@@ -653,8 +653,8 @@ int fts3InitVtab(
   const char *zTokenizer = 0;               /* Name of tokenizer to use */
   sqlite3_tokenizer *pTokenizer = 0;        /* Tokenizer for this table */
 
-  nDb = strlen(argv[1]) + 1;
-  nName = strlen(argv[2]) + 1;
+  nDb = (int)strlen(argv[1]) + 1;
+  nName = (int)strlen(argv[2]) + 1;
   for(i=3; i<argc; i++){
     char const *z = argv[i];
     rc = sqlite3Fts3InitTokenizer(pHash, z, &pTokenizer, &zTokenizer, pzErr);
@@ -662,7 +662,7 @@ int fts3InitVtab(
       return rc;
     }
     if( z!=zTokenizer ){
-      nString += strlen(z) + 1;
+      nString += (int)(strlen(z) + 1);
     }
   }
   nCol = argc - 3 - (zTokenizer!=0);
@@ -842,6 +842,8 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
 static int fts3OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){
   sqlite3_vtab_cursor *pCsr;               /* Allocated cursor */
 
+  UNUSED_PARAMETER(pVTab);
+
   /* Allocate a buffer large enough for an Fts3Cursor structure. If the
   ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, 
   ** if the allocation fails, return SQLITE_NOMEM.
@@ -1024,7 +1026,7 @@ static void fts3PoslistCopy(char **pp, char **ppPoslist){
   while( *pEnd | c ) c = *pEnd++ & 0x80;
   pEnd++;
   if( pp ){
-    int n = pEnd - *ppPoslist;
+    int n = (int)(pEnd - *ppPoslist);
     char *p = *pp;
     memcpy(p, *ppPoslist, n);
     p += n;
@@ -1038,7 +1040,7 @@ static void fts3ColumnlistCopy(char **pp, char **ppPoslist){
   char c = 0;
   while( 0xFE & (*pEnd | c) ) c = *pEnd++ & 0x80;
   if( pp ){
-    int n = pEnd - *ppPoslist;
+    int n = (int)(pEnd - *ppPoslist);
     char *p = *pp;
     memcpy(p, *ppPoslist, n);
     p += n;
@@ -1425,7 +1427,7 @@ static int fts3DoclistMerge(
       assert(!"Invalid mergetype value passed to fts3DoclistMerge()");
   }
 
-  *pnBuffer = (p-aBuffer);
+  *pnBuffer = (int)(p-aBuffer);
   return SQLITE_OK;
 }
 
@@ -1457,6 +1459,10 @@ static int fts3TermSelectCb(
   int nNew = pTS->nOutput + nDoclist;
   char *aNew = sqlite3_malloc(nNew);
 
+  UNUSED_PARAMETER(p);
+  UNUSED_PARAMETER(zTerm);
+  UNUSED_PARAMETER(nTerm);
+
   if( !aNew ){
     return SQLITE_NOMEM;
   }
@@ -1798,6 +1804,9 @@ static int fts3FilterMethod(
   Fts3Table *p = (Fts3Table *)pCursor->pVtab;
   Fts3Cursor *pCsr = (Fts3Cursor *)pCursor;
 
+  UNUSED_PARAMETER(idxStr);
+  UNUSED_PARAMETER(nVal);
+
   assert( idxNum>=0 && idxNum<=(FTS3_FULLTEXT_SEARCH+p->nColumn) );
   assert( nVal==0 || nVal==1 );
   assert( (nVal==0)==(idxNum==FTS3_FULLSCAN_SEARCH) );
@@ -1820,7 +1829,7 @@ static int fts3FilterMethod(
     sqlite3_free(zSql);
   }
   if( rc!=SQLITE_OK ) return rc;
-  pCsr->eSearch = idxNum;
+  pCsr->eSearch = (i16)idxNum;
 
   if( idxNum==FTS3_DOCID_SEARCH ){
     rc = sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]);
@@ -1930,6 +1939,7 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){
 ** Implementation of xBegin() method. This is a no-op.
 */
 static int fts3BeginMethod(sqlite3_vtab *pVtab){
+  UNUSED_PARAMETER(pVtab);
   assert( ((Fts3Table *)pVtab)->nPendingData==0 );
   return SQLITE_OK;
 }
@@ -1940,6 +1950,7 @@ static int fts3BeginMethod(sqlite3_vtab *pVtab){
 ** by fts3SyncMethod().
 */
 static int fts3CommitMethod(sqlite3_vtab *pVtab){
+  UNUSED_PARAMETER(pVtab);
   assert( ((Fts3Table *)pVtab)->nPendingData==0 );
   return SQLITE_OK;
 }
@@ -2018,6 +2029,8 @@ static void fts3OffsetsFunc(
 ){
   Fts3Cursor *pCsr;               /* Cursor handle passed through apVal[0] */
 
+  UNUSED_PARAMETER(nVal);
+
   assert( nVal==1 );
   if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return;
   assert( pCsr );
@@ -2042,6 +2055,8 @@ static void fts3OptimizeFunc(
   Fts3Table *p;                   /* Virtual table handle */
   Fts3Cursor *pCursor;            /* Cursor handle passed through apVal[0] */
 
+  UNUSED_PARAMETER(nVal);
+
   assert( nVal==1 );
   if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return;
   p = (Fts3Table *)pCursor->base.pVtab;
@@ -2082,6 +2097,11 @@ static int fts3FindFunctionMethod(
     { "optimize", fts3OptimizeFunc },
   };
   int i;                          /* Iterator variable */
+
+  UNUSED_PARAMETER(pVtab);
+  UNUSED_PARAMETER(nArg);
+  UNUSED_PARAMETER(ppArg);
+
   for(i=0; i<SizeofArray(aOverload); i++){
     if( strcmp(zName, aOverload[i].zName)==0 ){
       *pxFunc = aOverload[i].xFunc;
index 49323d68907e773de039383339c83af8a19416e5..a4aeb4374a7a65eb12b54048e15f907a71357a82 100644 (file)
 */
 #define FTS3_VARINT_MAX 10
 
+/*
+** This section provides definitions to allow the
+** FTS3 extension to be compiled outside of the 
+** amalgamation.
+*/
+#ifndef SQLITE_AMALGAMATION
 /*
 ** Macros indicating that conditional expressions are always true or
 ** false.
 */
-#ifndef SQLITE_AMALGAMATION
 # define ALWAYS(x) (x)
 # define NEVER(X)  (x)
+/*
+** Internal types used by SQLite.
+*/
 typedef unsigned char u8;         /* 1-byte (or larger) unsigned integer */
 typedef short int i16;            /* 2-byte (or larger) signed integer */
+/*
+** Macro used to suppress compiler warnings for unused parameters.
+*/
+#define UNUSED_PARAMETER(x) (void)(x)
 #endif
 
 typedef struct Fts3Table Fts3Table;
index 3c5538c32ae1052359eb80f70ac51b4389056af3..5b955f9cd55af8ead37272b32b8b9442ed77e7ba 100644 (file)
@@ -252,7 +252,7 @@ static int getNextString(
 
   if( rc==SQLITE_DONE ){
     int jj;
-    char *zNew;
+    char *zNew = NULL;
     int nNew = 0;
     int nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase);
     nByte += (p?(p->pPhrase->nToken-1):0) * sizeof(struct PhraseToken);
@@ -311,7 +311,7 @@ static int getNextNode(
   int *pnConsumed                         /* OUT: Number of bytes consumed */
 ){
   static const struct Fts3Keyword {
-    char z[4];                            /* Keyword text */
+    char *z;                              /* Keyword text */
     unsigned char n;                      /* Length of the keyword */
     unsigned char parenOnly;              /* Only valid in paren mode */
     unsigned char eType;                  /* Keyword code */
@@ -381,7 +381,7 @@ static int getNextNode(
         pRet->eType = pKey->eType;
         pRet->nNear = nNear;
         *ppExpr = pRet;
-        *pnConsumed = (zInput - z) + nKey;
+        *pnConsumed = (int)((zInput - z) + nKey);
         return SQLITE_OK;
       }
 
@@ -401,14 +401,14 @@ static int getNextNode(
       if( rc==SQLITE_OK && !*ppExpr ){
         rc = SQLITE_DONE;
       }
-      *pnConsumed = (zInput - z) + 1 + nConsumed;
+      *pnConsumed = (int)((zInput - z) + 1 + nConsumed);
       return rc;
     }
   
     /* Check for a close bracket. */
     if( *zInput==')' ){
       pParse->nNest--;
-      *pnConsumed = (zInput - z) + 1;
+      *pnConsumed = (int)((zInput - z) + 1);
       return SQLITE_DONE;
     }
   }
@@ -420,7 +420,7 @@ static int getNextNode(
   */
   if( *zInput=='"' ){
     for(ii=1; ii<nInput && zInput[ii]!='"'; ii++);
-    *pnConsumed = (zInput - z) + ii + 1;
+    *pnConsumed = (int)((zInput - z) + ii + 1);
     if( ii==nInput ){
       return SQLITE_ERROR;
     }
@@ -443,12 +443,12 @@ static int getNextNode(
   iColLen = 0;
   for(ii=0; ii<pParse->nCol; ii++){
     const char *zStr = pParse->azCol[ii];
-    int nStr = strlen(zStr);
+    int nStr = (int)strlen(zStr);
     if( nInput>nStr && zInput[nStr]==':' 
      && sqlite3_strnicmp(zStr, zInput, nStr)==0 
     ){
       iCol = ii;
-      iColLen = ((zInput - z) + nStr + 1);
+      iColLen = (int)((zInput - z) + nStr + 1);
       break;
     }
   }
@@ -714,7 +714,7 @@ int sqlite3Fts3ExprParse(
     return SQLITE_OK;
   }
   if( n<0 ){
-    n = strlen(z);
+    n = (int)strlen(z);
   }
   rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed);
 
@@ -769,7 +769,7 @@ static int queryTestTokenizer(
   sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
   if( SQLITE_ROW==sqlite3_step(pStmt) ){
     if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){
-      memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp));
+      memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp));
     }
   }
 
index 4a29604f23d8f1b31e2b435bea78dd4ade5af397..3cb91f3d2c18117bb9a612f6aacb219c07312aa9 100644 (file)
@@ -56,7 +56,7 @@ static void fts3HashFree(void *p){
 ** true if the hash table should make its own private copy of keys and
 ** false if it should just use the supplied pointer.
 */
-void sqlite3Fts3HashInit(Fts3Hash *pNew, int keyClass, int copyKey){
+void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){
   assert( pNew!=0 );
   assert( keyClass>=FTS3_HASH_STRING && keyClass<=FTS3_HASH_BINARY );
   pNew->keyClass = keyClass;
index 6080408fb318e9e96389fd1512ce4838c80a4abb..b00f365b096fc0c3296057b60e062b791f92d016 100644 (file)
@@ -71,7 +71,7 @@ struct Fts3HashElem {
 /*
 ** Access routines.  To delete, insert a NULL pointer.
 */
-void sqlite3Fts3HashInit(Fts3Hash*, int keytype, int copyKey);
+void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey);
 void *sqlite3Fts3HashInsert(Fts3Hash*, const void *pKey, int nKey, void *pData);
 void *sqlite3Fts3HashFind(const Fts3Hash*, const void *pKey, int nKey);
 void sqlite3Fts3HashClear(Fts3Hash*);
index b9153a48c2171ced4cda9f13483e6dd7b9cad282..4e68087299e76786744f28df195025a23093c273 100644 (file)
@@ -24,6 +24,7 @@
 */
 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
 
+#include "fts3Int.h"
 
 #include <assert.h>
 #include <stdlib.h>
@@ -54,10 +55,6 @@ typedef struct porter_tokenizer_cursor {
 } porter_tokenizer_cursor;
 
 
-/* Forward declaration */
-static const sqlite3_tokenizer_module porterTokenizerModule;
-
-
 /*
 ** Create a new tokenizer instance.
 */
@@ -66,6 +63,10 @@ static int porterCreate(
   sqlite3_tokenizer **ppTokenizer
 ){
   porter_tokenizer *t;
+
+  UNUSED_PARAMETER(argc);
+  UNUSED_PARAMETER(argv);
+
   t = (porter_tokenizer *) sqlite3_malloc(sizeof(*t));
   if( t==NULL ) return SQLITE_NOMEM;
   memset(t, 0, sizeof(*t));
@@ -94,6 +95,8 @@ static int porterOpen(
 ){
   porter_tokenizer_cursor *c;
 
+  UNUSED_PARAMETER(pTokenizer);
+
   c = (porter_tokenizer_cursor *) sqlite3_malloc(sizeof(*c));
   if( c==NULL ) return SQLITE_NOMEM;
 
@@ -294,7 +297,7 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
   int i, mx, j;
   int hasDigit = 0;
   for(i=0; i<nIn; i++){
-    int c = zIn[i];
+    char c = zIn[i];
     if( c>='A' && c<='Z' ){
       zOut[i] = c - 'A' + 'a';
     }else{
@@ -338,7 +341,7 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
 ** no chance of overflowing the zOut buffer.
 */
 static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
-  int i, j, c;
+  int i, j;
   char zReverse[28];
   char *z, *z2;
   if( nIn<3 || nIn>=sizeof(zReverse)-7 ){
@@ -348,7 +351,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
     return;
   }
   for(i=0, j=sizeof(zReverse)-6; i<nIn; i++, j--){
-    c = zIn[i];
+    char c = zIn[i];
     if( c>='A' && c<='Z' ){
       zReverse[j] = c + 'a' - 'A';
     }else if( c>='a' && c<='z' ){
@@ -547,7 +550,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
   /* z[] is now the stemmed word in reverse order.  Flip it back
   ** around into forward order and return.
   */
-  *pnOut = i = strlen(z);
+  *pnOut = i = (int)strlen(z);
   zOut[i] = 0;
   while( *z ){
     zOut[--i] = *(z++);
index 935bcecb621343451494a3911521d5396e23ddd3..cdc55aff461685cfb613da782b404295fbca200c 100644 (file)
@@ -78,7 +78,7 @@ static void fts3SnippetSbInit(StringBuffer *p){
 */
 static void fts3SnippetAppend(StringBuffer *p, const char *zNew, int nNew){
   if( p->z==0 ) return;
-  if( nNew<0 ) nNew = strlen(zNew);
+  if( nNew<0 ) nNew = (int)strlen(zNew);
   if( p->nUsed + nNew >= p->nAlloc ){
     int nAlloc;
     char *zNew;
@@ -155,11 +155,11 @@ static int snippetAppendMatch(
   }
   i = p->nMatch++;
   pMatch = &p->aMatch[i];
-  pMatch->iCol = iCol;
-  pMatch->iTerm = iTerm;
+  pMatch->iCol = (short)iCol;
+  pMatch->iTerm = (short)iTerm;
   pMatch->iToken = iToken;
   pMatch->iStart = iStart;
-  pMatch->nByte = nByte;
+  pMatch->nByte = (short)nByte;
   return SQLITE_OK;
 }
 
index 4846675266d915d658d44209b5562481ac86c7a3..cab6dcc383eb97d8e9a9057b83afb796ba091d18 100644 (file)
@@ -145,7 +145,7 @@ const char *sqlite3Fts3NextToken(const char *zStr, int *pn){
     }
   }
 
-  *pn = (z2-z1);
+  *pn = (int)(z2-z1);
   return z1;
 }
 
@@ -183,7 +183,7 @@ int sqlite3Fts3InitTokenizer(
   z[n] = '\0';
   sqlite3Fts3Dequote(z);
 
-  m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, z, strlen(z)+1);
+  m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, z, (int)strlen(z)+1);
   if( !m ){
     *pzErr = sqlite3_mprintf("unknown tokenizer: %s", z);
     rc = SQLITE_ERROR;
@@ -191,12 +191,12 @@ int sqlite3Fts3InitTokenizer(
     char const **aArg = 0;
     int iArg = 0;
     z = &z[n+1];
-    while( z<zEnd && (z = (char *)sqlite3Fts3NextToken(z, &n)) ){
+    while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
       int nNew = sizeof(char *)*(iArg+1);
-      char const **aNew = (const char **)sqlite3_realloc(aArg, nNew);
+      char const **aNew = (const char **)sqlite3_realloc((void *)aArg, nNew);
       if( !aNew ){
         sqlite3_free(zCopy);
-        sqlite3_free(aArg);
+        sqlite3_free((void *)aArg);
         return SQLITE_NOMEM;
       }
       aArg = aNew;
@@ -212,7 +212,7 @@ int sqlite3Fts3InitTokenizer(
     }else{
       (*ppTok)->pModule = m; 
     }
-    sqlite3_free(aArg);
+    sqlite3_free((void *)aArg);
   }
 
   sqlite3_free(zCopy);
@@ -380,7 +380,7 @@ int queryTokenizer(
   sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC);
   if( SQLITE_ROW==sqlite3_step(pStmt) ){
     if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){
-      memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp));
+      memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp));
     }
   }
 
@@ -417,6 +417,9 @@ static void intTestFunc(
   const sqlite3_tokenizer_module *p2;
   sqlite3 *db = (sqlite3 *)sqlite3_user_data(context);
 
+  UNUSED_PARAMETER(argc);
+  UNUSED_PARAMETER(argv);
+
   /* Test the query function */
   sqlite3Fts3SimpleTokenizerModule(&p1);
   rc = queryTokenizer(db, "simple", &p2);
@@ -476,13 +479,13 @@ int sqlite3Fts3InitHashTable(
   }
 #endif
 
-  if( rc!=SQLITE_OK
-   || (rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0))
-   || (rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0))
+  if( SQLITE_OK!=rc
+   || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0))
+   || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0))
 #ifdef SQLITE_TEST
-   || (rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0))
-   || (rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0))
-   || (rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0))
+   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0))
+   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0))
+   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0))
 #endif
   );
 
index da255d95a15f6d3c41131bf7e0b0b16f585f81d3..654e55ddecaabff7492631a9eff6342ecfbd8fca 100644 (file)
@@ -24,6 +24,7 @@
 */
 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
 
+#include "fts3Int.h"
 
 #include <assert.h>
 #include <stdlib.h>
@@ -49,9 +50,6 @@ typedef struct simple_tokenizer_cursor {
 } simple_tokenizer_cursor;
 
 
-/* Forward declaration */
-static const sqlite3_tokenizer_module simpleTokenizerModule;
-
 static int simpleDelim(simple_tokenizer *t, unsigned char c){
   return c<0x80 && t->delim[c];
 }
@@ -75,7 +73,7 @@ static int simpleCreate(
   ** information on the initial create.
   */
   if( argc>1 ){
-    int i, n = strlen(argv[1]);
+    int i, n = (int)strlen(argv[1]);
     for(i=0; i<n; i++){
       unsigned char ch = argv[1][i];
       /* We explicitly don't support UTF-8 delimiters for now. */
@@ -89,7 +87,7 @@ static int simpleCreate(
     /* Mark non-alphanumeric ASCII characters as delimiters */
     int i;
     for(i=1; i<0x80; i++){
-      t->delim[i] = !isalnum(i);
+      t->delim[i] = !isalnum(i) ? -1 : 0;
     }
   }
 
@@ -118,6 +116,8 @@ static int simpleOpen(
 ){
   simple_tokenizer_cursor *c;
 
+  UNUSED_PARAMETER(pTokenizer);
+
   c = (simple_tokenizer_cursor *) sqlite3_malloc(sizeof(*c));
   if( c==NULL ) return SQLITE_NOMEM;
 
@@ -191,7 +191,7 @@ static int simpleNext(
         ** case-insensitivity.
         */
         unsigned char ch = p[iStartOffset+i];
-        c->pToken[i] = ch<0x80 ? tolower(ch) : ch;
+        c->pToken[i] = (char)(ch<0x80 ? tolower(ch) : ch);
       }
       *ppToken = c->pToken;
       *pnBytes = n;
index 7673f2a09e3bdfcbafaea5cc20cae529d30750bf..3a2ed6e1667026f191dc1be5966e09143b64940c 100644 (file)
@@ -682,14 +682,14 @@ static int fts3SegmentMerge(Fts3Table *, int);
 static int fts3AllocateSegdirIdx(Fts3Table *p, int iLevel, int *piIdx){
   int rc;                         /* Return Code */
   sqlite3_stmt *pNextIdx;         /* Query for next idx at level iLevel */
-  int iNext;                      /* Result of query pNextIdx */
+  int iNext = 0;                  /* Result of query pNextIdx */
 
   /* Set variable iNext to the next available segdir index at level iLevel. */
   rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pNextIdx, 0);
   if( rc==SQLITE_OK ){
     sqlite3_bind_int(pNextIdx, 1, iLevel);
     if( SQLITE_ROW==sqlite3_step(pNextIdx) ){
-      iNext = sqlite3_column_int64(pNextIdx, 0);
+      iNext = sqlite3_column_int(pNextIdx, 0);
     }
     rc = sqlite3_reset(pNextIdx);
   }
@@ -807,7 +807,7 @@ static void fts3SegReaderNextDocid(
   */
   if( ppOffsetList ){
     *ppOffsetList = pReader->pOffsetList;
-    *pnOffsetList = p - pReader->pOffsetList - 1;
+    *pnOffsetList = (int)(p - pReader->pOffsetList - 1);
   }
 
   /* If there are no more entries in the doclist, set pOffsetList to
@@ -1160,6 +1160,7 @@ static int fts3PrefixCompress(
   int nNext                       /* Size of buffer zNext in bytes */
 ){
   int n;
+  UNUSED_PARAMETER(nNext);
   for(n=0; n<nPrev && zPrev[n]==zNext[n]; n++);
   return n;
 }
@@ -1520,10 +1521,10 @@ static int fts3SegWriterFlush(
 ){
   int rc;                         /* Return code */
   if( pWriter->pTree ){
-    sqlite3_int64 iLast;          /* Largest block id written to database */
+    sqlite3_int64 iLast = 0;      /* Largest block id written to database */
     sqlite3_int64 iLastLeaf;      /* Largest leaf block id written to db */
-    char *zRoot;                  /* Pointer to buffer containing root node */
-    int nRoot;                    /* Size of buffer zRoot */
+    char *zRoot = NULL;           /* Pointer to buffer containing root node */
+    int nRoot = 0;                /* Size of buffer zRoot */
 
     iLastLeaf = pWriter->iFree;
     rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, pWriter->nData);
@@ -1696,11 +1697,11 @@ static void fts3ColumnFilter(
     while( p<pEnd && (c | *p)&0xFE ) c = *p++ & 0x80;
   
     if( iCol==iCurrent ){
-      nList = (p - pList);
+      nList = (int)(p - pList);
       break;
     }
 
-    nList -= (p - pList);
+    nList -= (int)(p - pList);
     pList = p;
     if( nList==0 ){
       break;
@@ -2105,7 +2106,7 @@ int sqlite3Fts3UpdateMethod(
   Fts3Table *p = (Fts3Table *)pVtab;
   int rc = SQLITE_OK;             /* Return Code */
   int isRemove = 0;               /* True for an UPDATE or DELETE */
-  sqlite3_int64 iRemove;          /* Rowid removed by UPDATE or DELETE */
+  sqlite3_int64 iRemove = 0;      /* Rowid removed by UPDATE or DELETE */
 
   /* If this is a DELETE or UPDATE operation, remove the old record. */
   if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
index 76f37822cdbc12ab8a15a0d76bbef7dc5076582f..57e4923111e2bc8e2ddbf4a5090b685cc36e0c81 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\scouple\sof\scompiler\swarnings\sunder\sMSVC.
-D 2009-12-03T04:40:48
+C Updates\sto\sFTS3\sto\scorrect\scompiler\swarnings\sunder\sMSVC.
+D 2009-12-03T06:26:46
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -56,19 +56,19 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
 F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
-F ext/fts3/fts3.c eca3828c5ef6efd4297c8b917d69ec11b9d223a9
+F ext/fts3/fts3.c 8352dc3506c3b30fde126ea5da9c431d3c243522
 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
-F ext/fts3/fts3Int.h 7bc65d9ada6715ecd11ed83513013d4c7bbc2eeb
-F ext/fts3/fts3_expr.c bdf11f3602f62f36f0e42823680bf22033dae0de
-F ext/fts3/fts3_hash.c 29fba5a01e51c53e37040e53821e6b2cec18c8fb
-F ext/fts3/fts3_hash.h 39524725425078bf9e814e9569c74a8e5a21b9fb
+F ext/fts3/fts3Int.h 515132f0ae6b35eccbeef72a2bafb16d7e251953
+F ext/fts3/fts3_expr.c c18794a62c257d3456d3314c5a18e348ae0d84bd
+F ext/fts3/fts3_hash.c 18feef38fca216992725e9eae775a0c7735e6724
+F ext/fts3/fts3_hash.h d410ff2c93c81a56b927fcf07b2099ccbfa7a479
 F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295
-F ext/fts3/fts3_porter.c 4248815484f9c7e9d4f3c72c1149464485c08abe
-F ext/fts3/fts3_snippet.c 84ba2fad73aa12628f1950aed74babbf3975e73a
-F ext/fts3/fts3_tokenizer.c 17335e980994e112c5d332d5bc391f9089350761
+F ext/fts3/fts3_porter.c a651e287e02b49b565a6ccf9441959d434489156
+F ext/fts3/fts3_snippet.c 6c2eb6d872d66b2a9aa5663f2662e993f18a6496
+F ext/fts3/fts3_tokenizer.c 73a4e0e068720153901622f215298b73e7c976c7
 F ext/fts3/fts3_tokenizer.h 7ff73caa3327589bf6550f60d93ebdd1f6a0fb5c
-F ext/fts3/fts3_tokenizer1.c 0a5bcc579f35de5d24a9345d7908dc25ae403ee7
-F ext/fts3/fts3_write.c 5d3849443746f41ea4af96dac08d79f2bf75f204
+F ext/fts3/fts3_tokenizer1.c 11a604a53cff5e8c28882727bf794e5252e5227b
+F ext/fts3/fts3_write.c 6c59b1d6eed759815151298c132d79301c205fce
 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
 F ext/icu/README.txt 3b130aa66e7a681136f6add198b076a2f90d1e33
 F ext/icu/icu.c 12e763d288d23b5a49de37caa30737b971a2f1e2
@@ -775,7 +775,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 59e2e2c6301e189a1a6601c681bbb0937a5cd14e
-R 4cd225486b10b23f8eba14d67e73bbe4
+P e3aa0870fce0666bf8c67ad6ec23e135d03b604a
+R 8d9ad89e2fac8a1d1d94a1d048213789
 U shaneh
-Z ef9e7d1e0537cf470262f7210a98337f
+Z 7667ec8a886e15725b2ab6f5b341cdfd
index 5382ad62754da30bb1696e0178b796a724c31488..225ad7c04a54a8b964a1d7342bf0bbe90d6824d5 100644 (file)
@@ -1 +1 @@
-e3aa0870fce0666bf8c67ad6ec23e135d03b604a
\ No newline at end of file
+37495b55ffbdc2db4482367ac7d8e32d4d71d58e
\ No newline at end of file