/ Check-in [20b75460]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 20b75460c0661b5dc071177b4a0791aceccda029
User & Date: drh 2014-05-27 19:18:36
Context
2014-05-27
20:19
Remove an incorrect assert() in the sorter. check-in: b8b66103 user: drh tags: trunk
19:18
Fix harmless compiler warnings. check-in: 20b75460 user: drh tags: trunk
18:18
Change the name of the Index.autoIndex field to Index.idxType and provide symbolic names for the various values of that field rather than using magic numbers. check-in: d16e575d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

  1372   1372     }
  1373   1373   
  1374   1374     /* Fill in the abNotindexed array */
  1375   1375     for(iCol=0; iCol<nCol; iCol++){
  1376   1376       int n = (int)strlen(p->azColumn[iCol]);
  1377   1377       for(i=0; i<nNotindexed; i++){
  1378   1378         char *zNot = azNotindexed[i];
  1379         -      if( zNot && strlen(zNot)==n 
         1379  +      if( zNot && n==(int)strlen(zNot)
  1380   1380          && 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n) 
  1381   1381         ){
  1382   1382           p->abNotindexed[iCol] = 1;
  1383   1383           sqlite3_free(zNot);
  1384   1384           azNotindexed[i] = 0;
  1385   1385         }
  1386   1386       }

Changes to ext/fts3/fts3_write.c.

  3061   3061       ** segments in this index on levels greater than iAbsLevel. If there is
  3062   3062       ** at least one such segment, and it is possible to determine that all 
  3063   3063       ** such segments are smaller than nLimit bytes in size, they will be 
  3064   3064       ** promoted to level iAbsLevel.  */
  3065   3065       sqlite3_bind_int64(pRange, 1, iAbsLevel+1);
  3066   3066       sqlite3_bind_int64(pRange, 2, iLast);
  3067   3067       while( SQLITE_ROW==sqlite3_step(pRange) ){
  3068         -      i64 nSize, dummy;
         3068  +      i64 nSize = 0, dummy;
  3069   3069         fts3ReadEndBlockField(pRange, 2, &dummy, &nSize);
  3070   3070         if( nSize<=0 || nSize>nLimit ){
  3071   3071           /* If nSize==0, then the %_segdir.end_block field does not not 
  3072   3072           ** contain a size value. This happens if it was written by an
  3073   3073           ** old version of FTS. In this case it is not possible to determine
  3074   3074           ** the size of the segment, and so segment promotion does not
  3075   3075           ** take place.  */
................................................................................
  4866   4866       memset(pWriter, 0, nAlloc);
  4867   4867       pFilter->flags = FTS3_SEGMENT_REQUIRE_POS;
  4868   4868   
  4869   4869       if( rc==SQLITE_OK ){
  4870   4870         rc = fts3IncrmergeOutputIdx(p, iAbsLevel, &iIdx);
  4871   4871         assert( bUseHint==1 || bUseHint==0 );
  4872   4872         if( iIdx==0 || (bUseHint && iIdx==1) ){
  4873         -        int bIgnore;
         4873  +        int bIgnore = 0;
  4874   4874           rc = fts3SegmentIsMaxLevel(p, iAbsLevel+1, &bIgnore);
  4875   4875           if( bIgnore ){
  4876   4876             pFilter->flags |= FTS3_SEGMENT_IGNORE_EMPTY;
  4877   4877           }
  4878   4878         }
  4879   4879       }
  4880   4880   

Changes to tool/warnings.sh.

     1      1   #/bin/sh
     2      2   #
     3      3   # Run this script in a directory with a working makefile to check for 
     4      4   # compiler warnings in SQLite.
     5      5   #
     6      6   rm -f sqlite3.c
     7         -make sqlite3.c-debug
            7  +make sqlite3.c
     8      8   echo '********** No optimizations.  Includes FTS4 and RTREE *********'
     9      9   gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
    10     10         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
    11     11         sqlite3.c
    12     12   echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
    13     13   gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
    14     14         -ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
    15     15         sqlite3.c
    16     16   echo '********** Optimized -O3.  Includes FTS4 and RTREE ************'
    17     17   gcc -O3 -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
    18     18         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
    19     19         sqlite3.c