diff options
author | shane <shane@noemail.net> | 2009-06-01 16:53:09 +0000 |
---|---|---|
committer | shane <shane@noemail.net> | 2009-06-01 16:53:09 +0000 |
commit | cf6973963aabbd79cb4263a3767c99ea4253b86b (patch) | |
tree | 0ece7905ffd24f122b7e64f8cd8ba88bb8a92910 /src/expr.c | |
parent | 739a277031a0c2d3ece893f9a8e6277fc7e65f65 (diff) | |
download | sqlite-cf6973963aabbd79cb4263a3767c99ea4253b86b.tar.gz sqlite-cf6973963aabbd79cb4263a3767c99ea4253b86b.zip |
Fix compiler warnings with MSVC build. (CVS 6699)
FossilOrigin-Name: 0791588520603d106aa0b8ce24d68b740b7b80c8
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/expr.c b/src/expr.c index f6cb65874..24fcb4aac 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.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; } |