diff options
author | shaneh <shaneh@noemail.net> | 2010-09-01 02:38:21 +0000 |
---|---|---|
committer | shaneh <shaneh@noemail.net> | 2010-09-01 02:38:21 +0000 |
commit | bd2aaf9ab186790bf1feef6b4cf3c2eeaebb7ff9 (patch) | |
tree | 51c2ccbba29f2963db99b6de927081004c5934ae /src | |
parent | c4d340a096450782edda67347a99e6ee37d4279a (diff) | |
download | sqlite-bd2aaf9ab186790bf1feef6b4cf3c2eeaebb7ff9.tar.gz sqlite-bd2aaf9ab186790bf1feef6b4cf3c2eeaebb7ff9.zip |
Fix some compiler warnings under MSVC.
FossilOrigin-Name: afdc82a99eba260aed8ae2cca4bcec629f384098
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 2 | ||||
-rw-r--r-- | src/main.c | 7 | ||||
-rw-r--r-- | src/mutex.h | 4 | ||||
-rw-r--r-- | src/os_win.c | 6 | ||||
-rw-r--r-- | src/pcache1.c | 2 | ||||
-rw-r--r-- | src/test_rtree.c | 17 | ||||
-rw-r--r-- | src/wal.c | 2 |
7 files changed, 31 insertions, 9 deletions
diff --git a/src/btree.c b/src/btree.c index 0b4b6c683..f57f13275 100644 --- a/src/btree.c +++ b/src/btree.c @@ -1835,7 +1835,7 @@ int sqlite3BtreeOpen( if( rc!=SQLITE_OK ){ goto btree_open_out; } - pBt->openFlags = flags; + pBt->openFlags = (u8)flags; pBt->db = db; sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); p->pBt = pBt; diff --git a/src/main.c b/src/main.c index e1b69f6f1..3dbab0191 100644 --- a/src/main.c +++ b/src/main.c @@ -1088,7 +1088,7 @@ int sqlite3_create_function_v2( void (*xFinal)(sqlite3_context*), void (*xDestroy)(void *) ){ - int rc; + int rc = SQLITE_ERROR; FuncDestructor *pArg = 0; sqlite3_mutex_enter(db->mutex); if( xDestroy ){ @@ -1298,7 +1298,10 @@ int sqlite3WalDefaultHook( ** configured by this function. */ int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ -#ifndef SQLITE_OMIT_WAL +#ifdef SQLITE_OMIT_WAL + UNUSED_PARAMETER(db);
+ UNUSED_PARAMETER(nFrame);
+#else if( nFrame>0 ){ sqlite3_wal_hook(db, sqlite3WalDefaultHook, SQLITE_INT_TO_PTR(nFrame)); }else{ diff --git a/src/mutex.h b/src/mutex.h index 037d48750..c24f3da4c 100644 --- a/src/mutex.h +++ b/src/mutex.h @@ -63,8 +63,8 @@ #define sqlite3_mutex_enter(X) #define sqlite3_mutex_try(X) SQLITE_OK #define sqlite3_mutex_leave(X) -#define sqlite3_mutex_held(X) 1 -#define sqlite3_mutex_notheld(X) 1 +#define sqlite3_mutex_held(X) ((void)(X),1) +#define sqlite3_mutex_notheld(X) ((void)(X),1) #define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8) #define sqlite3MutexInit() SQLITE_OK #define sqlite3MutexEnd() diff --git a/src/os_win.c b/src/os_win.c index e81202fc4..45516a272 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -2033,19 +2033,25 @@ static int winOpen( char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */ int rc = SQLITE_OK; /* Function Return Code */ +#if !defined(NDEBUG) || SQLITE_OS_WINCE int eType = flags&0xFFFFFF00; /* Type of file to open */ +#endif int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); int isCreate = (flags & SQLITE_OPEN_CREATE); +#ifndef NDEBUG int isReadonly = (flags & SQLITE_OPEN_READONLY); +#endif int isReadWrite = (flags & SQLITE_OPEN_READWRITE); +#ifndef NDEBUG int isOpenJournal = (isCreate && ( eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_WAL )); +#endif /* Check the following statements are true: ** diff --git a/src/pcache1.c b/src/pcache1.c index eb2e2982d..633e1202e 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -814,7 +814,7 @@ int sqlite3PcacheReleaseMemory(int nReq){ if( pcache1.pStart==0 ){ PgHdr1 *p; pcache1EnterMutex(); - while( (nReq<0 || nFree<nReq) && (p=pcache1.pLruTail) ){ + while( (nReq<0 || nFree<nReq) && ((p=pcache1.pLruTail)!=0) ){ nFree += pcache1MemSize(PGHDR1_TO_PAGE(p)); pcache1PinPage(p); pcache1RemoveFromHash(p); diff --git a/src/test_rtree.c b/src/test_rtree.c index 800385d8f..48d0dbf83 100644 --- a/src/test_rtree.c +++ b/src/test_rtree.c @@ -15,6 +15,9 @@ #include <sqlite3.h> +/* Solely for the UNUSED_PARAMETER() macro. */ +#include "sqliteInt.h" + /* ** Type used to cache parameter information for the "circle" r-tree geometry ** callback. @@ -234,7 +237,12 @@ static int register_cube_geom( int objc, Tcl_Obj *CONST objv[] ){ -#ifdef SQLITE_ENABLE_RTREE +#ifndef SQLITE_ENABLE_RTREE + UNUSED_PARAMETER(clientData); + UNUSED_PARAMETER(interp); + UNUSED_PARAMETER(objc); + UNUSED_PARAMETER(objv); +#else extern int getDbPointer(Tcl_Interp*, const char*, sqlite3**); extern const char *sqlite3TestErrorName(int); sqlite3 *db; @@ -257,7 +265,12 @@ static int register_circle_geom( int objc, Tcl_Obj *CONST objv[] ){ -#ifdef SQLITE_ENABLE_RTREE +#ifndef SQLITE_ENABLE_RTREE + UNUSED_PARAMETER(clientData); + UNUSED_PARAMETER(interp); + UNUSED_PARAMETER(objc); + UNUSED_PARAMETER(objv); +#else extern int getDbPointer(Tcl_Interp*, const char*, sqlite3**); extern const char *sqlite3TestErrorName(int); sqlite3 *db; @@ -2478,7 +2478,7 @@ int sqlite3WalFrames( return rc; } } - assert( pWal->szPage==szPage ); + assert( (int)pWal->szPage==szPage ); /* Write the log file. */ for(p=pList; p; p=p->pDirty){ |