1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-13 20:39:27 +03:00

Fix some compiler warnings under MSVC.

FossilOrigin-Name: afdc82a99eba260aed8ae2cca4bcec629f384098
This commit is contained in:
shaneh
2010-09-01 02:38:21 +00:00
parent c4d340a096
commit bd2aaf9ab1
9 changed files with 44 additions and 22 deletions

View File

@@ -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;

View File

@@ -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{

View File

@@ -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()

View File

@@ -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:
**

View File

@@ -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);

View File

@@ -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;

View File

@@ -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){