/ Check-in [3de030c9]
Login

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

Overview
Comment:Fix some harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3de030c904d125ccf41fa1929646b8a002b5341b
User & Date: mistachkin 2015-07-14 17:18:05
Context
2015-07-14
21:56
Skip trying to include 'intrin.h' when compiling for WinCE with MSVC. check-in: 6db90ca2 user: mistachkin tags: trunk
17:18
Fix some harmless compiler warnings. check-in: 3de030c9 user: mistachkin tags: trunk
14:48
Always invoke the profile callback even if the statement does not run to completion. check-in: 202479aa user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_aux.c.

   251    251     sqlite3_value **apVal           /* Array of trailing arguments */
   252    252   ){
   253    253     HighlightContext ctx;
   254    254     int rc = SQLITE_OK;             /* Return code */
   255    255     int iCol;                       /* 1st argument to snippet() */
   256    256     const char *zEllips;            /* 4th argument to snippet() */
   257    257     int nToken;                     /* 5th argument to snippet() */
   258         -  int nInst;                      /* Number of instance matches this row */
          258  +  int nInst = 0;                  /* Number of instance matches this row */
   259    259     int i;                          /* Used to iterate through instances */
   260    260     int nPhrase;                    /* Number of phrases in query */
   261    261     unsigned char *aSeen;           /* Array of "seen instance" flags */
   262    262     int iBestCol;                   /* Column containing best snippet */
   263    263     int iBestStart = 0;             /* First token of best snippet */
   264    264     int iBestLast;                  /* Last token of best snippet */
   265    265     int nBestScore = 0;             /* Score of best snippet */
   266         -  int nColSize;                   /* Total size of iBestCol in tokens */
          266  +  int nColSize = 0;               /* Total size of iBestCol in tokens */
   267    267   
   268    268     if( nVal!=5 ){
   269    269       const char *zErr = "wrong number of arguments to function snippet()";
   270    270       sqlite3_result_error(pCtx, zErr, -1);
   271    271       return;
   272    272     }
   273    273   
................................................................................
   403    403   ){
   404    404     int rc = SQLITE_OK;             /* Return code */
   405    405     Fts5Bm25Data *p;                /* Object to return */
   406    406   
   407    407     p = pApi->xGetAuxdata(pFts, 0);
   408    408     if( p==0 ){
   409    409       int nPhrase;                  /* Number of phrases in query */
   410         -    sqlite3_int64 nRow;           /* Number of rows in table */
   411         -    sqlite3_int64 nToken;         /* Number of tokens in table */
          410  +    sqlite3_int64 nRow = 0;       /* Number of rows in table */
          411  +    sqlite3_int64 nToken = 0;     /* Number of tokens in table */
   412    412       int nByte;                    /* Bytes of space to allocate */
   413    413       int i;
   414    414   
   415    415       /* Allocate the Fts5Bm25Data object */
   416    416       nPhrase = pApi->xPhraseCount(pFts);
   417    417       nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
   418    418       p = (Fts5Bm25Data*)sqlite3_malloc(nByte);
................................................................................
   477    477   ){
   478    478     const double k1 = 1.2;          /* Constant "k1" from BM25 formula */
   479    479     const double b = 0.75;          /* Constant "b" from BM25 formula */
   480    480     int rc = SQLITE_OK;             /* Error code */
   481    481     double score = 0.0;             /* SQL function return value */
   482    482     Fts5Bm25Data *pData;            /* Values allocated/calculated once only */
   483    483     int i;                          /* Iterator variable */
   484         -  int nInst;                      /* Value returned by xInstCount() */
   485         -  double D;                       /* Total number of tokens in row */
   486         -  double *aFreq;                  /* Array of phrase freq. for current row */
          484  +  int nInst = 0;                  /* Value returned by xInstCount() */
          485  +  double D = 0.0;                 /* Total number of tokens in row */
          486  +  double *aFreq = 0;              /* Array of phrase freq. for current row */
   487    487   
   488    488     /* Calculate the phrase frequency (symbol "f(qi,D)" in the documentation)
   489    489     ** for each phrase in the query for the current row. */
   490    490     rc = fts5Bm25GetData(pApi, pFts, &pData);
   491    491     if( rc==SQLITE_OK ){
   492    492       aFreq = pData->aFreq;
   493    493       memset(aFreq, 0, sizeof(double) * pData->nPhrase);

Changes to ext/fts5/fts5_index.c.

   734    734       ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead.
   735    735       ** All the reasons those functions might return SQLITE_ERROR - missing
   736    736       ** table, missing row, non-blob/text in block column - indicate 
   737    737       ** backing store corruption.  */
   738    738       if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT;
   739    739   
   740    740       if( rc==SQLITE_OK ){
   741         -      u8 *aOut;                   /* Read blob data into this buffer */
          741  +      u8 *aOut = 0;               /* Read blob data into this buffer */
   742    742         int nByte = sqlite3_blob_bytes(p->pReader);
   743    743         if( pBuf ){
   744    744           fts5BufferSize(pBuf, MAX(nByte, p->pConfig->pgsz) + 20);
   745    745           pBuf->n = nByte;
   746    746           aOut = pBuf->p;
   747    747           if( aOut==0 ){
   748    748             rc = SQLITE_NOMEM;
................................................................................
  1194   1194     Fts5Index *p,                   /* FTS5 backend object */
  1195   1195     int iLvl,                       /* Index level just updated */
  1196   1196     Fts5Structure *pStruct          /* Index structure */
  1197   1197   ){
  1198   1198     if( p->rc==SQLITE_OK ){
  1199   1199       int iTst;
  1200   1200       int iPromote = -1;
  1201         -    int szPromote;                /* Promote anything this size or smaller */
         1201  +    int szPromote = 0;            /* Promote anything this size or smaller */
  1202   1202       Fts5StructureSegment *pSeg;   /* Segment just written */
  1203   1203       int szSeg;                    /* Size of segment just written */
  1204   1204   
  1205   1205   
  1206   1206       pSeg = &pStruct->aLevel[iLvl].aSeg[pStruct->aLevel[iLvl].nSeg-1];
  1207   1207       szSeg = (1 + pSeg->pgnoLast - pSeg->pgnoFirst);
  1208   1208   
................................................................................
  1859   1859               pIter->iLeafOffset += fts5GetVarint32(&a[iOff], nKeep);
  1860   1860             }
  1861   1861           }else{
  1862   1862             pIter->iRowid += iDelta;
  1863   1863           }
  1864   1864         }else if( pIter->pSeg==0 ){
  1865   1865           const u8 *pList = 0;
  1866         -        const char *zTerm;
  1867         -        int nList;
         1866  +        const char *zTerm = 0;
         1867  +        int nList = 0;
  1868   1868           if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){
  1869   1869             sqlite3Fts5HashScanNext(p->pHash);
  1870   1870             sqlite3Fts5HashScanEntry(p->pHash, &zTerm, &pList, &nList);
  1871   1871           }
  1872   1872           if( pList==0 ){
  1873   1873             fts5DataRelease(pIter->pLeaf);
  1874   1874             pIter->pLeaf = 0;
................................................................................
  2211   2211       p->rc = FTS5_CORRUPT;
  2212   2212       return;
  2213   2213     }
  2214   2214   
  2215   2215     while( 1 ){
  2216   2216       int i;
  2217   2217       int nCmp;
  2218         -    i64 rowid;
  2219   2218   
  2220   2219       /* Figure out how many new bytes are in this term */
  2221   2220       fts5IndexGetVarint32(a, iOff, nNew);
  2222   2221   
  2223   2222       if( nKeep<nMatch ){
  2224   2223         goto search_failed;
  2225   2224       }
................................................................................
  2320   2319     Fts5StructureSegment *pSeg,     /* Description of segment */
  2321   2320     Fts5SegIter *pIter              /* Object to populate */
  2322   2321   ){
  2323   2322     int iPg = 1;
  2324   2323     int h;
  2325   2324     int bGe = (flags & FTS5INDEX_QUERY_SCAN);
  2326   2325     int bDlidx = 0;                 /* True if there is a doclist-index */
  2327         -  Fts5Data *pLeaf;
  2328   2326   
  2329   2327     static int nCall = 0;
  2330   2328     nCall++;
  2331   2329   
  2332   2330     assert( bGe==0 || (flags & FTS5INDEX_QUERY_DESC)==0 );
  2333   2331     assert( pTerm && nTerm );
  2334   2332     memset(pIter, 0, sizeof(*pIter));

Changes to ext/fts5/fts5_main.c.

   357    357     const char * const *argv,       /* xCreate/xConnect argument array */
   358    358     sqlite3_vtab **ppVTab,          /* Write the resulting vtab structure here */
   359    359     char **pzErr                    /* Write any error message here */
   360    360   ){
   361    361     Fts5Global *pGlobal = (Fts5Global*)pAux;
   362    362     const char **azConfig = (const char**)argv;
   363    363     int rc = SQLITE_OK;             /* Return code */
   364         -  Fts5Config *pConfig;            /* Results of parsing argc/argv */
          364  +  Fts5Config *pConfig = 0;        /* Results of parsing argc/argv */
   365    365     Fts5Table *pTab = 0;            /* New virtual table object */
   366    366   
   367    367     /* Allocate the new vtab object and parse the configuration */
   368    368     pTab = (Fts5Table*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Table));
   369    369     if( rc==SQLITE_OK ){
   370    370       rc = sqlite3Fts5ConfigParse(pGlobal, db, argc, azConfig, &pConfig, pzErr);
   371    371       assert( (rc==SQLITE_OK && *pzErr==0) || pConfig==0 );
................................................................................
   752    752   **
   753    753   ** Return SQLITE_OK if nothing goes wrong.  SQLITE_OK is returned
   754    754   ** even if we reach end-of-file.  The fts5EofMethod() will be called
   755    755   ** subsequently to determine whether or not an EOF was hit.
   756    756   */
   757    757   static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){
   758    758     Fts5Cursor *pCsr = (Fts5Cursor*)pCursor;
   759         -  int rc;
          759  +  int rc = SQLITE_OK;
   760    760   
   761    761     assert( (pCsr->ePlan<2)==
   762    762             (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) 
   763    763     );
   764    764   
   765    765     if( pCsr->ePlan<2 ){
   766    766       int bSkip = 0;

Changes to ext/fts5/fts5_storage.c.

   497    497   
   498    498   /*
   499    499   ** Remove a row from the FTS table.
   500    500   */
   501    501   int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel){
   502    502     Fts5Config *pConfig = p->pConfig;
   503    503     int rc;
   504         -  sqlite3_stmt *pDel;
          504  +  sqlite3_stmt *pDel = 0;
   505    505   
   506    506     rc = fts5StorageLoadTotals(p, 1);
   507    507   
   508    508     /* Delete the index records */
   509    509     if( rc==SQLITE_OK ){
   510    510       rc = fts5StorageDeleteFromIndex(p, iDel);
   511    511     }
................................................................................
   541    541   int sqlite3Fts5StorageSpecialDelete(
   542    542     Fts5Storage *p, 
   543    543     i64 iDel, 
   544    544     sqlite3_value **apVal
   545    545   ){
   546    546     Fts5Config *pConfig = p->pConfig;
   547    547     int rc;
   548         -  sqlite3_stmt *pDel;
          548  +  sqlite3_stmt *pDel = 0;
   549    549   
   550    550     assert( pConfig->eContent!=FTS5_CONTENT_NORMAL );
   551    551     rc = fts5StorageLoadTotals(p, 1);
   552    552   
   553    553     /* Delete the index records */
   554    554     if( rc==SQLITE_OK ){
   555    555       int iCol;
................................................................................
   715    715     Fts5Storage *p,                 /* Storage module to write to */
   716    716     sqlite3_value **apVal,          /* Array of values passed to xUpdate() */
   717    717     int eConflict,                  /* on conflict clause */
   718    718     i64 *piRowid                    /* OUT: rowid of new record */
   719    719   ){
   720    720     Fts5Config *pConfig = p->pConfig;
   721    721     int rc = SQLITE_OK;             /* Return code */
   722         -  sqlite3_stmt *pInsert;          /* Statement used to write %_content table */
          722  +  sqlite3_stmt *pInsert = 0;      /* Statement used to write %_content table */
   723    723     int eStmt = 0;                  /* Type of statement used on %_content */
   724    724     int i;                          /* Counter variable */
   725    725     Fts5InsertCtx ctx;              /* Tokenization callback context object */
   726    726     Fts5Buffer buf;                 /* Buffer used to build up %_docsize blob */
   727    727   
   728    728     memset(&buf, 0, sizeof(Fts5Buffer));
   729    729     rc = fts5StorageLoadTotals(p, 1);

Changes to src/btree.c.

  8955   8955     u32 usableSize;          /* Usable size of the page */
  8956   8956     u32 contentOffset;       /* Offset to the start of the cell content area */
  8957   8957     u32 *heap = 0;           /* Min-heap used for checking cell coverage */
  8958   8958     u32 x, prev = 0;         /* Next and previous entry on the min-heap */
  8959   8959     const char *saved_zPfx = pCheck->zPfx;
  8960   8960     int saved_v1 = pCheck->v1;
  8961   8961     int saved_v2 = pCheck->v2;
  8962         -  u8 savedIsInit;
         8962  +  u8 savedIsInit = 0;
  8963   8963   
  8964   8964     /* Check that the page exists
  8965   8965     */
  8966   8966     pBt = pCheck->pBt;
  8967   8967     usableSize = pBt->usableSize;
  8968   8968     if( iPage==0 ) return 0;
  8969   8969     if( checkRef(pCheck, iPage) ) return 0;