summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-05-22 09:02:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-05-22 09:02:31 +0000
commite5eef2a680813ad1717717d7bc0ae52ff1cd2505 (patch)
treea921984cbf186e1f7e551fa400429454e2ff1b35 /lib
parent36e50377cb6e0c9cba6fac6f61f03d1a675e5d7e (diff)
import sqlite 3.7.12 (tested by landry@)
Diffstat (limited to 'lib')
-rw-r--r--lib/libsqlite3/ext/fts3/tool/fts3view.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/libsqlite3/ext/fts3/tool/fts3view.c b/lib/libsqlite3/ext/fts3/tool/fts3view.c
index 6dada352b3a..479ae9868d4 100644
--- a/lib/libsqlite3/ext/fts3/tool/fts3view.c
+++ b/lib/libsqlite3/ext/fts3/tool/fts3view.c
@@ -376,7 +376,7 @@ static void showSegmentStats(sqlite3 *db, const char *zTab){
sqlite3_finalize(pStmt);
nLeaf = nSeg - nIdx;
printf("Leaf segments larger than %5d bytes.... %9d %5.2f%%\n",
- pgsz-45, n, nLeaf>0 ? n*100.0/nLeaf : 0.0);
+ pgsz-45, n, n*100.0/nLeaf);
pStmt = prepare(db, "SELECT max(level%%1024) FROM '%q_segdir'", zTab);
mxLevel = 0;
@@ -504,7 +504,7 @@ static void showSegdirMap(sqlite3 *db, const char *zTab){
sqlite3_column_int64(pStmt,5));
printf(" root %9s\n", rtag);
if( iLEnd>iStart ){
- sqlite3_int64 iLower, iPrev = 0, iX;
+ sqlite3_int64 iLower, iPrev, iX;
if( iLEnd+1<=iEnd ){
sqlite3_bind_int64(pStmt2, 1, iLEnd+1);
sqlite3_bind_int64(pStmt2, 2, iEnd);
@@ -548,13 +548,13 @@ static void decodeSegment(
const unsigned char *aData, /* Content to print */
int nData /* Number of bytes of content */
){
- sqlite3_int64 iChild = 0;
+ sqlite3_int64 iChild;
sqlite3_int64 iPrefix;
sqlite3_int64 nTerm;
sqlite3_int64 n;
sqlite3_int64 iDocsz;
int iHeight;
- sqlite3_int64 i = 0;
+ int i = 0;
int cnt = 0;
char zTerm[1000];
@@ -576,12 +576,12 @@ static void decodeSegment(
fprintf(stderr, "term to long\n");
exit(1);
}
- memcpy(zTerm+iPrefix, aData+i, (size_t)nTerm);
+ memcpy(zTerm+iPrefix, aData+i, nTerm);
zTerm[iPrefix+nTerm] = 0;
i += nTerm;
if( iHeight==0 ){
i += getVarint(aData+i, &iDocsz);
- printf("term: %-25s doclist %7lld bytes offset %lld\n", zTerm, iDocsz, i);
+ printf("term: %-25s doclist %7lld bytes offset %d\n", zTerm, iDocsz, i);
i += iDocsz;
}else{
printf("term: %-25s child %lld\n", zTerm, ++iChild);
@@ -749,19 +749,18 @@ static void decodeDoclist(
*/
static void showDoclist(sqlite3 *db, const char *zTab){
const unsigned char *aData;
- sqlite3_int64 offset;
- int nData;
+ sqlite3_int64 offset, nData;
sqlite3_stmt *pStmt;
offset = atoi64(azExtra[1]);
- nData = atoi(azExtra[2]);
+ nData = atoi64(azExtra[2]);
pStmt = prepareToGetSegment(db, zTab, azExtra[0]);
if( sqlite3_step(pStmt)!=SQLITE_ROW ){
sqlite3_finalize(pStmt);
return;
}
aData = sqlite3_column_blob(pStmt, 0);
- printf("Doclist at %s offset %lld of size %d bytes:\n",
+ printf("Doclist at %s offset %lld of size %lld bytes:\n",
azExtra[0], offset, nData);
if( findOption("raw", 0, 0)!=0 ){
printBlob(aData+offset, nData);