/ Check-in [8bb6e6fc]
Login

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

Overview
Comment:Fix harmless compiler warnings seen with MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8bb6e6fcedf7d0ae796b8848593106c921ebf21a
User & Date: mistachkin 2016-07-22 21:26:56
Context
2016-07-22
21:35
Revise a warning fix from the previous check-in to improve clarity. Also, fix an incorrect test prefix (typo). check-in: f50a3fd6 user: mistachkin tags: trunk
21:26
Fix harmless compiler warnings seen with MSVC. check-in: 8bb6e6fc user: mistachkin tags: trunk
10:09
Fix a problem with upper case module names in the "sqldiff --vtab" command. check-in: 87e25fc4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/carray.c.

   243    243           if( sqlite3_stricmp(zType, azType[i])==0 ) break;
   244    244         }
   245    245         if( i>=sizeof(azType)/sizeof(azType[0]) ){
   246    246           pVtabCursor->pVtab->zErrMsg = sqlite3_mprintf(
   247    247             "unknown datatype: %Q", zType);
   248    248           return SQLITE_ERROR;
   249    249         }else{
   250         -        pCur->eType = i;
          250  +        pCur->eType = (unsigned char)i;
   251    251         }
   252    252       }
   253    253     }else{
   254    254       pCur->iPtr = 0;
   255    255       pCur->iCnt = 0;
   256    256     }
   257    257     pCur->iRowid = 1;

Changes to ext/misc/csv.c.

   228    228           }
   229    229           if( (c==',' && pc=='"')
   230    230            || (c=='\n' && pc=='"')
   231    231            || (c=='\n' && pc=='\r' && ppc=='"')
   232    232            || (c==EOF && pc=='"')
   233    233           ){
   234    234             do{ p->n--; }while( p->z[p->n]!='"' );
   235         -          p->cTerm = c;
          235  +          p->cTerm = (char)c;
   236    236             break;
   237    237           }
   238    238           if( pc=='"' && c!='\r' ){
   239    239             csv_errmsg(p, "line %d: unescaped %c character", p->nLine, '"');
   240    240             break;
   241    241           }
   242    242           if( c==EOF ){
   243    243             csv_errmsg(p, "line %d: unterminated %c-quoted field\n",
   244    244                        startLine, '"');
   245         -          p->cTerm = c;
          245  +          p->cTerm = (char)c;
   246    246             break;
   247    247           }
   248    248         }
   249    249         if( csv_append(p, (char)c) ) return 0;
   250    250         ppc = pc;
   251    251         pc = c;
   252    252       }
................................................................................
   255    255         if( csv_append(p, (char)c) ) return 0;
   256    256         c = csv_getc(p);
   257    257       }
   258    258       if( c=='\n' ){
   259    259         p->nLine++;
   260    260         if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--;
   261    261       }
   262         -    p->cTerm = c;
          262  +    p->cTerm = (char)c;
   263    263     }
   264    264     if( p->z ) p->z[p->n] = 0;
   265    265     return p->z;
   266    266   }
   267    267   
   268    268   
   269    269   /* Forward references to the various virtual table methods implemented
................................................................................
   334    334     size_t n = strlen(z);
   335    335     while( n>0 && isspace((unsigned char)z[n]) ) n--;
   336    336     z[n] = 0;
   337    337   }
   338    338   
   339    339   /* Dequote the string */
   340    340   static void csv_dequote(char *z){
   341         -  int i, j;
          341  +  int j;
   342    342     char cQuote = z[0];
   343         -  size_t n;
          343  +  size_t i, n;
   344    344   
   345    345     if( cQuote!='\'' && cQuote!='"' ) return;
   346    346     n = strlen(z);
   347    347     if( n<2 || z[n-1]!=z[0] ) return;
   348    348     for(i=1, j=0; i<n-1; i++){
   349    349       if( z[i]==cQuote && z[i+1]==cQuote ) i++;
   350    350       z[j++] = z[i];
................................................................................
   721    721     int argc, sqlite3_value **argv
   722    722   ){
   723    723     CsvCursor *pCur = (CsvCursor*)pVtabCursor;
   724    724     CsvTable *pTab = (CsvTable*)pVtabCursor->pVtab;
   725    725     pCur->iRowid = 0;
   726    726     if( pCur->rdr.in==0 ){
   727    727       assert( pCur->rdr.zIn==pTab->zData );
   728         -    assert( pTab->iStart<=pCur->rdr.nIn );
          728  +    assert( pTab->iStart>=0 );
          729  +    assert( (size_t)pTab->iStart<=pCur->rdr.nIn );
   729    730       pCur->rdr.iIn = pTab->iStart;
   730    731     }else{
   731    732       fseek(pCur->rdr.in, pTab->iStart, SEEK_SET);
   732    733       pCur->rdr.iIn = 0;
   733    734       pCur->rdr.nIn = 0;
   734    735     }
   735    736     return csvtabNext(pVtabCursor);