diff options
author | shane <shane@noemail.net> | 2009-11-03 19:42:30 +0000 |
---|---|---|
committer | shane <shane@noemail.net> | 2009-11-03 19:42:30 +0000 |
commit | f639c40f770f6d63fd8adef642b27e3314743a5a (patch) | |
tree | 89c3f72b26fb4684330c48f4ffee99070467b0a6 /src | |
parent | f16371d650bb49073dbe7da68a47e1d8982807d3 (diff) | |
download | sqlite-f639c40f770f6d63fd8adef642b27e3314743a5a.tar.gz sqlite-f639c40f770f6d63fd8adef642b27e3314743a5a.zip |
Fix compiler warnings on MSVC build.
FossilOrigin-Name: 01c4b5b84ec7ce589e20ea66e80011f092ab32f0
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 16 | ||||
-rw-r--r-- | src/os_win.c | 2 | ||||
-rw-r--r-- | src/resolve.c | 4 | ||||
-rw-r--r-- | src/vdbeaux.c | 4 |
4 files changed, 21 insertions, 5 deletions
diff --git a/src/expr.c b/src/expr.c index 0602032ac..ff75f5f70 100644 --- a/src/expr.c +++ b/src/expr.c @@ -571,12 +571,20 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ if( z[1]==0 ){ /* Wildcard of the form "?". Assign the next variable number */ assert( z[0]=='?' ); +#if SQLITE_MAX_VARIABLE_NUMBER<=32767 + pExpr->iColumn = (i16)(++pParse->nVar); +#else pExpr->iColumn = ++pParse->nVar; +#endif }else if( z[0]=='?' ){ /* Wildcard of the form "?nnn". Convert "nnn" to an integer and ** use it as the variable number */ - int i; - pExpr->iColumn = i = atoi((char*)&z[1]); + int i = atoi((char*)&z[1]); +#if SQLITE_MAX_VARIABLE_NUMBER<=32767 + pExpr->iColumn = (i16)i; +#else + pExpr->iColumn = i; +#endif testcase( i==0 ); testcase( i==1 ); testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 ); @@ -605,7 +613,11 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ } } if( i>=pParse->nVarExpr ){ +#if SQLITE_MAX_VARIABLE_NUMBER<=32767 + pExpr->iColumn = (i16)(++pParse->nVar); +#else pExpr->iColumn = ++pParse->nVar; +#endif if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){ pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10; pParse->apVarExpr = diff --git a/src/os_win.c b/src/os_win.c index c8240f1c9..bd23a848d 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -1254,7 +1254,7 @@ static int getLastErrorMsg(int nBuf, char *zBuf){ */ DWORD error = GetLastError(); DWORD dwLen = 0; - char *zOut; + char *zOut = 0; if( isNT() ){ WCHAR *zTempWide = NULL; diff --git a/src/resolve.c b/src/resolve.c index 40aab3fac..09f547c94 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -407,7 +407,11 @@ Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){ if( p->pTab->iPKey==iCol ){ p->iColumn = -1; }else{ +#if SQLITE_MAX_VARIABLE_NUMBER<=32767 + p->iColumn = (i16)iCol; +#else p->iColumn = iCol; +#endif pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol); } ExprSetProperty(p, EP_Resolved); diff --git a/src/vdbeaux.c b/src/vdbeaux.c index a2936f304..37f8b1431 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -60,7 +60,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 = (u8)isPrepareV2; } /* @@ -1359,7 +1359,7 @@ void sqlite3VdbeMakeReady( p->nCursor = (u16)nCursor; if( p->aVar ){ - p->nVar = nVar; + p->nVar = (u16)nVar; for(n=0; n<nVar; n++){ p->aVar[n].flags = MEM_Null; p->aVar[n].db = db; |