Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335)

FossilOrigin-Name: 5477833ec7f707ea9937d3fd6a6d8ab49f2016f1
This commit is contained in:
shane 2009-03-05 03:48:06 +00:00
parent ce6fa1706a
commit c0688ea172
9 changed files with 49 additions and 32 deletions

View File

@ -1,5 +1,5 @@
C Converted\sEXPR_*SIZE\smacros\sto\suse\soffsetof()\sto\savoid\sMSVC\scompiler\swarnings.\s(CVS\s6334)
D 2009-03-02T17:18:48
C Removed\scompiler\swarnings\sfrom\sMSVC\sbuilds.\s\sTicket\s#3701.\s(CVS\s6335)
D 2009-03-05T03:48:07
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -110,8 +110,8 @@ F src/build.c 741240c8d6a54201fa8757db1ee6efba71be59a2
F src/callback.c 5f10bca853e59a2c272bbfd5b720303f8b69e520
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
F src/date.c 0d804df3bbda46329946a01ff5c75c3f4f135218
F src/delete.c 179db8e47c7bed95675d9021eb1bbf4618c1b0d7
F src/expr.c 46e24f9a71e7bdd2573a790ba2f98b7c3f617d04
F src/delete.c eb1066b2f35489fee46ad765d2b66386fc7d8adf
F src/expr.c b9273cdd529886dd8982eadeff3bb6aa33acfe53
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
F src/func.c de2eed7d96365210faecda877c5a12cf440bdf42
F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
@ -144,7 +144,7 @@ F src/os_unix.c 52352674c19688026a72cd0e8620e6a29bacba4a
F src/os_win.c 45cb430884da7e9360a55a0fcd5c2c44c22dd79d
F src/pager.c d62fd62f7c0ad257019c21158b597fdbb0182529
F src/pager.h 0c9f3520c00d8a3b8e792ca56c9a11b6b02b4b0f
F src/parse.y 5202dc712407fd6723f6639b88b86ddf8b33aef5
F src/parse.y c315b6f9bf6c7e7ec985481f81b6a45dba6c26d0
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
F src/pcache1.c dabb8ab14827e090321f17150ce96fda172974e8
@ -155,7 +155,7 @@ F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
F src/resolve.c ac4f914b32f9d76fd7ad29c4686105216e8d7995
F src/rowset.c ba9375f37053d422dd76965a9c370a13b6e1aac4
F src/select.c 4d0b77fd76ff80f09a798ee98953e344c9de8fbb
F src/shell.c 0cada72035b819ed2bede27e254efcfbb88167f7
F src/shell.c 0e2ebb9fa51ff56c9f0f19b80c3df7114d887c15
F src/sqlite.h.in 14f4d065bafed8500ea558a75a8e2be89c784d61
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h ae2dc2e2a063edfae3043e725981e69855bd3c9c
@ -203,12 +203,12 @@ F src/vdbe.c e03512022ed2dd57bf2ea9ebe4f54cbc091adb0b
F src/vdbe.h d70a68bee196ab228914a3902c79dbd24342a0f2
F src/vdbeInt.h d12bc259b34d3d610ebf05d648eb6346d48478c3
F src/vdbeapi.c f94fe2eb6f48687e918f0df7eed1409cff9dcf58
F src/vdbeaux.c f6a312a222c63fe09d36e05284c7982cafdb5bc6
F src/vdbeblob.c 08d6bac666c1f6a5d67452f5fbf808cf1311d2c9
F src/vdbeaux.c 5b7be22daa71fbe13cd2536a1b5447b3073b4b39
F src/vdbeblob.c 2852bae14c87129835938db58a77c3121e3ae962
F src/vdbemem.c 543a79d722734d2f8b7ad70f08218c30bcc5bbf5
F src/vtab.c e39e011d7443a8d574b1b9cde207a35522e6df43
F src/walker.c 42bd3f00ca2ef5ae842304ec0d59903ef051412d
F src/where.c ddc9074b1605fa7a8c1a0309872750e6c4b85e0c
F src/where.c ac555c8f6ef71a80944b31dcb212f7127c9ae30c
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 597662c5d777a122f9a3df0047ea5c5bd383a911
F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45
@ -703,7 +703,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 91969edac737adf087e35e10aa0a732b3303afd5
R 045e3e601a7c56c3070476218766f737
P 5e8e16f7d505a4b21272f1d300f366ee0e211e56
R 7c802b7e29f1bc562ab57e3e44428206
U shane
Z f3aa3267b0a3bb6445600f3d4be903ff
Z 29098afc87db9fff33ef02258d015c09

View File

@ -1 +1 @@
5e8e16f7d505a4b21272f1d300f366ee0e211e56
5477833ec7f707ea9937d3fd6a6d8ab49f2016f1

View File

@ -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));
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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;
@ -955,11 +976,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;

View File

@ -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;
}
/*

View File

@ -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);

View File

@ -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{