/ Check-in [3be336aa]
Login

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

Overview
Comment:Fix some signed/unsigned comparison compiler warnings in fts5.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3be336aa893f9eb0837d7d66c83bab1489792b9a
User & Date: dan 2016-01-23 15:57:06
Context
2016-01-23
18:24
Changes to spellfix to try to get it to use stack space instead of heap space in cases where that makes sense. check-in: dfcebc73 user: drh tags: trunk
16:20
Merge trunk changes (including fixes for warnings in fts5) with this branch. check-in: ceccc9ad user: dan tags: fts5-perf
15:57
Fix some signed/unsigned comparison compiler warnings in fts5. check-in: 3be336aa user: dan tags: trunk
14:05
Remove an assert() that can be false if compiled with SQLITE_USE_ALLOCA. check-in: f0a551ed user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5Int.h.

   221    221   
   222    222   /*
   223    223   ** Buffer object for the incremental building of string data.
   224    224   */
   225    225   typedef struct Fts5Buffer Fts5Buffer;
   226    226   struct Fts5Buffer {
   227    227     u8 *p;
   228         -  u32 n;
   229         -  u32 nSpace;
          228  +  int n;
          229  +  int nSpace;
   230    230   };
   231    231   
   232    232   int sqlite3Fts5BufferSize(int*, Fts5Buffer*, u32);
   233    233   void sqlite3Fts5BufferAppendVarint(int*, Fts5Buffer*, i64);
   234    234   void sqlite3Fts5BufferAppendBlob(int*, Fts5Buffer*, u32, const u8*);
   235    235   void sqlite3Fts5BufferAppendString(int *, Fts5Buffer*, const char*);
   236    236   void sqlite3Fts5BufferFree(Fts5Buffer*);
................................................................................
   243    243   #define fts5BufferZero(x)             sqlite3Fts5BufferZero(x)
   244    244   #define fts5BufferAppendVarint(a,b,c) sqlite3Fts5BufferAppendVarint(a,b,c)
   245    245   #define fts5BufferFree(a)             sqlite3Fts5BufferFree(a)
   246    246   #define fts5BufferAppendBlob(a,b,c,d) sqlite3Fts5BufferAppendBlob(a,b,c,d)
   247    247   #define fts5BufferSet(a,b,c,d)        sqlite3Fts5BufferSet(a,b,c,d)
   248    248   
   249    249   #define fts5BufferGrow(pRc,pBuf,nn) ( \
   250         -  (pBuf)->n + (nn) <= (pBuf)->nSpace ? 0 : \
          250  +  (u32)((pBuf)->n) + (u32)(nn) <= (u32)((pBuf)->nSpace) ? 0 : \
   251    251       sqlite3Fts5BufferSize((pRc),(pBuf),(nn)+(pBuf)->n) \
   252    252   )
   253    253   
   254    254   /* Write and decode big-endian 32-bit integer values */
   255    255   void sqlite3Fts5Put32(u8*, int);
   256    256   int sqlite3Fts5Get32(const u8*);
   257    257   

Changes to ext/fts5/fts5_buffer.c.

   359    359     }
   360    360   
   361    361     return rc;
   362    362   }
   363    363   
   364    364   void sqlite3Fts5TermsetFree(Fts5Termset *p){
   365    365     if( p ){
   366         -    int i;
          366  +    u32 i;
   367    367       for(i=0; i<ArraySize(p->apHash); i++){
   368    368         Fts5TermsetEntry *pEntry = p->apHash[i];
   369    369         while( pEntry ){
   370    370           Fts5TermsetEntry *pDel = pEntry;
   371    371           pEntry = pEntry->pNext;
   372    372           sqlite3_free(pDel);
   373    373         }