Changes to silence compiler warnings under MSVC. (CVS 6613)

FossilOrigin-Name: df599237e1ca8b4f361477a712cf761aa1fac3df
diff --git a/src/btree.c b/src/btree.c
index 6a22eb8..338d99e 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.607 2009/05/04 19:01:26 danielk1977 Exp $
+** $Id: btree.c,v 1.608 2009/05/06 18:57:10 shane Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -808,7 +808,7 @@
   }
 
   assert( nSize==debuginfo.nSize );
-  return nSize;
+  return (u16)nSize;
 }
 #ifndef NDEBUG
 static u16 cellSize(MemPage *pPage, int iCell){
@@ -4087,7 +4087,7 @@
           void *pCellKey;
           u8 * const pCellBody = pCell - pPage->childPtrSize;
           sqlite3BtreeParseCellPtr(pPage, pCellBody, &pCur->info);
-          nCell = pCur->info.nKey;
+          nCell = (int)pCur->info.nKey;
           pCellKey = sqlite3Malloc( nCell );
           if( pCellKey==0 ){
             rc = SQLITE_NOMEM;
diff --git a/src/expr.c b/src/expr.c
index fa15cad..1e3e4b3 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.431 2009/05/01 21:13:37 drh Exp $
+** $Id: expr.c,v 1.432 2009/05/06 18:57:10 shane Exp $
 */
 #include "sqliteInt.h"
 
@@ -412,7 +412,7 @@
       sqlite3TokenCopy(db, &pNew->token, pToken);
       if( pNew->token.z ){
         pNew->token.n = sqlite3Dequote((char*)pNew->token.z);
-        assert( pNew->token.n==sqlite3Strlen30((char*)pNew->token.z) );
+        assert( pNew->token.n==(unsigned)sqlite3Strlen30((char*)pNew->token.z) );
       }
       if( c=='"' ) pNew->flags |= EP_DblQuoted;
     }else{
@@ -1996,6 +1996,7 @@
   }
   return iReg;
 #else
+  UNUSED_PARAMETER(iAlias);
   return sqlite3ExprCodeTarget(pParse, pExpr, target);
 #endif
 }
diff --git a/src/main.c b/src/main.c
index 7a19841..dacdf4c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.546 2009/05/03 20:23:53 drh Exp $
+** $Id: main.c,v 1.547 2009/05/06 18:57:10 shane Exp $
 */
 #include "sqliteInt.h"
 
@@ -1193,8 +1193,9 @@
 #endif
 #if SQLITE_TEMP_STORE==3
   return 1;
-#endif
+#else
   return 0;
+#endif
 }
 
 /*
diff --git a/src/pager.c b/src/pager.c
index dcb052a..0edabb3 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.585 2009/04/30 16:41:00 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.586 2009/05/06 18:57:10 shane Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -3191,7 +3191,7 @@
     nPathname + 1 +                /* zFilename */
     nPathname + 8 + 1              /* zJournal */
   );
-  assert( EIGHT_BYTE_ALIGNMENT(journalFileSize) );
+  assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) );
   if( !pPtr ){
     sqlite3_free(zPathname);
     return SQLITE_NOMEM;
@@ -4043,7 +4043,7 @@
 int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
   int rc = SQLITE_OK;
   assert( pPager->state!=PAGER_UNLOCK );
-  pPager->subjInMemory = subjInMemory;
+  pPager->subjInMemory = (u8)subjInMemory;
   if( pPager->state==PAGER_SHARED ){
     assert( pPager->pInJournal==0 );
     assert( !MEMDB && !pPager->tempFile );
diff --git a/src/vdbe.c b/src/vdbe.c
index ec2c235..56667f5 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
 ** in this file for details.  If in doubt, do not deviate from existing
 ** commenting and indentation practices when changing or adding code.
 **
-** $Id: vdbe.c,v 1.841 2009/05/04 11:42:30 danielk1977 Exp $
+** $Id: vdbe.c,v 1.842 2009/05/06 18:57:10 shane Exp $
 */
 #include "sqliteInt.h"
 #include "vdbeInt.h"
@@ -3362,10 +3362,10 @@
 ** See also: NotFound, NotExists, Found
 */
 case OP_IsUnique: {        /* jump, in3 */
-  int ii;
+  u16 ii;
   VdbeCursor *pCx;
   BtCursor *pCrsr;
-  int nField;
+  u16 nField;
   Mem *aMem = &p->aMem[pOp->p4.i];
 
   /* Assert that the values of parameters P1 and P4 are in range. */
@@ -4650,7 +4650,8 @@
   assert( iSet==-1 || iSet>=0 );
   if( iSet ){
     int exists;
-    exists = sqlite3RowSetTest(pIn1->u.pRowSet, iSet>=0 ? iSet & 0xf : 0xff,
+    exists = sqlite3RowSetTest(pIn1->u.pRowSet, 
+                               (u8)(iSet>=0 ? iSet & 0xf : 0xff),
                                pIn3->u.i);
     if( exists ){
       pc = pOp->p2 - 1;
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index b26adc4..8d696e5 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -14,7 +14,7 @@
 ** to version 2.8.7, all this code was combined into the vdbe.c source file.
 ** But that file was getting too big so this subroutines were split out.
 **
-** $Id: vdbeaux.c,v 1.456 2009/05/05 15:46:43 drh Exp $
+** $Id: vdbeaux.c,v 1.457 2009/05/06 18:57:10 shane Exp $
 */
 #include "sqliteInt.h"
 #include "vdbeInt.h"
@@ -2466,6 +2466,7 @@
   mem1.enc = pKeyInfo->enc;
   mem1.db = pKeyInfo->db;
   mem1.flags = 0;
+  mem1.u.i = 0;  /* not needed, here to silence compiler warning */
   mem1.zMalloc = 0;
   
   idx1 = getVarint32(aKey1, szHdr1);
diff --git a/src/where.c b/src/where.c
index de95f77..3b910dd 100644
--- a/src/where.c
+++ b/src/where.c
@@ -16,7 +16,7 @@
 ** so is applicable.  Because this module is responsible for selecting
 ** indices, you might also think of this module as the "query optimizer".
 **
-** $Id: where.c,v 1.394 2009/05/06 18:42:21 drh Exp $
+** $Id: where.c,v 1.395 2009/05/06 18:57:10 shane Exp $
 */
 #include "sqliteInt.h"
 
@@ -2885,8 +2885,8 @@
             r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, 
                                          regRowid, 0);
             sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset, 
-                             sqlite3VdbeCurrentAddr(v)+2,
-                             r, (char*)iSet, P4_INT32);
+                              sqlite3VdbeCurrentAddr(v)+2,
+                              r, SQLITE_INT_TO_PTR(iSet), P4_INT32);
           }
           sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody);