]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix various compiler warnings.
authordrh <drh@noemail.net>
Fri, 26 Nov 2010 16:49:59 +0000 (16:49 +0000)
committerdrh <drh@noemail.net>
Fri, 26 Nov 2010 16:49:59 +0000 (16:49 +0000)
FossilOrigin-Name: c412f61229b6ab1ac90b932afd56f7c5e3ba1cfe

ext/fts3/fts3.c
ext/fts3/fts3Int.h
ext/fts3/fts3_expr.c
ext/fts3/fts3_porter.c
ext/fts3/fts3_snippet.c
ext/fts3/fts3_tokenizer.c
ext/fts3/fts3_write.c
ext/rtree/rtree.c
manifest
manifest.uuid
src/vdbe.c

index 89eb928826991633123e13c3171d6da97adccdd6..2906bb16627de1f0303f751d98817c50e263effe 100644 (file)
@@ -1022,7 +1022,6 @@ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){
 ** If an OOM error occurs, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK.
 */
 static int fts3ScanInteriorNode(
-  Fts3Table *p,                   /* Virtual table handle */
   const char *zTerm,              /* Term to select leaves for */
   int nTerm,                      /* Size of term zTerm in bytes */
   const char *zNode,              /* Buffer containing segment interior node */
@@ -1157,7 +1156,7 @@ static int fts3SelectLeaf(
   assert( piLeaf || piLeaf2 );
 
   sqlite3Fts3GetVarint32(zNode, &iHeight);
-  rc = fts3ScanInteriorNode(p, zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2);
+  rc = fts3ScanInteriorNode(zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2);
   assert( !piLeaf2 || !piLeaf || rc!=SQLITE_OK || (*piLeaf<=*piLeaf2) );
 
   if( rc==SQLITE_OK && iHeight>1 ){
@@ -1956,7 +1955,7 @@ static void fts3SegReaderArrayFree(Fts3SegReaderArray *pArray){
   if( pArray ){
     int i;
     for(i=0; i<pArray->nSegment; i++){
-      sqlite3Fts3SegReaderFree(0, pArray->apSegment[i]);
+      sqlite3Fts3SegReaderFree(pArray->apSegment[i]);
     }
     sqlite3_free(pArray);
   }
@@ -1974,7 +1973,7 @@ static int fts3SegReaderArrayAdd(
         sizeof(Fts3SegReaderArray) + (nNew-1) * sizeof(Fts3SegReader*)
     );
     if( !pArray ){
-      sqlite3Fts3SegReaderFree(0, pNew);
+      sqlite3Fts3SegReaderFree(pNew);
       return SQLITE_NOMEM;
     }
     if( nNew==16 ){
@@ -2027,14 +2026,14 @@ static int fts3TermSegReaderArray(
       ** leaf). Do not bother inspecting any data in this case, just
       ** create a Fts3SegReader to scan the single leaf. 
       */
-      rc = sqlite3Fts3SegReaderNew(p, iAge, 0, 0, 0, zRoot, nRoot, &pNew);
+      rc = sqlite3Fts3SegReaderNew(iAge, 0, 0, 0, zRoot, nRoot, &pNew);
     }else{
       sqlite3_int64 i1;           /* First leaf that may contain zTerm */
       sqlite3_int64 i2;           /* Final leaf that may contain zTerm */
       rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &i1, (isPrefix?&i2:0));
       if( isPrefix==0 ) i2 = i1;
       if( rc==SQLITE_OK ){
-        rc = sqlite3Fts3SegReaderNew(p, iAge, i1, i2, 0, 0, 0, &pNew);
+        rc = sqlite3Fts3SegReaderNew(iAge, i1, i2, 0, 0, 0, &pNew);
       }
     }
     assert( (pNew==0)==(rc!=SQLITE_OK) );
index 5c4cbc181c90fcfe20fc163b5a181fc848e96f82..087544323fabf405c5dc23b43ea73f7b2c2927cd 100644 (file)
@@ -281,10 +281,10 @@ int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*);
 int sqlite3Fts3PendingTermsFlush(Fts3Table *);
 void sqlite3Fts3PendingTermsClear(Fts3Table *);
 int sqlite3Fts3Optimize(Fts3Table *);
-int sqlite3Fts3SegReaderNew(Fts3Table *,int, sqlite3_int64,
+int sqlite3Fts3SegReaderNew(int, sqlite3_int64,
   sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**);
 int sqlite3Fts3SegReaderPending(Fts3Table*,const char*,int,int,Fts3SegReader**);
-void sqlite3Fts3SegReaderFree(Fts3Table *, Fts3SegReader *);
+void sqlite3Fts3SegReaderFree(Fts3SegReader *);
 int sqlite3Fts3SegReaderIterate(
   Fts3Table *, Fts3SegReader **, int, Fts3SegFilter *,
   int (*)(Fts3Table *, void *, char *, int, char *, int),  void *
index 662697b24e387f2cb03ad04578fd06ffa4c83b1e..7043f54f512f0afe33b101fa2a1eabf998900531 100644 (file)
@@ -405,7 +405,6 @@ static int getNextNode(
   if( sqlite3_fts3_enable_parentheses ){
     if( *zInput=='(' ){
       int nConsumed;
-      int rc;
       pParse->nNest++;
       rc = fts3ExprParse(pParse, &zInput[1], nInput-1, ppExpr, &nConsumed);
       if( rc==SQLITE_OK && !*ppExpr ){
index 5963abc5d87207b20b4d727fcad92c04680f91af..27f9cf39d7535e4272017df2613f9aba4461f215 100644 (file)
@@ -343,7 +343,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
   int i, j;
   char zReverse[28];
   char *z, *z2;
-  if( nIn<3 || nIn>=sizeof(zReverse)-7 ){
+  if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){
     /* The word is too big or too small for the porter stemmer.
     ** Fallback to the copy stemmer */
     copy_stemmer(zIn, nIn, zOut, pnOut);
index 946b904b26100af76529d31c76663b4954ae645b..a288ff8977717c463c1468630bbf04a88b05c74a 100644 (file)
@@ -291,6 +291,8 @@ static int fts3ExprLoadDoclists(
 
 static int fts3ExprPhraseCountCb(Fts3Expr *pExpr, int iPhrase, void *ctx){
   (*(int *)ctx)++;
+  UNUSED_PARAMETER(pExpr);
+  UNUSED_PARAMETER(iPhrase);
   return SQLITE_OK;
 }
 static int fts3ExprPhraseCount(Fts3Expr *pExpr){
@@ -1214,8 +1216,9 @@ static int fts3MatchinfoValues(
         break;
 
       default: {
+        Fts3Expr *pExpr;
         assert( zArg[i]==FTS3_MATCHINFO_HITS );
-        Fts3Expr *pExpr = pCsr->pExpr;
+        pExpr = pCsr->pExpr;
         rc = fts3ExprLoadDoclists(pCsr, 0, 0);
         if( rc!=SQLITE_OK ) break;
         if( bGlobal ){
index cf392d38f77aa19abb3ba608541c0049b0b729be..aa28933439cea86d5a722f2537d08226f608a11b 100644 (file)
@@ -465,15 +465,23 @@ int sqlite3Fts3InitHashTable(
   }
 #endif
 
-  if( SQLITE_OK!=rc
-   || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0))
-   || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0))
+  if( SQLITE_OK==rc ){
+    rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0);
+  }
+  if( SQLITE_OK==rc ){
+    rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0);
+  }
 #ifdef SQLITE_TEST
-   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0))
-   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0))
-   || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0))
+  if( SQLITE_OK==rc ){
+    rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0);
+  }
+  if( SQLITE_OK==rc ){
+    rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0);
+  }
+  if( SQLITE_OK==rc ){
+    rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0);
+  }
 #endif
-   );
 
 #ifdef SQLITE_TEST
   sqlite3_free(zTest);
