aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshane <shane@noemail.net>2009-03-05 03:48:06 +0000
committershane <shane@noemail.net>2009-03-05 03:48:06 +0000
commitc0688ea1728706ba6812f9b21384ad413a09eca2 (patch)
tree2aeb0bcc82581c975822ed552eacf563a4085b17 /src
parentce6fa1706ab556815479f2f284b64b983a3ba1b0 (diff)
downloadsqlite-c0688ea1728706ba6812f9b21384ad413a09eca2.tar.gz
sqlite-c0688ea1728706ba6812f9b21384ad413a09eca2.zip
Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335)
FossilOrigin-Name: 5477833ec7f707ea9937d3fd6a6d8ab49f2016f1
Diffstat (limited to 'src')
-rw-r--r--src/delete.c4
-rw-r--r--src/expr.c5
-rw-r--r--src/parse.y4
-rw-r--r--src/shell.c30
-rw-r--r--src/vdbeaux.c4
-rw-r--r--src/vdbeblob.c4
-rw-r--r--src/where.c4
7 files changed, 36 insertions, 19 deletions
diff --git a/src/delete.c b/src/delete.c
index 03ff06a1a..1850ac4a9 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
-** $Id: delete.c,v 1.197 2009/03/02 14:24:21 drh Exp $
+** $Id: delete.c,v 1.198 2009/03/05 03:48:07 shane Exp $
*/
#include "sqliteInt.h"
@@ -78,7 +78,7 @@ void sqlite3OpenTable(
assert( opcode==OP_OpenWrite || opcode==OP_OpenRead );
sqlite3TableLock(p, iDb, pTab->tnum, (opcode==OP_OpenWrite)?1:0, pTab->zName);
sqlite3VdbeAddOp3(v, opcode, iCur, pTab->tnum, iDb);
- sqlite3VdbeChangeP4(v, -1, (const char *)pTab->nCol, P4_INT32);
+ sqlite3VdbeChangeP4(v, -1, SQLITE_INT_TO_PTR(pTab->nCol), P4_INT32);
VdbeComment((v, "%s", pTab->zName));
}
diff --git a/src/expr.c b/src/expr.c
index ee3a26219..4b5928315 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.416 2009/02/24 10:14:40 danielk1977 Exp $
+** $Id: expr.c,v 1.417 2009/03/05 03:48:07 shane Exp $
*/
#include "sqliteInt.h"
@@ -494,7 +494,8 @@ void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
assert( pLeft!=0 );
if( pExpr ){
pExpr->span.z = pLeft->z;
- pExpr->span.n = pRight->n + (pRight->z - pLeft->z);
+ assert(pRight->z >= pLeft->z);
+ pExpr->span.n = pRight->n + (unsigned)(pRight->z - pLeft->z);
}
}
diff --git a/src/parse.y b/src/parse.y
index 491c8da09..df3dd307c 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
-** @(#) $Id: parse.y,v 1.269 2009/02/19 14:39:25 danielk1977 Exp $
+** @(#) $Id: parse.y,v 1.270 2009/03/05 03:48:07 shane Exp $
*/
// All token codes are small integers with #defines that begin with "TK_"
@@ -1111,7 +1111,7 @@ expr(A) ::= RAISE(X) LP IGNORE RP(Y). {
expr(A) ::= RAISE(X) LP raisetype(T) COMMA nm(Z) RP(Y). {
A = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &Z);
if( A ) {
- A->affinity = T;
+ A->affinity = (char)T;
sqlite3ExprSpan(A, &X, &Y);
}
}
diff --git a/src/shell.c b/src/shell.c
index 35be1b3cb..64d286cde 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
-** $Id: shell.c,v 1.204 2009/02/25 19:07:25 drh Exp $
+** $Id: shell.c,v 1.205 2009/03/05 03:48:07 shane Exp $
*/
#if defined(_WIN32) || defined(WIN32)
/* This needs to come before any includes for MSVC compiler */
@@ -115,6 +115,11 @@ static void endTimer(void){
#define HAS_TIMER 0
#endif
+/*
+** Used to prevent warnings about unused parameters
+*/
+#define UNUSED_PARAMETER(x) (void)(x)
+
/**************************************************************************
***************************************************************************
@@ -247,6 +252,8 @@ static int schemaCreate(
schema_vtab *pVtab;
SchemaTable *pType = &aSchemaTable[0];
+ UNUSED_PARAMETER(pzErr);
+
if( argc>3 ){
int i;
pType = 0;
@@ -277,6 +284,7 @@ static int schemaCreate(
static int schemaOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
int rc = SQLITE_NOMEM;
schema_cursor *pCur;
+ UNUSED_PARAMETER(pVTab);
pCur = sqlite3_malloc(sizeof(schema_cursor));
if( pCur ){
memset(pCur, 0, sizeof(schema_cursor));
@@ -439,6 +447,10 @@ static int schemaFilter(
int rc;
schema_vtab *pVtab = (schema_vtab *)(pVtabCursor->pVtab);
schema_cursor *pCur = (schema_cursor *)pVtabCursor;
+ UNUSED_PARAMETER(idxNum);
+ UNUSED_PARAMETER(idxStr);
+ UNUSED_PARAMETER(argc);
+ UNUSED_PARAMETER(argv);
pCur->rowid = 0;
finalize(&pCur->pTableList);
finalize(&pCur->pColumnList);
@@ -451,6 +463,8 @@ static int schemaFilter(
** Analyse the WHERE condition.
*/
static int schemaBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
+ UNUSED_PARAMETER(tab);
+ UNUSED_PARAMETER(pIdxInfo);
return SQLITE_OK;
}
@@ -528,6 +542,7 @@ static void joinStep(
sqlite3_value **argv
){
StrBuffer *p;
+ UNUSED_PARAMETER(argc);
p = (StrBuffer *)sqlite3_aggregate_context(context, sizeof(StrBuffer));
if( p->zBuf==0 ){
p->zBuf = sqlite3_mprintf("%s", sqlite3_value_text(argv[0]));
@@ -561,6 +576,8 @@ static void doublequote(
const char *zIn = (const char *)sqlite3_value_text(argv[0]);
int nIn = sqlite3_value_bytes(argv[0]);
+ UNUSED_PARAMETER(argc);
+
zOut = sqlite3_malloc(nIn*2+3);
zCsr = zOut;
*zCsr++ = '"';
@@ -626,6 +643,8 @@ static void multireplace(
*/
static int invokeCallback(void *p, int nArg, char **azArg, char **azCol){
GenfkeyCb *pCb = (GenfkeyCb *)p;
+ UNUSED_PARAMETER(nArg);
+ UNUSED_PARAMETER(azCol);
return pCb->xData(pCb->pCtx, pCb->eType, azArg[0]);
}
@@ -908,6 +927,8 @@ static int genfkey_create_triggers(
cb.xData = xData;
cb.pCtx = pCtx;
+ UNUSED_PARAMETER(zDb);
+
/* Open the working database handle. */
rc = sqlite3_open(":memory:", &db);
if( rc!=SQLITE_OK ) goto genfkey_exit;
@@ -956,11 +977,6 @@ genfkey_exit:
/*************************************************************************/
/*
-** Used to prevent warnings about unused parameters
-*/
-#define UNUSED_PARAMETER(x) (void)(x)
-
-/*
** If the following flag is set, then command execution stops
** at an error if we are not interactive.
*/
@@ -1783,7 +1799,7 @@ static int genfkeyParseArgs(GenfkeyCmd *p, char **azArg, int nArg){
memset(p, 0, sizeof(GenfkeyCmd));
for(ii=0; ii<nArg; ii++){
- int n = strlen(azArg[ii]);
+ size_t n = strlen(azArg[ii]);
if( n>2 && n<10 && 0==strncmp(azArg[ii], "--no-drop", n) ){
p->isNoDrop = 1;
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 06699c4e1..0ab06498e 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.439 2009/03/01 19:42:11 drh Exp $
+** $Id: vdbeaux.c,v 1.440 2009/03/05 03:48:07 shane Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -59,7 +59,7 @@ void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
#endif
assert( p->zSql==0 );
p->zSql = sqlite3DbStrNDup(p->db, z, n);
- p->isPrepareV2 = isPrepareV2;
+ p->isPrepareV2 = isPrepareV2 ? 1 : 0;
}
/*
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index c2ffdd116..a7caf2434 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -12,7 +12,7 @@
**
** This file contains code used to implement incremental BLOB I/O.
**
-** $Id: vdbeblob.c,v 1.28 2009/02/20 10:58:42 danielk1977 Exp $
+** $Id: vdbeblob.c,v 1.29 2009/03/05 03:48:07 shane Exp $
*/
#include "sqliteInt.h"
@@ -187,7 +187,7 @@ int sqlite3_blob_open(
** we can invoke OP_Column to fill in the vdbe cursors type
** and offset cache without causing any IO.
*/
- sqlite3VdbeChangeP4(v, flags ? 3 : 2, (char *)(pTab->nCol+1), P4_INT32);
+ sqlite3VdbeChangeP4(v, flags ? 3 : 2, SQLITE_INT_TO_PTR(pTab->nCol+1), P4_INT32);
sqlite3VdbeChangeP2(v, 6, pTab->nCol);
if( !db->mallocFailed ){
sqlite3VdbeMakeReady(v, 1, 1, 1, 0);
diff --git a/src/where.c b/src/where.c
index 06eb5f99d..c506339f7 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.373 2009/02/24 10:14:40 danielk1977 Exp $
+** $Id: where.c,v 1.374 2009/03/05 03:48:07 shane Exp $
*/
#include "sqliteInt.h"
@@ -3256,7 +3256,7 @@ WhereInfo *sqlite3WhereBegin(
Bitmask b = pTabItem->colUsed;
int n = 0;
for(; b; b=b>>1, n++){}
- sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, (char*)n, P4_INT32);
+ sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, SQLITE_INT_TO_PTR(n), P4_INT32);
assert( n<=pTab->nCol );
}
}else{