mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix MSVC compiler warnings in test code.
FossilOrigin-Name: cb7a850439c9a4a7887650d6b81d95ab8025de5b
This commit is contained in:
@ -73,6 +73,7 @@ static int fts3termConnectMethod(
|
||||
Fts3termTable *p; /* Virtual table object to return */
|
||||
int iIndex = 0;
|
||||
|
||||
UNUSED_PARAMETER(pCtx);
|
||||
if( argc==5 ){
|
||||
iIndex = atoi(argv[4]);
|
||||
argc--;
|
||||
@ -231,12 +232,12 @@ static int fts3termNextMethod(sqlite3_vtab_cursor *pCursor){
|
||||
|
||||
if( v==1 ){
|
||||
pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v);
|
||||
pCsr->iCol += v;
|
||||
pCsr->iCol += (int)v;
|
||||
pCsr->iPos = 0;
|
||||
pCsr->pNext += sqlite3Fts3GetVarint(pCsr->pNext, &v);
|
||||
}
|
||||
|
||||
pCsr->iPos += (v - 2);
|
||||
pCsr->iPos += (int)(v - 2);
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -357,7 +358,10 @@ int sqlite3Fts3InitTerm(sqlite3 *db){
|
||||
0, /* xCommit */
|
||||
0, /* xRollback */
|
||||
0, /* xFindFunction */
|
||||
0 /* xRename */
|
||||
0, /* xRename */
|
||||
0, /* xSavepoint */
|
||||
0, /* xRelease */
|
||||
0 /* xRollbackTo */
|
||||
};
|
||||
int rc; /* Return code */
|
||||
|
||||
|
@ -161,6 +161,8 @@ static int fts3_near_match_cmd(
|
||||
Tcl_Obj **apExprToken;
|
||||
int nExprToken;
|
||||
|
||||
UNUSED_PARAMETER(clientData);
|
||||
|
||||
/* Must have 3 or more arguments. */
|
||||
if( objc<3 || (objc%2)==0 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DOCUMENT EXPR ?OPTION VALUE?...");
|
||||
@ -314,6 +316,7 @@ static int fts3_configure_incr_load_cmd(
|
||||
Tcl_SetObjResult(interp, pRet);
|
||||
Tcl_DecrRefCount(pRet);
|
||||
#endif
|
||||
UNUSED_PARAMETER(clientData);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@ -352,6 +355,8 @@ static int testTokenizerCreate(
|
||||
sqlite3_tokenizer **ppTokenizer
|
||||
){
|
||||
test_tokenizer *pNew;
|
||||
UNUSED_PARAMETER(argc);
|
||||
UNUSED_PARAMETER(argv);
|
||||
|
||||
pNew = sqlite3_malloc(sizeof(test_tokenizer));
|
||||
if( !pNew ) return SQLITE_NOMEM;
|
||||
@ -507,6 +512,7 @@ static int fts3_test_tokenizer_cmd(
|
||||
(const unsigned char *)&pPtr, sizeof(sqlite3_tokenizer_module *)
|
||||
));
|
||||
#endif
|
||||
UNUSED_PARAMETER(clientData);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
34
manifest
34
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\san\sFTS4\stest\sscript\sproblem\sfor\swindows.
|
||||
D 2012-03-30T13:34:17.656
|
||||
C Fix\sMSVC\scompiler\swarnings\sin\stest\scode.
|
||||
D 2012-03-30T14:59:43.262
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -73,8 +73,8 @@ F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
|
||||
F ext/fts3/fts3_icu.c 6c8f395cdf9e1e3afa7fadb7e523dbbf381c6dfa
|
||||
F ext/fts3/fts3_porter.c a465b49fcb8249a755792f87516eff182efa42b3
|
||||
F ext/fts3/fts3_snippet.c 51a3a34c217e24678a133782c1dfb6f2f70fe559
|
||||
F ext/fts3/fts3_term.c d3466cf99432291be08e379d89645462431809d6
|
||||
F ext/fts3/fts3_test.c 6b7cc68aef4efb084e1449f7d20c4b20d3bdf6b4
|
||||
F ext/fts3/fts3_term.c 41e82ad335213d1c24356cf310dca1d3c13e7366
|
||||
F ext/fts3/fts3_test.c f3ef8ae1b802383c4d24fd70774cb87d52841d5f
|
||||
F ext/fts3/fts3_tokenizer.c 3da7254a9881f7e270ab28e2004e0d22b3212bce
|
||||
F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68
|
||||
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
|
||||
@ -190,12 +190,12 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 35939e7e03abf1b7577ce311f48f682c40de3208
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
F src/tclsqlite.c 086dfdd72e5892de223968a258e1ccbd9693e717
|
||||
F src/test1.c 07f30e8714bab94d8de8a88865d9c59bc512a1a8
|
||||
F src/test1.c 8631f728c9c3afcf79e3e22b510e451435e3d15e
|
||||
F src/test2.c 711555927f1f7e8db9aab86b512bc6934a774abe
|
||||
F src/test3.c 91d3f1a09cfae3533ef17d8b484a160f3d1f1a21
|
||||
F src/test3.c f82399ec50d9cd7378bf9d6db6c1409d5e77b042
|
||||
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
|
||||
F src/test5.c a6d1ac55ac054d0b2b8f37b5e655b6c92645a013
|
||||
F src/test6.c 846ed1ed2f470de9b1e205fe3878a12e237b3e19
|
||||
F src/test6.c 3329df2dbc0293031d763947ec08c9eef982ef1d
|
||||
F src/test7.c 2e0781754905c8adc3268d8f0967e7633af58843
|
||||
F src/test8.c 61b41d79509a479dec1ac32b6d4209b27c4b1ba5
|
||||
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
@ -212,28 +212,28 @@ F src/test_hexio.c c4773049603151704a6ab25ac5e936b5109caf5a
|
||||
F src/test_init.c 3cbad7ce525aec925f8fda2192d576d47f0d478a
|
||||
F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99
|
||||
F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
|
||||
F src/test_journal.c a6a6baf343f79b942331f13378d045e7e270ae64
|
||||
F src/test_journal.c b964473ff1b7a65626763f068fa6a810385d1fbf
|
||||
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
||||
F src/test_malloc.c 3f5903a1528fd32fe4c472a3bd0259128d8faaef
|
||||
F src/test_multiplex.c 0404a61d7795438be5ee5fd3711eed80724df34d
|
||||
F src/test_multiplex.c 30ca0348953abd3add46fe4ee19e3f9e669b7e56
|
||||
F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d
|
||||
F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e
|
||||
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
|
||||
F src/test_osinst.c 6abf0a37ce831120c4ef1b913afdd813e7ac1a73
|
||||
F src/test_onefile.c 5e1382e7844c703c77c4c2aee82f8359555b5a8e
|
||||
F src/test_osinst.c 7f790ac89c5a585d51b341274d9691c3391e0923
|
||||
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
|
||||
F src/test_quota.c b4a6519417d87870e7ef5838dbf3cae164dcc28d
|
||||
F src/test_quota.c a545115f837da4ef32f6b5578f147b44cfb13fd7
|
||||
F src/test_quota.h 9ffa1d3ad6d0a6a24e8670ea64b909c717ec3358
|
||||
F src/test_rtree.c 6d06306e29946dc36f528a3a2cdc3add794656f1
|
||||
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
|
||||
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
|
||||
F src/test_stat.c 80271ad7d776a79babe0e025bb3a1bfcd3a3cfb1
|
||||
F src/test_stat.c d7035cfcc0ff1f93c000b621f36524318e004e11
|
||||
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
|
||||
F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
|
||||
F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
|
||||
F src/test_thread.c e286f2173563f2a1747c24bcda6b9d030bf4f4e4
|
||||
F src/test_vfs.c 73f46bd9b5183ebcb77da22773886b81157cdc3d
|
||||
F src/test_vfstrace.c 6b28adb2a0e8ecd0f2e3581482e1f658b11b4067
|
||||
F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290
|
||||
F src/test_wholenumber.c 3d2b9ed1505c40ad5c5ca2ad16ae7a289d6cc251
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/tokenize.c 1e86210d3976717a19238ea7b047fac481fe8c12
|
||||
F src/trigger.c ee7e178fb9188f44b532cebd449a7c1df90fb684
|
||||
@ -999,7 +999,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
|
||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||
P cbdd86387630600b309de4aaeaa131ec7b053ce2
|
||||
R 88f6eca232fcd821cd715bbadb803c37
|
||||
P 36aa6665e709b5942b3558afbd555058b42f2c78
|
||||
R 19f0f46e7579b91721fe0a073b822b78
|
||||
U drh
|
||||
Z a41a68a88bffc936799088c08283176f
|
||||
Z 3f9228d0d5429417687badcbcda00070
|
||||
|
@ -1 +1 @@
|
||||
36aa6665e709b5942b3558afbd555058b42f2c78
|
||||
cb7a850439c9a4a7887650d6b81d95ab8025de5b
|
@ -3263,7 +3263,7 @@ static int test_bind_text16(
|
||||
char *value;
|
||||
int rc;
|
||||
|
||||
void (*xDel)() = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT);
|
||||
void (*xDel)(void*) = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT);
|
||||
Tcl_Obj *oStmt = objv[objc-4];
|
||||
Tcl_Obj *oN = objv[objc-3];
|
||||
Tcl_Obj *oString = objv[objc-2];
|
||||
@ -3611,7 +3611,7 @@ static int test_prepare(
|
||||
if( bytes>=0 ){
|
||||
bytes = bytes - (zTail-zSql);
|
||||
}
|
||||
if( strlen(zTail)<bytes ){
|
||||
if( (int)strlen(zTail)<bytes ){
|
||||
bytes = strlen(zTail);
|
||||
}
|
||||
Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0);
|
||||
@ -5816,6 +5816,7 @@ struct win32FileLocker {
|
||||
|
||||
|
||||
#if SQLITE_OS_WIN
|
||||
#include <process.h>
|
||||
/*
|
||||
** The background thread that does file locking.
|
||||
*/
|
||||
@ -6128,7 +6129,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_COLUMN_METADATA
|
||||
{"sqlite3_column_database_name16",
|
||||
test_stmt_utf16, sqlite3_column_database_name16},
|
||||
test_stmt_utf16, (void*)sqlite3_column_database_name16},
|
||||
{"sqlite3_column_table_name16", test_stmt_utf16, (void*)sqlite3_column_table_name16},
|
||||
{"sqlite3_column_origin_name16", test_stmt_utf16, (void*)sqlite3_column_origin_name16},
|
||||
#endif
|
||||
|
@ -465,7 +465,7 @@ static int btree_varint_test(
|
||||
if( Tcl_GetInt(interp, argv[4], (int*)&incr) ) return TCL_ERROR;
|
||||
in = start;
|
||||
in *= mult;
|
||||
for(i=0; i<count; i++){
|
||||
for(i=0; i<(int)count; i++){
|
||||
char zErr[200];
|
||||
n1 = putVarint(zBuf, in);
|
||||
if( n1>9 || n1<1 ){
|
||||
|
16
src/test6.c
16
src/test6.c
@ -177,7 +177,7 @@ static int writeDbFile(CrashFile *p, u8 *z, i64 iAmt, i64 iOff){
|
||||
iSkip = 512;
|
||||
}
|
||||
if( (iAmt-iSkip)>0 ){
|
||||
rc = sqlite3OsWrite(p->pRealFile, &z[iSkip], iAmt-iSkip, iOff+iSkip);
|
||||
rc = sqlite3OsWrite(p->pRealFile, &z[iSkip], (int)(iAmt-iSkip), iOff+iSkip);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -306,8 +306,8 @@ static int writeListSync(CrashFile *pFile, int isCrash){
|
||||
}
|
||||
case 3: { /* Trash sectors */
|
||||
u8 *zGarbage;
|
||||
int iFirst = (pWrite->iOffset/g.iSectorSize);
|
||||
int iLast = (pWrite->iOffset+pWrite->nBuf-1)/g.iSectorSize;
|
||||
int iFirst = (int)(pWrite->iOffset/g.iSectorSize);
|
||||
int iLast = (int)((pWrite->iOffset+pWrite->nBuf-1)/g.iSectorSize);
|
||||
|
||||
assert(pWrite->zBuf);
|
||||
|
||||
@ -430,7 +430,7 @@ static int cfWrite(
|
||||
){
|
||||
CrashFile *pCrash = (CrashFile *)pFile;
|
||||
if( iAmt+iOfst>pCrash->iSize ){
|
||||
pCrash->iSize = iAmt+iOfst;
|
||||
pCrash->iSize = (int)(iAmt+iOfst);
|
||||
}
|
||||
while( pCrash->iSize>pCrash->nData ){
|
||||
u8 *zNew;
|
||||
@ -454,7 +454,7 @@ static int cfTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
CrashFile *pCrash = (CrashFile *)pFile;
|
||||
assert(size>=0);
|
||||
if( pCrash->iSize>size ){
|
||||
pCrash->iSize = size;
|
||||
pCrash->iSize = (int)size;
|
||||
}
|
||||
return writeListAppend(pFile, size, 0, 0);
|
||||
}
|
||||
@ -518,7 +518,7 @@ static int cfFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
i64 nByte = *(i64 *)pArg;
|
||||
if( nByte>pCrash->iSize ){
|
||||
if( SQLITE_OK==writeListAppend(pFile, nByte, 0, 0) ){
|
||||
pCrash->iSize = nByte;
|
||||
pCrash->iSize = (int)nByte;
|
||||
}
|
||||
}
|
||||
return SQLITE_OK;
|
||||
@ -635,11 +635,11 @@ static int cfOpen(
|
||||
iChunk = PENDING_BYTE;
|
||||
}
|
||||
memset(pWrapper->zData, 0, pWrapper->nData);
|
||||
rc = sqlite3OsRead(pReal, pWrapper->zData, iChunk, 0);
|
||||
rc = sqlite3OsRead(pReal, pWrapper->zData, (int)iChunk, 0);
|
||||
if( SQLITE_OK==rc && pWrapper->iSize>(PENDING_BYTE+512) && isDb ){
|
||||
i64 iOff = PENDING_BYTE+512;
|
||||
iChunk = pWrapper->iSize - iOff;
|
||||
rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], iChunk, iOff);
|
||||
rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], (int)iChunk, iOff);
|
||||
}
|
||||
}else{
|
||||
rc = SQLITE_NOMEM;
|
||||
|
@ -404,7 +404,7 @@ static int openTransaction(jt_file *pMain, jt_file *pJournal){
|
||||
/* Calculate and store a checksum for each page in the database file. */
|
||||
if( rc==SQLITE_OK ){
|
||||
int ii;
|
||||
for(ii=0; rc==SQLITE_OK && ii<pMain->nPage; ii++){
|
||||
for(ii=0; rc==SQLITE_OK && ii<(int)pMain->nPage; ii++){
|
||||
i64 iOff = (i64)(pMain->nPagesize) * (i64)ii;
|
||||
if( iOff==PENDING_BYTE ) continue;
|
||||
rc = sqlite3OsRead(pMain->pReal, aData, pMain->nPagesize, iOff);
|
||||
@ -466,7 +466,7 @@ static int readJournalFile(jt_file *p, jt_file *pMain){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
nRec = (iSize-iOff) / (pMain->nPagesize+8);
|
||||
nRec = (u32)((iSize-iOff) / (pMain->nPagesize+8));
|
||||
}
|
||||
|
||||
/* Read all the records that follow the journal-header just read. */
|
||||
@ -538,7 +538,7 @@ static int jtWrite(
|
||||
}
|
||||
|
||||
if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){
|
||||
if( iAmt<p->nPagesize
|
||||
if( iAmt<(int)p->nPagesize
|
||||
&& p->nPagesize%iAmt==0
|
||||
&& iOfst>=(PENDING_BYTE+512)
|
||||
&& iOfst+iAmt<=PENDING_BYTE+p->nPagesize
|
||||
@ -549,7 +549,7 @@ static int jtWrite(
|
||||
** pending-byte page.
|
||||
*/
|
||||
}else{
|
||||
u32 pgno = iOfst/p->nPagesize + 1;
|
||||
u32 pgno = (u32)(iOfst/p->nPagesize + 1);
|
||||
assert( (iAmt==1||iAmt==p->nPagesize) && ((iOfst+iAmt)%p->nPagesize)==0 );
|
||||
assert( pgno<=p->nPage || p->nSync>0 );
|
||||
assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) );
|
||||
@ -578,7 +578,7 @@ static int jtTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){
|
||||
u32 pgno;
|
||||
u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1);
|
||||
for(pgno=size/p->nPagesize+1; pgno<=p->nPage; pgno++){
|
||||
for(pgno=(u32)(size/p->nPagesize+1); pgno<=p->nPage; pgno++){
|
||||
assert( pgno==locking_page || sqlite3BitvecTest(p->pWritable, pgno) );
|
||||
}
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ static int multiplexOpen(
|
||||
pGroup->bEnabled = -1;
|
||||
pGroup->bTruncate = sqlite3_uri_boolean(zUri, "truncate",
|
||||
(flags & SQLITE_OPEN_MAIN_DB)==0);
|
||||
pGroup->szChunk = sqlite3_uri_int64(zUri, "chunksize",
|
||||
pGroup->szChunk = (int)sqlite3_uri_int64(zUri, "chunksize",
|
||||
SQLITE_MULTIPLEX_CHUNK_SIZE);
|
||||
pGroup->szChunk = (pGroup->szChunk+0xffff)&~0xffff;
|
||||
if( zName ){
|
||||
@ -597,7 +597,7 @@ static int multiplexOpen(
|
||||
bExists = multiplexSubSize(pGroup, 1, &rc)>0;
|
||||
if( rc==SQLITE_OK && bExists && sz==(sz&0xffff0000) && sz>0
|
||||
&& sz!=pGroup->szChunk ){
|
||||
pGroup->szChunk = sz;
|
||||
pGroup->szChunk = (int)sz;
|
||||
}else if( rc==SQLITE_OK && !bExists && sz>pGroup->szChunk ){
|
||||
pGroup->bEnabled = 0;
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ static int tmpWrite(
|
||||
){
|
||||
tmp_file *pTmp = (tmp_file *)pFile;
|
||||
if( (iAmt+iOfst)>pTmp->nAlloc ){
|
||||
int nNew = 2*(iAmt+iOfst+pTmp->nAlloc);
|
||||
int nNew = (int)(2*(iAmt+iOfst+pTmp->nAlloc));
|
||||
char *zNew = sqlite3_realloc(pTmp->zAlloc, nNew);
|
||||
if( !zNew ){
|
||||
return SQLITE_NOMEM;
|
||||
@ -297,7 +297,7 @@ static int tmpWrite(
|
||||
pTmp->nAlloc = nNew;
|
||||
}
|
||||
memcpy(&pTmp->zAlloc[iOfst], zBuf, iAmt);
|
||||
pTmp->nSize = MAX(pTmp->nSize, iOfst+iAmt);
|
||||
pTmp->nSize = (int)MAX(pTmp->nSize, iOfst+iAmt);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ static int tmpWrite(
|
||||
*/
|
||||
static int tmpTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
tmp_file *pTmp = (tmp_file *)pFile;
|
||||
pTmp->nSize = MIN(pTmp->nSize, size);
|
||||
pTmp->nSize = (int)MIN(pTmp->nSize, size);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ static int fsRead(
|
||||
/* Journal file. */
|
||||
int iRem = iAmt;
|
||||
int iBuf = 0;
|
||||
int ii = iOfst;
|
||||
int ii = (int)iOfst;
|
||||
while( iRem>0 && rc==SQLITE_OK ){
|
||||
int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
|
||||
int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
|
||||
@ -453,14 +453,14 @@ static int fsWrite(
|
||||
}else{
|
||||
rc = pF->pMethods->xWrite(pF, zBuf, iAmt, iOfst+BLOCKSIZE);
|
||||
if( rc==SQLITE_OK ){
|
||||
pReal->nDatabase = MAX(pReal->nDatabase, iAmt+iOfst);
|
||||
pReal->nDatabase = (int)MAX(pReal->nDatabase, iAmt+iOfst);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
/* Journal file. */
|
||||
int iRem = iAmt;
|
||||
int iBuf = 0;
|
||||
int ii = iOfst;
|
||||
int ii = (int)iOfst;
|
||||
while( iRem>0 && rc==SQLITE_OK ){
|
||||
int iRealOff = pReal->nBlob - BLOCKSIZE*((ii/BLOCKSIZE)+1) + ii%BLOCKSIZE;
|
||||
int iRealAmt = MIN(iRem, BLOCKSIZE - (iRealOff%BLOCKSIZE));
|
||||
@ -475,7 +475,7 @@ static int fsWrite(
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
pReal->nJournal = MAX(pReal->nJournal, iAmt+iOfst);
|
||||
pReal->nJournal = (int)MAX(pReal->nJournal, iAmt+iOfst);
|
||||
}
|
||||
}
|
||||
|
||||
@ -489,9 +489,9 @@ static int fsTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
fs_file *p = (fs_file *)pFile;
|
||||
fs_real_file *pReal = p->pReal;
|
||||
if( p->eType==DATABASE_FILE ){
|
||||
pReal->nDatabase = MIN(pReal->nDatabase, size);
|
||||
pReal->nDatabase = (int)MIN(pReal->nDatabase, size);
|
||||
}else{
|
||||
pReal->nJournal = MIN(pReal->nJournal, size);
|
||||
pReal->nJournal = (int)MIN(pReal->nJournal, size);
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -641,7 +641,7 @@ static int fsOpen(
|
||||
pReal->nBlob = BLOBSIZE;
|
||||
}else{
|
||||
unsigned char zS[4];
|
||||
pReal->nBlob = size;
|
||||
pReal->nBlob = (int)size;
|
||||
rc = pRealFile->pMethods->xRead(pRealFile, zS, 4, 0);
|
||||
pReal->nDatabase = (zS[0]<<24)+(zS[1]<<16)+(zS[2]<<8)+zS[3];
|
||||
if( rc==SQLITE_OK ){
|
||||
|
@ -242,7 +242,7 @@ static sqlite3_uint64 vfslog_time(){
|
||||
}
|
||||
#endif
|
||||
|
||||
static void vfslog_call(sqlite3_vfs *, int, int, int, int, int, int);
|
||||
static void vfslog_call(sqlite3_vfs *, int, int, sqlite3_int64, int, int, int);
|
||||
static void vfslog_string(sqlite3_vfs *, const char *);
|
||||
|
||||
/*
|
||||
@ -648,7 +648,7 @@ static void vfslog_call(
|
||||
sqlite3_vfs *pVfs,
|
||||
int eEvent,
|
||||
int iFileid,
|
||||
int nClick,
|
||||
sqlite3_int64 nClick,
|
||||
int return_code,
|
||||
int size,
|
||||
int offset
|
||||
@ -661,7 +661,7 @@ static void vfslog_call(
|
||||
zRec = (unsigned char *)&p->aBuf[p->nBuf];
|
||||
put32bits(&zRec[0], eEvent);
|
||||
put32bits(&zRec[4], iFileid);
|
||||
put32bits(&zRec[8], nClick);
|
||||
put32bits(&zRec[8], (unsigned int)(nClick&0xffff));
|
||||
put32bits(&zRec[12], return_code);
|
||||
put32bits(&zRec[16], size);
|
||||
put32bits(&zRec[20], offset);
|
||||
@ -1043,7 +1043,7 @@ static int vlogColumn(
|
||||
}
|
||||
case 1: {
|
||||
char *zStr = pCsr->zTransient;
|
||||
if( val!=0 && val<pCsr->nFile ){
|
||||
if( val!=0 && val<(unsigned)pCsr->nFile ){
|
||||
zStr = pCsr->azFile[val];
|
||||
}
|
||||
sqlite3_result_text(ctx, zStr, -1, SQLITE_TRANSIENT);
|
||||
|
@ -1060,7 +1060,7 @@ size_t sqlite3_quota_fwrite(
|
||||
}
|
||||
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
|
||||
iEnd = pGroup->iLimit - pGroup->iSize + pFile->iSize;
|
||||
nmemb = (iEnd - iOfst)/size;
|
||||
nmemb = (size_t)((iEnd - iOfst)/size);
|
||||
iEnd = iOfst + size*nmemb;
|
||||
szNew = pGroup->iSize - pFile->iSize + iEnd;
|
||||
}
|
||||
|
@ -324,12 +324,13 @@ static int statDecodePage(Btree *pBt, StatPage *p){
|
||||
u64 dummy;
|
||||
iOff += sqlite3GetVarint(&aData[iOff], &dummy);
|
||||
}
|
||||
if( nPayload>p->nMxPayload ) p->nMxPayload = nPayload;
|
||||
if( nPayload>(u32)p->nMxPayload ) p->nMxPayload = nPayload;
|
||||
getLocalPayload(nUsable, p->flags, nPayload, &nLocal);
|
||||
pCell->nLocal = nLocal;
|
||||
assert( nLocal>=0 );
|
||||
assert( nPayload>=nLocal );
|
||||
assert( nLocal<=(nUsable-35) );
|
||||
if( nPayload>nLocal ){
|
||||
if( nPayload>(u32)nLocal ){
|
||||
int j;
|
||||
int nOvfl = ((nPayload - nLocal) + nUsable-4 - 1) / (nUsable - 4);
|
||||
pCell->nLastOvfl = (nPayload-nLocal) - (nOvfl-1) * (nUsable-4);
|
||||
@ -378,7 +379,7 @@ static void statSizeAndOffset(StatCursor *pCsr){
|
||||
x[0] = pCsr->iPageno;
|
||||
if( sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
|
||||
pCsr->iOffset = x[0];
|
||||
pCsr->szPage = x[1];
|
||||
pCsr->szPage = (int)x[1];
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,7 +401,7 @@ static int statNext(sqlite3_vtab_cursor *pCursor){
|
||||
rc = sqlite3_step(pCsr->pStmt);
|
||||
if( rc==SQLITE_ROW ){
|
||||
int nPage;
|
||||
u32 iRoot = sqlite3_column_int64(pCsr->pStmt, 1);
|
||||
u32 iRoot = (u32)sqlite3_column_int64(pCsr->pStmt, 1);
|
||||
sqlite3PagerPagecount(pPager, &nPage);
|
||||
if( nPage==0 ){
|
||||
pCsr->isEof = 1;
|
||||
|
@ -33,8 +33,8 @@
|
||||
typedef struct wholenumber_cursor wholenumber_cursor;
|
||||
struct wholenumber_cursor {
|
||||
sqlite3_vtab_cursor base; /* Base class - must be first */
|
||||
unsigned iValue; /* Current value */
|
||||
unsigned mxValue; /* Maximum value */
|
||||
sqlite3_int64 iValue; /* Current value */
|
||||
sqlite3_int64 mxValue; /* Maximum value */
|
||||
};
|
||||
|
||||
/* Methods for the wholenumber module */
|
||||
|
Reference in New Issue
Block a user