]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix some compiler warnings in fts5 code.
authordan <dan@noemail.net>
Fri, 11 Sep 2015 14:15:46 +0000 (14:15 +0000)
committerdan <dan@noemail.net>
Fri, 11 Sep 2015 14:15:46 +0000 (14:15 +0000)
FossilOrigin-Name: 0dc436116e55e3fd55eb6085ada71e099069b32d

ext/fts5/fts5Int.h
ext/fts5/fts5_expr.c
ext/fts5/fts5_index.c
ext/fts5/fts5_main.c
manifest
manifest.uuid

index c7f724eab3be4b7930b4f500209389a9918dd8e8..6f6f4ed7847d632f7e11e535440178257daad49e 100644 (file)
@@ -387,12 +387,6 @@ int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit);
 */
 int sqlite3Fts5IndexRollback(Fts5Index *p);
 
-/*
-** Retrieve and clear the current error code, respectively.
-*/
-int sqlite3Fts5IndexErrcode(Fts5Index*);
-void sqlite3Fts5IndexReset(Fts5Index*);
-
 /*
 ** Get or set the "averages" values.
 */
@@ -678,17 +672,6 @@ int sqlite3Fts5TokenizerInit(fts5_api*);
 ** End of interface to code in fts5_tokenizer.c.
 **************************************************************************/
 
-/**************************************************************************
-** Interface to code in fts5_sorter.c. 
-*/
-typedef struct Fts5Sorter Fts5Sorter;
-
-int sqlite3Fts5SorterNew(Fts5Expr *pExpr, Fts5Sorter **pp);
-
-/*
-** End of interface to code in fts5_sorter.c.
-**************************************************************************/
-
 /**************************************************************************
 ** Interface to code in fts5_vocab.c. 
 */
