Fix compiler warnings with MSVC build. (CVS 6699)

FossilOrigin-Name: 0791588520603d106aa0b8ce24d68b740b7b80c8
This commit is contained in:
shane 2009-06-01 16:53:09 +00:00
parent 739a277031
commit cf6973963a
7 changed files with 34 additions and 30 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\scouple\sof\sWindows\sonly\sissues\swith\stest\sscripts.\s(CVS\s6698)
D 2009-06-01T16:42:18
C Fix\scompiler\swarnings\swith\sMSVC\sbuild.\s(CVS\s6699)
D 2009-06-01T16:53:10
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -109,12 +109,12 @@ F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
F src/btree.c 41bee6e4699e61f9d33beabfcf13caba4467c20a
F src/btree.h 3748683b382bc3022f23840c0a35d3231b24fc6e
F src/btreeInt.h df64030d632f8c8ac217ed52e8b6b3eacacb33a5
F src/build.c dedb5bcbd8261c182e831b4784a596c000c72958
F src/build.c 6d5276345e4019441932501921e6d2b440f40563
F src/callback.c 57359fa93de47c341b6b8ee504a88ff276397686
F src/complete.c 5ad5c6cd4548211867c204c41a126d73a9fbcea0
F src/date.c ab5f7137656652a48434d64f96bdcdc823bb23b3
F src/delete.c cb791855c7948cecc96def9d97989879ca26f257
F src/expr.c ac7ebc41433d177dfbc21780c9cce790bbdbecaf
F src/expr.c 1d580a7b2e51092785cbbc1fb8d2ff84e93c76dc
F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
F src/func.c 9d7b47729c337c5e4b78d795922ed34eec4aef67
F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
@ -125,7 +125,7 @@ F src/insert.c 69ef88ce30d1f65315b57aba63b2d4e9bdca1090
F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0
F src/legacy.c 9a56cf126ceee332b56061bf16bd0fb4ff9e26c0
F src/loadext.c a281f9890ce4f8f2b68967a124322c6ae98f1245
F src/main.c 2f0923eb41570fd33cdda686c486bc36a163bcc5
F src/main.c 1845bc74375dcd6c0f5f840c319c84a1f0e4f759
F src/malloc.c 7b3b6423f5b355e5d649b91e16ef252d610bcf19
F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c
F src/mem1.c e6d5c23941288df8191b8a98c28e3f57771e2270
@ -156,9 +156,9 @@ F src/pragma.c d4a6fd74fd1dba0f22c8930791f7fbbe80d2ef26
F src/prepare.c f46d1a029760edee5447e27164fb3ae10e2a6839
F src/printf.c 3f4dca207a88258d37af5a7a03e800a825fe6456
F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
F src/resolve.c 42065c05d4dd56894d1ae232974668674435e468
F src/resolve.c f86d3490cf93a12f8a451720defc622cbc79873a
F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f
F src/select.c 66de3fa81a0f7188ce180f30268f5e440992e260
F src/select.c 2d97084a176a63eabce2d043eb4fbb13c46d6e9f
F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb
F src/sqlite.h.in 79210c4d8905cfb4b038486dde5f36fabb796a86
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
@ -731,7 +731,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P ee9a144d448a76f29c3ca03851c1aeef539068e2
R ff1c98281ec98397b2284496c4710678
P 0f6bc5e1ba6937b36df08ed3b5903839389021bb
R 16e1f2d594599a039f283a098ab59d1c
U shane
Z 4a1b6319c0d25c61ca237dc7c77fd364
Z 5685cf42211f0e6a13fdf03ca05f0474

View File

@ -1 +1 @@
0f6bc5e1ba6937b36df08ed3b5903839389021bb
0791588520603d106aa0b8ce24d68b740b7b80c8

View File

