mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-22 20:22:44 +03:00
Fix compiler warnings with MSVC build. (CVS 6699)
FossilOrigin-Name: 0791588520603d106aa0b8ce24d68b740b7b80c8
This commit is contained in:
@@ -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);
|
||||
|
||||
19
src/expr.c
19
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.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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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++){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user