index 945c22dfd23be9d4c63c874c8cd59ac9e97cc5d7..6d14a37180f14693bacea2d3fb67efff0c680fa6 100644 (file)
@@ -328,9 +328,6 @@ int sqlite3Fts3SelectDocsize(
   return fts3SelectDocsize(pTab, SQL_SELECT_DOCSIZE, iDocid, ppStmt);
 }
 
-void sqlite3Fts3MatchinfoLcs(Fts3Expr *pExpr, u32 *aOut){
-}
-
 /*
 ** Similar to fts3SqlStmt(). Except, after binding the parameters in
 ** array apVal[] to the SQL statement identified by eStmt, the statement
@@ -1147,7 +1144,7 @@ int sqlite3Fts3SegReaderCost(
 ** Free all allocations associated with the iterator passed as the 
 ** second argument.
 */
-void sqlite3Fts3SegReaderFree(Fts3Table *p, Fts3SegReader *pReader){
+void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){
   if( pReader && !fts3SegReaderIsPending(pReader) ){
     sqlite3_free(pReader->zTerm);
     if( !fts3SegReaderIsRootOnly(pReader) ){
@@ -1161,7 +1158,6 @@ void sqlite3Fts3SegReaderFree(Fts3Table *p, Fts3SegReader *pReader){
 ** Allocate a new SegReader object.
 */
 int sqlite3Fts3SegReaderNew(
-  Fts3Table *p,                   /* Virtual table handle */
   int iAge,                       /* Segment "age". */
   sqlite3_int64 iStartLeaf,       /* First leaf to traverse */
   sqlite3_int64 iEndLeaf,         /* Final leaf to traverse */
@@ -1202,7 +1198,7 @@ int sqlite3Fts3SegReaderNew(
   if( rc==SQLITE_OK ){
     *ppReader = pReader;
   }else{
-    sqlite3Fts3SegReaderFree(p, pReader);
+    sqlite3Fts3SegReaderFree(pReader);
   }
   return rc;
 }
@@ -1325,12 +1321,11 @@ int sqlite3Fts3SegReaderPending(
 ** code is returned.
 */
 static int fts3SegReaderNew(
-  Fts3Table *p,                   /* Virtual table handle */
   sqlite3_stmt *pStmt,            /* See above */
   int iAge,                       /* Segment "age". */
   Fts3SegReader **ppReader        /* OUT: Allocated Fts3SegReader */
 ){
-  return sqlite3Fts3SegReaderNew(p, iAge, 
+  return sqlite3Fts3SegReaderNew(iAge, 
       sqlite3_column_int64(pStmt, 1),
       sqlite3_column_int64(pStmt, 2),
       sqlite3_column_int64(pStmt, 3),
@@ -2361,7 +2356,7 @@ static int fts3SegmentMerge(Fts3Table *p, int iLevel){
   if( rc!=SQLITE_OK ) goto finished;
   sqlite3_bind_int(pStmt, 1, iLevel);
   for(i=0; SQLITE_ROW==(sqlite3_step(pStmt)); i++){
-    rc = fts3SegReaderNew(p, pStmt, i, &apSegment[i]);
+    rc = fts3SegReaderNew(pStmt, i, &apSegment[i]);
     if( rc!=SQLITE_OK ){
       goto finished;
     }
@@ -2391,11 +2386,11 @@ static int fts3SegmentMerge(Fts3Table *p, int iLevel){
   fts3SegWriterFree(pWriter);
   if( apSegment ){
     for(i=0; i<nSegment; i++){
-      sqlite3Fts3SegReaderFree(p, apSegment[i]);
+      sqlite3Fts3SegReaderFree(apSegment[i]);
     }
     sqlite3_free(apSegment);
   }
-  sqlite3Fts3SegReaderFree(p, pPending);
+  sqlite3Fts3SegReaderFree(pPending);
   sqlite3_reset(pStmt);
   return rc;
 }
@@ -2448,7 +2443,7 @@ int sqlite3Fts3PendingTermsFlush(Fts3Table *p){
     rc = fts3SegWriterFlush(p, pWriter, 0, idx);
   }
   fts3SegWriterFree(pWriter);
-  sqlite3Fts3SegReaderFree(p, pReader);
+  sqlite3Fts3SegReaderFree(pReader);
 
   if( rc==SQLITE_OK ){
     sqlite3Fts3PendingTermsClear(p);
index 9cac2f3c07521da08241e0745cda8fcf5a7e7af6..c7e1e9c140628c6e60576a45522d13848f621b3a 100644 (file)
@@ -113,6 +113,12 @@ typedef unsigned char u8;
 typedef unsigned int u32;
 #endif
 
+/*  The following macro is used to suppress compiler warnings.
+*/
+#ifndef UNUSED_PARAMETER
+# define UNUSED_PARAMETER(x) (void)(x)
+#endif
+
 typedef struct Rtree Rtree;
 typedef struct RtreeCursor RtreeCursor;
 typedef struct RtreeNode RtreeNode;
@@ -1194,7 +1200,7 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
 
   /* Check that the blob is roughly the right size. */
   nBlob = sqlite3_value_bytes(pValue);
-  if( nBlob<sizeof(RtreeMatchArg) 
+  if( nBlob<(int)sizeof(RtreeMatchArg) 
    || ((nBlob-sizeof(RtreeMatchArg))%sizeof(double))!=0
   ){
     return SQLITE_ERROR;
@@ -1209,7 +1215,7 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
 
   memcpy(p, sqlite3_value_blob(pValue), nBlob);
   if( p->magic!=RTREE_GEOMETRY_MAGIC 
-   || nBlob!=(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double))
+   || nBlob!=(int)(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double))
   ){
     sqlite3_free(pGeom);
     return SQLITE_ERROR;
@@ -1355,6 +1361,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
   int iIdx = 0;
   char zIdxStr[RTREE_MAX_DIMENSIONS*8+1];
   memset(zIdxStr, 0, sizeof(zIdxStr));
+  UNUSED_PARAMETER(tab);
 
   assert( pIdxInfo->idxStr==0 );
   for(ii=0; ii<pIdxInfo->nConstraint; ii++){
@@ -1528,6 +1535,7 @@ static float cellOverlap(
     if( ii!=iExclude )
 #else
     assert( iExclude==-1 );
+    UNUSED_PARAMETER(iExclude);
 #endif
     {
       int jj;
@@ -3114,6 +3122,7 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
   Rtree tree;
   int ii;
 
+  UNUSED_PARAMETER(nArg);
   memset(&node, 0, sizeof(RtreeNode));
   memset(&tree, 0, sizeof(Rtree));
   tree.nDim = sqlite3_value_int(apArg[0]);
@@ -3147,6 +3156,7 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
 }
 
 static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
+  UNUSED_PARAMETER(nArg);
   if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB 
    || sqlite3_value_bytes(apArg[0])<2
   ){
@@ -3168,7 +3178,6 @@ int sqlite3RtreeInit(sqlite3 *db){
 
   rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0);
   if( rc==SQLITE_OK ){
-    int utf8 = SQLITE_UTF8;
     rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0);
   }
   if( rc==SQLITE_OK ){
index e5d2b3ca4cebdeb548b26f708c6f0bb0d825c728..2991c3f95a37ad2315af5a1995d815f52753823d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,8 @@
-C Fix\san\suninitialized\svariable\sin\sfts3.c.
-D 2010-11-26T16:31:44
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C Fix\svarious\scompiler\swarnings.
+D 2010-11-26T16:49:59
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 4547616ad2286053af6ccccefa242dc925e49bf0
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -61,26 +64,26 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
 F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
-F ext/fts3/fts3.c 7fda91bbe8d6e4a84bed15c38c1e5768347c3609
+F ext/fts3/fts3.c bae65cf771cd2c1dbcc972b064f770737cdbfca4
 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
-F ext/fts3/fts3Int.h 52c818623c60943bc4ac4a22d77b2e8f28395e78
-F ext/fts3/fts3_expr.c ee48b9278b8b2432a05a03320fbcacba151dbaa5
+F ext/fts3/fts3Int.h a6c69c1c5e2c8c19172ddff42d262c087dcd7337
+F ext/fts3/fts3_expr.c f1cd71e78f73c99341d979619c14cac8b5c4f56f
 F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c
 F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
 F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295
-F ext/fts3/fts3_porter.c 8df6f6efcc4e9e31f8bf73a4007c2e9abca1dfba
-F ext/fts3/fts3_snippet.c e8a952d5de28950c91bbfed3d75b77ae2c3977ce
-F ext/fts3/fts3_tokenizer.c 1301b0ee3ef414caae3257a702215925cc48cd9c
+F ext/fts3/fts3_porter.c d61cfd81fb0fd8fbcb25adcaee0ba671aefaa5c2
+F ext/fts3/fts3_snippet.c 1d827175e9bf3ae58d608a43ce2a7ac89d5bbe0c
+F ext/fts3/fts3_tokenizer.c 055f3dc7369585350b28db1ee0f3b214dca6724d
 F ext/fts3/fts3_tokenizer.h 13ffd9fcb397fec32a05ef5cd9e0fa659bf3dbd3
 F ext/fts3/fts3_tokenizer1.c 6e5cbaa588924ac578263a598e4fb9f5c9bb179d
-F ext/fts3/fts3_write.c b4e5b4c74f755a6f494dab9c131ad9bb04bab50c
+F ext/fts3/fts3_write.c 9d254e1baf4ed7ebebef8dbf1ec21cbdb611d1f6
 F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
 F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
 F ext/icu/icu.c 850e9a36567bbcce6bd85a4b68243cad8e3c2de2
 F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
-F ext/rtree/rtree.c 1a15546893b4c05df810ebc18d3bf910ac8ca601
+F ext/rtree/rtree.c e1a2d0fd4b38200bf09d417e4c9400f62c981391
 F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
 F ext/rtree/rtree1.test dbd4250ac0ad367a262eb9676f7e3080b0368206
 F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
@@ -228,7 +231,7 @@ F src/update.c 227e6cd512108b84f69421fc6c7aa1b83d60d6e0
 F src/utf.c 1baeeac91707a4df97ccc6141ec0f808278af685
 F src/util.c ab1c92426494f499f42b9e307537b03e923d75c1
 F src/vacuum.c 924bd1bcee2dfb05376f79845bd3b4cec7b54b2f
-F src/vdbe.c 7aef0a9e174099a0b2d6b940ca9d3ae9833fd014
+F src/vdbe.c 21a9285fedf2e310ffc4bad27b828645dc2b20bb
 F src/vdbe.h 4de0efb4b0fdaaa900cf419b35c458933ef1c6d2
 F src/vdbeInt.h 7f4cf1b2b69bef3a432b1f23dfebef57275436b4
 F src/vdbeapi.c fb0036185b3c56e15916a5ee96309cd4acf6818f
@@ -889,7 +892,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 7d660b91b748126c499285713bd0237530a1a601
-R bf3c79b7317123c38edff4a337096bab
-U dan
-Z e6c80a7ed69438f59cf0d2cdb47a5fa6
+P 3c3d076b42da36cd5413749ec022d0349325edfa
+R 6eb1d3796cc6e7f30b85a46219b5a41c
+U drh
+Z dad7028ef2a2e95ebd4d4284381d5339
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFM7+U6oxKgR168RlERArCCAJ9Ms95IkrYzcyhjnhaA4kTfC+owCwCdG6XU
+6RTdcghjuTo4XsP3zh0JwEk=
+=o/S3
+-----END PGP SIGNATURE-----
index 536ecd90cd191f4a813799a03c5f9540ac429ce6..464e90fefee9ff733a915881605fb37e3c9860c8 100644 (file)
@@ -1 +1 @@
-3c3d076b42da36cd5413749ec022d0349325edfa
\ No newline at end of file
+c412f61229b6ab1ac90b932afd56f7c5e3ba1cfe
\ No newline at end of file
index ef92e797977fc75111a8ab3c4c1e67f771e2848d..1a419c7a9f0610cd2318a489ae3692730ca400c1 100644 (file)
@@ -5806,7 +5806,7 @@ case OP_MaxPgcnt: {            /* out2-prerelease */
   newMax = 0;
   if( pOp->p3 ){
     newMax = sqlite3BtreeLastPage(pBt);
-    if( pOp->p3>newMax ) newMax = pOp->p3;
+    if( newMax < (unsigned)pOp->p3 ) newMax = (unsigned)pOp->p3;
   }
   pOut->u.i = sqlite3BtreeMaxPageCount(pBt, newMax);
   break;