@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.547 2009/05/28 21:04:38 drh Exp $
** $Id: build.c,v 1.548 2009/06/01 16:53:10 shane Exp $
*/
#include "sqliteInt.h"
@ -1089,7 +1089,7 @@ void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){
pCol->pDflt = sqlite3ExprDup(db, pSpan->pExpr, EXPRDUP_REDUCE);
sqlite3DbFree(db, pCol->zDflt);
pCol->zDflt = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
pSpan->zEnd - pSpan->zStart);
(int)(pSpan->zEnd - pSpan->zStart));
}
}
sqlite3ExprDelete(db, pSpan->pExpr);

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.444 2009/05/30 23:35:43 drh Exp $
** $Id: expr.c,v 1.445 2009/06/01 16:53:10 shane Exp $
*/
#include "sqliteInt.h"
@ -404,7 +404,7 @@ Expr *sqlite3ExprAlloc(
){
Expr *pNew;
int nExtra = 0;
int iValue;
int iValue = 0;
if( pToken ){
if( op!=TK_INTEGER || pToken->z==0
@ -1084,7 +1084,7 @@ void sqlite3ExprListSetSpan(
assert( db->mallocFailed || pItem->pExpr==pSpan->pExpr );
sqlite3DbFree(db, pItem->zSpan);
pItem->zSpan = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
pSpan->zEnd - pSpan->zStart);
(int)(pSpan->zEnd - pSpan->zStart));
}
}
@ -1641,9 +1641,6 @@ void sqlite3CodeSubselect(
case TK_EXISTS:
case TK_SELECT:
default: {
testcase( pExpr->op==TK_EXISTS );
testcase( pExpr->op==TK_SELECT );
assert( pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT );
/* If this has to be a scalar SELECT. Generate code to put the
** value of this select in a memory cell and record the number
** of the memory cell in iColumn. If this is an EXISTS, write
@ -1654,6 +1651,10 @@ void sqlite3CodeSubselect(
Select *pSel; /* SELECT statement to encode */
SelectDest dest; /* How to deal with SELECt result */
testcase( pExpr->op==TK_EXISTS );
testcase( pExpr->op==TK_SELECT );
assert( pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT );
assert( ExprHasProperty(pExpr, EP_xIsSelect) );
pSel = pExpr->x.pSelect;
sqlite3SelectDestInit(&dest, 0, ++pParse->nMem);
@ -1671,7 +1672,7 @@ void sqlite3CodeSubselect(
if( sqlite3Select(pParse, pSel, &dest) ){
return;
}
pExpr->iColumn = dest.iParm;
pExpr->iColumn = (i16)dest.iParm;
ExprSetIrreducible(pExpr);
break;
}
@ -3338,7 +3339,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
ExprSetIrreducible(pExpr);
pExpr->pAggInfo = pAggInfo;
pExpr->op = TK_AGG_COLUMN;
pExpr->iAgg = k;
pExpr->iAgg = (i16)k;
break;
} /* endif pExpr->iTable==pItem->iCursor */
} /* end loop over pSrcList */
@ -3383,7 +3384,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
*/
assert( !ExprHasAnyProperty(pExpr, EP_TokenOnly|EP_Reduced) );
ExprSetIrreducible(pExpr);
pExpr->iAgg = i;
pExpr->iAgg = (i16)i;
pExpr->pAggInfo = pAggInfo;
return WRC_Prune;
}

View File

@ -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.554 2009/05/22 10:53:29 drh Exp $
** $Id: main.c,v 1.555 2009/06/01 16:53:10 shane Exp $
*/
#include "sqliteInt.h"
@ -1192,7 +1192,8 @@ int sqlite3TempInMemory(const sqlite3 *db){
#endif
#if SQLITE_TEMP_STORE==3
return 1;
#else
#endif
#if SQLITE_TEMP_STORE<1 || SQLITE_TEMP_STORE>3
return 0;
#endif
}

View File

@ -14,7 +14,7 @@
** resolve all identifiers by associating them with a particular
** table and column.
**
** $Id: resolve.c,v 1.27 2009/05/29 14:39:08 drh Exp $
** $Id: resolve.c,v 1.28 2009/06/01 16:53:10 shane Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@ -190,7 +190,7 @@ static int lookupName(
pMatch = pItem;
pSchema = pTab->pSchema;
/* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
pExpr->iColumn = j==pTab->iPKey ? -1 : j;
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j;
if( i<pSrcList->nSrc-1 ){
if( pItem[1].jointype & JT_NATURAL ){
/* If this match occurred in the left table of a natural join,
@ -246,7 +246,7 @@ static int lookupName(
for(iCol=0; iCol < pTab->nCol; iCol++, pCol++) {
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
cnt++;
pExpr->iColumn = iCol==pTab->iPKey ? -1 : iCol;
pExpr->iColumn = iCol==pTab->iPKey ? -1 : (i16)iCol;
pExpr->pTab = pTab;
if( iCol>=0 ){
testcase( iCol==31 );
@ -591,6 +591,8 @@ static int resolveAsName(
){
int i; /* Loop counter */
UNUSED_PARAMETER(pParse);
if( pE->op==TK_ID || (pE->op==TK_STRING && pE->u.zToken[0]!='\'') ){
char *zCol = pE->u.zToken;
for(i=0; i<pEList->nExpr; i++){

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.522 2009/05/31 21:21:41 drh Exp $
** $Id: select.c,v 1.523 2009/06/01 16:53:10 shane Exp $
*/
#include "sqliteInt.h"
@ -234,7 +234,7 @@ static void addWhereTerm(
ExprSetProperty(pE, EP_FromJoin);
assert( !ExprHasAnyProperty(pE, EP_TokenOnly|EP_Reduced) );
ExprSetIrreducible(pE);
pE->iRightJoinTable = iRightJoinTable;
pE->iRightJoinTable = (i16)iRightJoinTable;
}
*ppExpr = sqlite3ExprAnd(pParse->db,*ppExpr, pE);
}
@ -270,7 +270,7 @@ static void setJoinExpr(Expr *p, int iTable){
ExprSetProperty(p, EP_FromJoin);
assert( !ExprHasAnyProperty(p, EP_TokenOnly|EP_Reduced) );
ExprSetIrreducible(p);
p->iRightJoinTable = iTable;
p->iRightJoinTable = (i16)iTable;
setJoinExpr(p->pLeft, iTable);
p = p->pRight;
}