/ Check-in [18f531e1]
Login

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

Overview
Comment:Fix some more harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | msvcWarn
Files: files | file ages | folders
SHA1: 18f531e1cf3c8bb986d912c9c5e3f5698360c93e
User & Date: mistachkin 2015-12-16 22:06:52
Context
2015-12-16
23:30
Fix even more harmless compiler warnings. Closed-Leaf check-in: 1d0e6aa1 user: mistachkin tags: msvcWarn
22:06
Fix some more harmless compiler warnings. check-in: 18f531e1 user: mistachkin tags: msvcWarn
21:09
Fix compiler warning seen with MSVC. check-in: 18a4c054 user: mistachkin tags: msvcWarn
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/tool/fts3view.c.

   394    394              "         WHERE (a.blockid BETWEEN b.start_block"
   395    395                                          " AND b.leaves_end_block)"
   396    396              "           AND (b.level%%1024)==%d)",
   397    397              pgsz-45, zTab, zTab, i);
   398    398       if( sqlite3_step(pStmt)==SQLITE_ROW
   399    399        && (nLeaf = sqlite3_column_int(pStmt, 0))>0
   400    400       ){
   401         -      int nIdx = sqlite3_column_int(pStmt, 5);
          401  +      nIdx = sqlite3_column_int(pStmt, 5);
   402    402         sqlite3_int64 sz;
   403    403         printf("For level %d:\n", i);
   404    404         printf("  Number of indexes...................... %9d\n", nIdx);
   405    405         printf("  Number of leaf segments................ %9d\n", nLeaf);
   406    406         if( nIdx>1 ){
   407    407           printf("  Average leaf segments per index........ %11.1f\n",
   408    408                  (double)nLeaf/(double)nIdx);

Changes to mptest/mptest.c.

   418    418   }
   419    419   
   420    420   /* Append n bytes of text to a string.  If n<0 append the entire string. */
   421    421   static void stringAppend(String *p, const char *z, int n){
   422    422     if( n<0 ) n = (int)strlen(z);
   423    423     if( p->n+n>=p->nAlloc ){
   424    424       int nAlloc = p->nAlloc*2 + n + 100;
   425         -    char *z = sqlite3_realloc(p->z, nAlloc);
   426         -    if( z==0 ) fatalError("out of memory");
   427         -    p->z = z;
          425  +    char *zNew = sqlite3_realloc(p->z, nAlloc);
          426  +    if( zNew==0 ) fatalError("out of memory");
          427  +    p->z = zNew;
   428    428       p->nAlloc = nAlloc;
   429    429     }
   430    430     memcpy(p->z+p->n, z, n);
   431    431     p->n += n;
   432    432     p->z[p->n] = 0;
   433    433   }
   434    434   

Changes to src/test8.c.

   859    859       pConstraint = &pIdxInfo->aConstraint[ii];
   860    860       pUsage = &pIdxInfo->aConstraintUsage[ii];
   861    861   
   862    862       if( !isIgnoreUsable && !pConstraint->usable ) continue;
   863    863   
   864    864       iCol = pConstraint->iColumn;
   865    865       if( iCol<0 || pVtab->aIndex[iCol] ){
   866         -      char *zCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
          866  +      char *zNewCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
   867    867         char *zOp = 0;
   868    868         useIdx = 1;
   869    869         switch( pConstraint->op ){
   870    870           case SQLITE_INDEX_CONSTRAINT_EQ:
   871    871             zOp = "="; break;
   872    872           case SQLITE_INDEX_CONSTRAINT_LT:
   873    873             zOp = "<"; break;
................................................................................
   891    891           case SQLITE_INDEX_CONSTRAINT_GLOB:
   892    892             zOp = "glob"; break;
   893    893           case SQLITE_INDEX_CONSTRAINT_REGEXP:
   894    894             zOp = "regexp"; break;
   895    895         }
   896    896         if( zOp[0]=='L' ){
   897    897           zNew = sqlite3_mprintf(" %s %s LIKE (SELECT '%%'||?||'%%')", 
   898         -                               zSep, zCol);
          898  +                               zSep, zNewCol);
   899    899         } else {
   900         -        zNew = sqlite3_mprintf(" %s %s %s ?", zSep, zCol, zOp);
          900  +        zNew = sqlite3_mprintf(" %s %s %s ?", zSep, zNewCol, zOp);
   901    901         }
   902    902         string_concat(&zQuery, zNew, 1, &rc);
   903    903   
   904    904         zSep = "AND";
   905    905         pUsage->argvIndex = ++nArg;
   906    906         pUsage->omit = 1;
   907    907       }
................................................................................
   911    911     ** on a column that this virtual table has an index for, then consume 
   912    912     ** the ORDER BY clause.
   913    913     */
   914    914     if( pIdxInfo->nOrderBy==1 && (
   915    915           pIdxInfo->aOrderBy->iColumn<0 ||
   916    916           pVtab->aIndex[pIdxInfo->aOrderBy->iColumn]) ){
   917    917       int iCol = pIdxInfo->aOrderBy->iColumn;
   918         -    char *zCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
          918  +    char *zNewCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
   919    919       char *zDir = pIdxInfo->aOrderBy->desc?"DESC":"ASC";
   920         -    zNew = sqlite3_mprintf(" ORDER BY %s %s", zCol, zDir);
          920  +    zNew = sqlite3_mprintf(" ORDER BY %s %s", zNewCol, zDir);
   921    921       string_concat(&zQuery, zNew, 1, &rc);
   922    922       pIdxInfo->orderByConsumed = 1;
   923    923     }
   924    924   
   925    925     appendToEchoModule(pVtab->interp, "xBestIndex");;
   926    926     appendToEchoModule(pVtab->interp, zQuery);
   927    927   

Changes to src/test_loadext.c.

    30     30   ** SQL functions to call the sqlite3_status function and return results.
    31     31   */
    32     32   static void statusFunc(
    33     33     sqlite3_context *context,
    34     34     int argc,
    35     35     sqlite3_value **argv
    36     36   ){
    37         -  int op, mx, cur, resetFlag, rc;
           37  +  int op = 0, mx, cur, resetFlag, rc;
    38     38     if( sqlite3_value_type(argv[0])==SQLITE_INTEGER ){
    39     39       op = sqlite3_value_int(argv[0]);
    40     40     }else if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){
    41     41       int i;
    42     42       const char *zName;
    43     43       static const struct {
    44     44         const char *zName;

Changes to tool/showdb.c.

  1148   1148           a = fileRead(ofst, nByte);
  1149   1149           decode_btree_page(a, iStart, hdrSize, &zLeft[1]);
  1150   1150           sqlite3_free(a);
  1151   1151           continue;
  1152   1152         }else if( zLeft && zLeft[0]=='t' ){
  1153   1153           int detail = 0;
  1154   1154           int recursive = 0;
  1155         -        int i;
  1156         -        for(i=1; zLeft[i]; i++){
  1157         -          if( zLeft[i]=='r' ) recursive = 1;
  1158         -          if( zLeft[i]=='d' ) detail = 1;
         1155  +        int j;
         1156  +        for(j=1; zLeft[j]; j++){
         1157  +          if( zLeft[j]=='r' ) recursive = 1;
         1158  +          if( zLeft[j]=='d' ) detail = 1;
  1159   1159           }
  1160   1160           decode_trunk_page(iStart, detail, recursive);
  1161   1161           continue;
  1162   1162         }else{
  1163   1163           iEnd = iStart;
  1164   1164         }
  1165   1165         if( iStart<1 || iEnd<iStart || iEnd>g.mxPage ){