Fix a bug in UPDATE OR REPLACE that was introduced by check-in (999).
Also clean up some compiler warnings for VC++. (CVS 1005)

FossilOrigin-Name: af6f2bdf59fb621ff3e1d061e429f01ebd7d0b42
diff --git a/src/btree.c b/src/btree.c
index a7936e9..c1bd51a 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.93 2003/05/17 17:35:11 drh Exp $
+** $Id: btree.c,v 1.94 2003/06/04 16:24:39 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -2477,7 +2477,7 @@
     int minV = pgnoNew[i];
     int minI = i;
     for(j=i+1; j<k; j++){
-      if( pgnoNew[j]<minV ){
+      if( pgnoNew[j]<(unsigned)minV ){
         minI = j;
         minV = pgnoNew[j];
       }
diff --git a/src/insert.c b/src/insert.c
index 98fc76c..7c2b611 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle INSERT statements in SQLite.
 **
-** $Id: insert.c,v 1.87 2003/06/04 12:23:31 drh Exp $
+** $Id: insert.c,v 1.88 2003/06/04 16:24:39 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -748,7 +748,7 @@
       case OE_Replace: {
         sqliteGenerateRowIndexDelete(pParse->db, v, pTab, base, 0);
         if( isUpdate ){
-          sqliteVdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRecnos, 1);
+          sqliteVdbeAddOp(v, OP_Dup, nCol+hasTwoRecnos, 1);
           sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
         }
         seenReplace = 1;
diff --git a/src/os.c b/src/os.c
index 2193b64..d9d16ed 100644
--- a/src/os.c
+++ b/src/os.c
@@ -1003,7 +1003,6 @@
 int isNT(void){
   static osType = 0;   /* 0=unknown 1=win95 2=winNT */
   if( osType==0 ){
-    int tmpOsType;
     OSVERSIONINFO sInfo;
     sInfo.dwOSVersionInfoSize = sizeof(sInfo);
     GetVersionEx(&sInfo);
diff --git a/src/pager.c b/src/pager.c
index 130043d..51c7590 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.83 2003/04/25 15:37:58 drh Exp $
+** @(#) $Id: pager.c,v 1.84 2003/06/04 16:24:40 drh Exp $
 */
 #include "os.h"         /* Must be first to enable large file support */
 #include "sqliteInt.h"
@@ -496,7 +496,7 @@
   if( pgRec.pgno==0 ){
     return SQLITE_DONE;
   }
-  if( pgRec.pgno>pPager->dbSize ){
+  if( pgRec.pgno>(unsigned)pPager->dbSize ){
     return SQLITE_OK;
   }
   if( format>=JOURNAL_FORMAT_3 ){
@@ -944,7 +944,7 @@
     rc = pager_errcode(pPager);
     return rc;
   }
-  if( nPage>=pPager->dbSize ){
+  if( nPage>=(unsigned)pPager->dbSize ){
     return SQLITE_OK;
   }
   syncAllPages(pPager);
diff --git a/src/vdbe.c b/src/vdbe.c
index 0a66218..1491c77 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -36,7 +36,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.225 2003/06/02 23:14:13 drh Exp $
+** $Id: vdbe.c,v 1.226 2003/06/04 16:24:40 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -2287,7 +2287,7 @@
     /* Do nothing */
   }else if( aStack[tos].flags & STK_Real ){
     int i = aStack[tos].r;
-    double r = i;
+    double r = (double)i;
     if( r!=aStack[tos].r ){
       goto mismatch;
     }