/ Check-in [1cec1e03]
Login

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

Overview
Comment:Fix harmless compiler warnings in the fts3view utility program that can occur with MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1cec1e030035e5253fb7ebbdfe5c1a3029e4e29b
User & Date: mistachkin 2014-07-07 18:03:38
Context
2014-07-18
14:43
Improvements to the ".fullschema" command in the command-line shell. check-in: fa80c64c user: drh tags: trunk
2014-07-07
18:03
Fix harmless compiler warnings in the fts3view utility program that can occur with MSVC. check-in: 1cec1e03 user: mistachkin tags: trunk
17:57
Add the fts3view utility program to the MSVC makefile. check-in: b04751bd user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

   550    550   ){
   551    551     sqlite3_int64 iChild;
   552    552     sqlite3_int64 iPrefix;
   553    553     sqlite3_int64 nTerm;
   554    554     sqlite3_int64 n;
   555    555     sqlite3_int64 iDocsz;
   556    556     int iHeight;
   557         -  int i = 0;
          557  +  sqlite3_int64 i = 0;
   558    558     int cnt = 0;
   559    559     char zTerm[1000];
   560    560   
   561    561     i += getVarint(aData, &n);
   562    562     iHeight = (int)n;
   563    563     printf("height: %d\n", iHeight);
   564    564     if( iHeight>0 ){
................................................................................
   572    572         iPrefix = 0;
   573    573       }
   574    574       i += getVarint(aData+i, &nTerm);
   575    575       if( iPrefix+nTerm+1 >= sizeof(zTerm) ){
   576    576         fprintf(stderr, "term to long\n");
   577    577         exit(1);
   578    578       }
   579         -    memcpy(zTerm+iPrefix, aData+i, nTerm);
          579  +    memcpy(zTerm+iPrefix, aData+i, (size_t)nTerm);
   580    580       zTerm[iPrefix+nTerm] = 0;
   581    581       i += nTerm;
   582    582       if( iHeight==0 ){
   583    583         i += getVarint(aData+i, &iDocsz);
   584         -      printf("term: %-25s doclist %7lld bytes offset %d\n", zTerm, iDocsz, i);
          584  +      printf("term: %-25s doclist %7lld bytes offset %lld\n", zTerm, iDocsz, i);
   585    585         i += iDocsz;
   586    586       }else{
   587    587         printf("term: %-25s child %lld\n", zTerm, ++iChild);
   588    588       }
   589    589     }
   590    590   }
   591    591     
................................................................................
   745    745   ** is azExtra[2].
   746    746   **
   747    747   ** If the --raw option is present in azExtra, then a hex dump is provided.
   748    748   ** Otherwise a decoding is shown.
   749    749   */
   750    750   static void showDoclist(sqlite3 *db, const char *zTab){
   751    751     const unsigned char *aData;
   752         -  sqlite3_int64 offset, nData;
          752  +  sqlite3_int64 offset;
          753  +  int nData;
   753    754     sqlite3_stmt *pStmt;
   754    755   
   755    756     offset = atoi64(azExtra[1]);
   756         -  nData = atoi64(azExtra[2]);
          757  +  nData = atoi(azExtra[2]);
   757    758     pStmt = prepareToGetSegment(db, zTab, azExtra[0]);
   758    759     if( sqlite3_step(pStmt)!=SQLITE_ROW ){
   759    760       sqlite3_finalize(pStmt);
   760    761       return;
   761    762     }
   762    763     aData = sqlite3_column_blob(pStmt, 0);
   763         -  printf("Doclist at %s offset %lld of size %lld bytes:\n",
          764  +  printf("Doclist at %s offset %lld of size %d bytes:\n",
   764    765            azExtra[0], offset, nData);
   765    766     if( findOption("raw", 0, 0)!=0 ){
   766    767       printBlob(aData+offset, nData);
   767    768     }else{
   768    769       decodeDoclist(aData+offset, nData);
   769    770     }
   770    771     sqlite3_finalize(pStmt);