index 4cfc1b155c69c7406df2c78c152d2b25519bdddb..559f0db82b74ca4c0a7104c6574f661cdcc2272e 100644 (file)
@@ -947,7 +947,6 @@ static int fts5ExprNearNextMatch(
       for(j=0; j<pPhrase->nTerm; j++){
         Fts5ExprTerm *pTerm = &pPhrase->aTerm[j];
         if( pTerm->pSynonym ){
-          int bEof = 1;
           i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0);
           if( iRowid==iLast ) continue;
           bMatch = 0;
index cd3402418c3a2a9f7f2089a5b736a891f46d826b..f499d0c3898d163685dcfea8ccd4bf6057119e84 100644 (file)
@@ -737,7 +737,6 @@ static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){
   if( p->rc!=SQLITE_OK ) return;
 
   if( p->pWriter==0 ){
-    int rc = SQLITE_OK;
     Fts5Config *pConfig = p->pConfig;
     fts5IndexPrepareStmt(p, &p->pWriter, sqlite3_mprintf(
           "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", 
@@ -973,7 +972,6 @@ static Fts5Structure *fts5StructureRead(Fts5Index *p){
   Fts5Structure *pRet = 0;        /* Object to return */
   int iCookie;                    /* Configuration cookie */
   Fts5Data *pData;
-  Fts5Buffer buf = {0, 0, 0};
 
   pData = fts5DataRead(p, FTS5_STRUCTURE_ROWID);
   if( p->rc ) return 0;
@@ -1417,11 +1415,6 @@ static int fts5DlidxIterPgno(Fts5DlidxIter *pIter){
   return pIter->aLvl[0].iLeafPgno;
 }
 
-static void fts5LeafHeader(Fts5Data *pLeaf, int *piRowid, int *piTerm){
-  *piRowid = (int)fts5GetU16(&pLeaf->p[0]);
-  *piTerm = (int)fts5GetU16(&pLeaf->p[2]);
-}
-
 /*
 ** Load the next leaf page into the segment iterator.
 */
@@ -1827,7 +1820,6 @@ static void fts5SegIterNext(
             fts5DataRelease(pIter->pLeaf);
             pIter->pLeaf = 0;
           }else{
-            int nExtra;
             fts5SegIterLoadTerm(p, pIter, nKeep);
             fts5SegIterLoadNPos(p, pIter);
             if( pbNewTerm ) *pbNewTerm = 1;
@@ -1857,12 +1849,11 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){
     pgnoLast = fts5DlidxIterPgno(pDlidx);
     pLast = fts5DataRead(p, FTS5_SEGMENT_ROWID(iSegid, pgnoLast));
   }else{
-    int iOff;                               /* Byte offset within pLeaf */
     Fts5Data *pLeaf = pIter->pLeaf;         /* Current leaf data */
 
-    /* Currently, Fts5SegIter.iLeafOffset (and iOff) points to the first 
-    ** byte of position-list content for the current rowid. Back it up
-    ** so that it points to the start of the position-list size field. */
+    /* Currently, Fts5SegIter.iLeafOffset points to the first byte of
+    ** position-list content for the current rowid. Back it up so that it
+    ** points to the start of the position-list size field. */
     pIter->iLeafOffset -= sqlite3Fts5GetVarintLen(pIter->nPos*2+pIter->bDel);
 
     /* If this condition is true then the largest rowid for the current
@@ -1988,7 +1979,6 @@ static void fts5LeafSeek(
   int nMatch = 0;
   int nKeep = 0;
   int nNew = 0;
-  int iTerm = 0;
   int iTermOff;
   int iPgidx;                     /* Current offset in pgidx */
   int bEndOfPage = 0;
@@ -2048,7 +2038,6 @@ static void fts5LeafSeek(
     return;
   }else if( bEndOfPage ){
     do {
-      iTerm = 0;
       fts5SegIterNextPage(p, pIter);
       if( pIter->pLeaf==0 ) return;
       a = pIter->pLeaf->p;
@@ -3314,10 +3303,6 @@ static void fts5WriteAppendPoslistData(
   }
 }
 
-static void fts5WriteAppendZerobyte(Fts5Index *p, Fts5SegWriter *pWriter){
-  fts5BufferAppendVarint(&p->rc, &pWriter->writer.buf, 0);
-}
-
 /*
 ** Flush any data cached by the writer object to the database. Free any
 ** allocations associated with the writer.
@@ -3480,7 +3465,6 @@ static void fts5IndexMergeLevel(
   Fts5SegWriter writer;           /* Writer object */
   Fts5StructureSegment *pSeg;     /* Output segment */
   Fts5Buffer term;
-  int bRequireDoclistTerm = 0;    /* Doclist terminator (0x00) required */
   int bOldest;                    /* True if the output segment is the oldest */
 
   assert( iLvl<pStruct->nLevel );
@@ -3545,13 +3529,8 @@ static void fts5IndexMergeLevel(
       }
 
       /* This is a new term. Append a term to the output segment. */
-      /* TODO2: Doclist 0x00 term */
-      if( bRequireDoclistTerm ){
-        /* fts5WriteAppendZerobyte(p, &writer); */
-      }
       fts5WriteAppendTerm(p, &writer, nTerm, pTerm);
       fts5BufferSet(&p->rc, &term, nTerm, pTerm);
-      bRequireDoclistTerm = 1;
     }
 
     /* Append the rowid to the output */
@@ -3758,7 +3737,6 @@ static void fts5FlushOneHash(Fts5Index *p){
     Fts5StructureSegment *pSeg;   /* New segment within pStruct */
     Fts5Buffer *pBuf;             /* Buffer in which to assemble leaf page */
     Fts5Buffer *pPgidx;           /* Buffer in which to assemble pgidx */
-    const u8 *zPrev = 0;
 
     Fts5SegWriter writer;
     fts5WriteInit(p, &writer, iSegid);
@@ -3780,11 +3758,10 @@ static void fts5FlushOneHash(Fts5Index *p){
       const char *zTerm;          /* Buffer containing term */
       const u8 *pDoclist;         /* Pointer to doclist for this term */
       int nDoclist;               /* Size of doclist in bytes */
-      int nSuffix;                /* Size of term suffix */
 
       /* Write the term for this entry to disk. */
       sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist);
-      fts5WriteAppendTerm(p, &writer, strlen(zTerm), zTerm);
+      fts5WriteAppendTerm(p, &writer, strlen(zTerm), (const u8*)zTerm);
 
       if( writer.bFirstRowidInPage==0 
        && pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) 
@@ -3854,7 +3831,6 @@ static void fts5FlushOneHash(Fts5Index *p){
       /* TODO2: Doclist terminator written here. */
       /* pBuf->p[pBuf->n++] = '\0'; */
       assert( pBuf->n<=pBuf->nSpace );
-      zPrev = (const u8*)zTerm;
       sqlite3Fts5HashScanNext(pHash);
     }
     sqlite3Fts5HashClear(pHash);
@@ -4888,7 +4864,6 @@ static void fts5IndexIntegrityCheckEmpty(
 }
 
 static void fts5IntegrityCheckPgidx(Fts5Index *p, Fts5Data *pLeaf){
-  int nPg = (pLeaf->nn - pLeaf->szLeaf) / 2;
   int iTermOff = 0;
   int ii;
 
@@ -5476,7 +5451,7 @@ static void fts5RowidFunction(
     zArg = (const char*)sqlite3_value_text(apVal[0]);
     if( 0==sqlite3_stricmp(zArg, "segment") ){
       i64 iRowid;
-      int segid, height, pgno;
+      int segid, pgno;
       if( nArg!=3 ){
         sqlite3_result_error(pCtx, 
             "should be: fts5_rowid('segment', segid, pgno))", -1
index 2fd633bd28696e28a3015143a40343e3b691dfbc..5590816bc2d15ca5cd0dc39801bc7de4e64885a2 100644 (file)
 int sqlite3_fts5_may_be_corrupt = 1;
 
 
-typedef struct Fts5Table Fts5Table;
-typedef struct Fts5Cursor Fts5Cursor;
-typedef struct Fts5Auxiliary Fts5Auxiliary;
 typedef struct Fts5Auxdata Fts5Auxdata;
-
+typedef struct Fts5Auxiliary Fts5Auxiliary;
+typedef struct Fts5Cursor Fts5Cursor;
+typedef struct Fts5Sorter Fts5Sorter;
+typedef struct Fts5Table Fts5Table;
 typedef struct Fts5TokenizerModule Fts5TokenizerModule;
 
 /*
index 253acb782db138a887eaaca50d7281549a2313f4..5d0cbe90ef7779e7502225c6f82e134c8ebcc695 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Updates\sto\sthe\ssqlite3_value_subtype()\sand\ssqlite3_result_subtype()\ndocumentation\sand\sto\stest\scases\sfor\sjson1\sdealing\swith\sthose\sinterfaces.
-D 2015-09-11T01:22:41.498
+C Fix\ssome\scompiler\swarnings\sin\sfts5\scode.
+D 2015-09-11T14:15:46.470
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -106,14 +106,14 @@ F ext/fts3/unicode/mkunicode.tcl 95cf7ec186e48d4985e433ff8a1c89090a774252
 F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
 F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
 F ext/fts5/fts5.h f04659e0df5af83731b102189a32280f74f4a6bc
-F ext/fts5/fts5Int.h 81ba5e474979b166a52a8be306aa3b09d43a10e9
+F ext/fts5/fts5Int.h 666aba8432940a8449a3bd4636e898fe906ed95d
 F ext/fts5/fts5_aux.c 7a307760a9c57c750d043188ec0bad59f5b5ec7e
 F ext/fts5/fts5_buffer.c 64dcaf36a3ebda9e84b7c3b8788887ec325e12a4
 F ext/fts5/fts5_config.c 57ee5fe71578cb494574fc0e6e51acb9a22a8695
-F ext/fts5/fts5_expr.c a7726fe7045eec7caca8a074af747c8ea3545b83
+F ext/fts5/fts5_expr.c 667faaf14a69a5683ac383acdc8d942cf32c3f93
 F ext/fts5/fts5_hash.c 4bf4b99708848357b8a2b5819e509eb6d3df9246
-F ext/fts5/fts5_index.c 093e2e5936dab536cbe3e321bf4b53dda2b40547
-F ext/fts5/fts5_main.c 4b04c934084ea24a858438a04b5be8af3a9e0311
+F ext/fts5/fts5_index.c c07522cc5632d0d211402c0e6273ecb7493886d4
+F ext/fts5/fts5_main.c 3fa906f6c0177caf8f82862bc70f37b28bb3305c
 F ext/fts5/fts5_storage.c 120f7b143688b5b7710dacbd48cff211609b8059
 F ext/fts5/fts5_tcl.c 6da58d6e8f42a93c4486b5ba9b187a7f995dee37
 F ext/fts5/fts5_test_mi.c e96be827aa8f571031e65e481251dc1981d608bf
@@ -1386,7 +1386,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P db4152aef2253ed2a33e3cad01e0c6758e03f900
-R 1bba7f6a951d63c0429f61e7df8f5c7d
-U drh
-Z 186760bb5fa5f9976b74dfde02dde033
+P d6cadbe9fefce9a7af6b2d0cb83362f967d7d89a
+R 142f8055af436e9c39db41b2b1d79675
+U dan
+Z 56f93ac2844adc1c45e33937963b4c3d
index 11d07fd29a3846bee47649287c9501e36df3e2db..ecea4d71e9ebba38e0c9808b10caafb4021f5d54 100644 (file)
@@ -1 +1 @@
-d6cadbe9fefce9a7af6b2d0cb83362f967d7d89a
\ No newline at end of file
+0dc436116e55e3fd55eb6085ada71e099069b32d
\ No newline at end of file