Fix harmless compiler warnings.
FossilOrigin-Name: f8f72ecb9052a4cace1db75879fb8b5131ea4f50
This commit is contained in:
parent
e9af1894e3
commit
958d261bb8
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Merge\srecent\strunk\schanges\sinto\sthe\sthreads\sbranch.
|
||||
D 2014-04-18T12:38:54.966
|
||||
C Fix\sharmless\scompiler\swarnings.
|
||||
D 2014-04-18T13:40:07.511
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in ad0921c4b2780d01868cf69b419a4f102308d125
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -279,14 +279,14 @@ F src/update.c 5b3e74a03b3811e586b4f2b4cbd7c49f01c93115
|
||||
F src/utf.c 6dc9ec9f1b3db43ae8ba0365377f11df1ee4c01c
|
||||
F src/util.c c46c90459ef9bdc0c6c73803cf4c55425b4771cf
|
||||
F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179
|
||||
F src/vdbe.c cba6c791a3621de633cc018f09c81aa472072d42
|
||||
F src/vdbe.c b50cd3009a2e3067746c73dce36153f19df2e42e
|
||||
F src/vdbe.h 394464909ed682334aa3d5831aae0c2fe2abef94
|
||||
F src/vdbeInt.h ba1069627d0ab75e9ddb8f9c10958b86cdbd333d
|
||||
F src/vdbeInt.h c78ace64dc37495806dd50596eded1f6cd2b5a64
|
||||
F src/vdbeapi.c 0ed6053f947edd0b30f64ce5aeb811872a3450a4
|
||||
F src/vdbeaux.c 8289ed68e2262844334461ccb1b91c4d55b29b0b
|
||||
F src/vdbeblob.c 9205ce9d3b064d9600f8418a897fc88b5687d9ac
|
||||
F src/vdbemem.c 6fc77594c60f6155404f3f8d71bf36d1fdeb4447
|
||||
F src/vdbesort.c a41721a8e97735597afb80c930f04f195d86a817
|
||||
F src/vdbesort.c f93c8aaff5398a702a7b49aae128031e050300b9
|
||||
F src/vdbetrace.c 6f52bc0c51e144b7efdcfb2a8f771167a8816767
|
||||
F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
|
||||
F src/wal.c 76e7fc6de229bea8b30bb2539110f03a494dc3a8
|
||||
@ -1164,7 +1164,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||
P 12b190db1d20c34390c768614b40ff58a9d3b74c 2c5363873a6f990a0abaacac6303acd46b48befc
|
||||
R bb69be65b78f81eaebedcfbb221ccbdc
|
||||
P 8729aa3e3ed1da2e15408ef8705cbe185cd2a5ac
|
||||
R 1501533958e541baa710100e336c4bc8
|
||||
U drh
|
||||
Z b1d3cff21f914d2f704f3c429938823e
|
||||
Z 328a0fa311f69db138a2df8298545ace
|
||||
|
@ -1 +1 @@
|
||||
8729aa3e3ed1da2e15408ef8705cbe185cd2a5ac
|
||||
f8f72ecb9052a4cace1db75879fb8b5131ea4f50
|
@ -4234,6 +4234,7 @@ case OP_SorterCompare: {
|
||||
assert( pOp->p4type==P4_INT32 );
|
||||
pIn3 = &aMem[pOp->p3];
|
||||
nIgnore = pOp->p4.i;
|
||||
res = 0;
|
||||
rc = sqlite3VdbeSorterCompare(pC, pIn3, nIgnore, &res);
|
||||
VdbeBranchTaken(res!=0,2);
|
||||
if( res ){
|
||||
@ -4483,7 +4484,7 @@ case OP_Rewind: { /* jump */
|
||||
assert( isSorter(pC)==(pOp->opcode==OP_SorterSort) );
|
||||
res = 1;
|
||||
if( isSorter(pC) ){
|
||||
rc = sqlite3VdbeSorterRewind(db, pC, &res);
|
||||
rc = sqlite3VdbeSorterRewind(pC, &res);
|
||||
}else{
|
||||
pCrsr = pC->pCursor;
|
||||
assert( pCrsr );
|
||||
@ -4642,7 +4643,7 @@ case OP_IdxInsert: { /* in2 */
|
||||
rc = ExpandBlob(pIn2);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( isSorter(pC) ){
|
||||
rc = sqlite3VdbeSorterWrite(db, pC, pIn2);
|
||||
rc = sqlite3VdbeSorterWrite(pC, pIn2);
|
||||
}else{
|
||||
nKey = pIn2->n;
|
||||
zKey = pIn2->z;
|
||||
|
@ -442,8 +442,8 @@ void sqlite3VdbeSorterReset(sqlite3 *, VdbeSorter *);
|
||||
void sqlite3VdbeSorterClose(sqlite3 *, VdbeCursor *);
|
||||
int sqlite3VdbeSorterRowkey(const VdbeCursor *, Mem *);
|
||||
int sqlite3VdbeSorterNext(sqlite3 *, const VdbeCursor *, int *);
|
||||
int sqlite3VdbeSorterRewind(sqlite3 *, const VdbeCursor *, int *);
|
||||
int sqlite3VdbeSorterWrite(sqlite3 *, const VdbeCursor *, Mem *);
|
||||
int sqlite3VdbeSorterRewind(const VdbeCursor *, int *);
|
||||
int sqlite3VdbeSorterWrite(const VdbeCursor *, Mem *);
|
||||
int sqlite3VdbeSorterCompare(const VdbeCursor *, Mem *, int, int *);
|
||||
|
||||
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0
|
||||
|
@ -589,7 +589,7 @@ static int vdbePmaReadVarint(PmaReader *p, u64 *pnOut){
|
||||
static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 **pp){
|
||||
int rc = SQLITE_OK;
|
||||
if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){
|
||||
rc = sqlite3OsFetch(pFile->pFd, 0, pFile->iEof, (void**)pp);
|
||||
rc = sqlite3OsFetch(pFile->pFd, 0, (int)pFile->iEof, (void**)pp);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -914,9 +914,9 @@ static void vdbeSorterWorkDebug(SortSubtask *pTask, const char *zEvent){
|
||||
sqlite3OsCurrentTimeInt64(pTask->pSorter->db->pVfs, &t);
|
||||
fprintf(stderr, "%lld:%d %s\n", t, iTask, zEvent);
|
||||
}
|
||||
static void vdbeSorterRewindDebug(sqlite3 *db, const char *zEvent){
|
||||
static void vdbeSorterRewindDebug(const char *zEvent){
|
||||
i64 t;
|
||||
sqlite3OsCurrentTimeInt64(db->pVfs, &t);
|
||||
sqlite3OsCurrentTimeInt64(sqlite3_vfs_find(0), &t);
|
||||
fprintf(stderr, "%lld:X %s\n", t, zEvent);
|
||||
}
|
||||
static void vdbeSorterPopulateDebug(
|
||||
@ -941,7 +941,7 @@ static void vdbeSorterBlockDebug(
|
||||
}
|
||||
#else
|
||||
# define vdbeSorterWorkDebug(x,y)
|
||||
# define vdbeSorterRewindDebug(x,y)
|
||||
# define vdbeSorterRewindDebug(y)
|
||||
# define vdbeSorterPopulateDebug(x,y)
|
||||
# define vdbeSorterBlockDebug(x,y,z)
|
||||
#endif
|
||||
@ -1109,7 +1109,7 @@ static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFile, i64 nByte){
|
||||
int rc = sqlite3OsTruncate(pFile, nByte);
|
||||
if( rc==SQLITE_OK ){
|
||||
void *p = 0;
|
||||
sqlite3OsFetch(pFile, 0, nByte, &p);
|
||||
sqlite3OsFetch(pFile, 0, (int)nByte, &p);
|
||||
sqlite3OsUnfetch(pFile, 0, p);
|
||||
}
|
||||
}
|
||||
@ -1484,6 +1484,7 @@ static int vdbeSorterNext(
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_WORKER_THREADS>0
|
||||
/*
|
||||
** The main routine for background threads that write level-0 PMAs.
|
||||
*/
|
||||
@ -1495,6 +1496,7 @@ static void *vdbeSorterFlushThread(void *pCtx){
|
||||
pTask->bDone = 1;
|
||||
return SQLITE_INT_TO_PTR(rc);
|
||||
}
|
||||
#endif /* SQLITE_MAX_WORKER_THREADS>0 */
|
||||
|
||||
/*
|
||||
** Flush the current contents of VdbeSorter.list to a new PMA, possibly
|
||||
@ -1561,14 +1563,13 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){
|
||||
}
|
||||
|
||||
return rc;
|
||||
#endif
|
||||
#endif /* SQLITE_MAX_WORKER_THREADS!=0 */
|
||||
}
|
||||
|
||||
/*
|
||||
** Add a record to the sorter.
|
||||
*/
|
||||
int sqlite3VdbeSorterWrite(
|
||||
sqlite3 *db, /* Database handle */
|
||||
const VdbeCursor *pCsr, /* Sorter cursor */
|
||||
Mem *pVal /* Memory cell containing record */
|
||||
){
|
||||
@ -1643,7 +1644,7 @@ int sqlite3VdbeSorterWrite(
|
||||
|
||||
pNew = (SorterRecord*)&pSorter->list.aMemory[pSorter->iMemory];
|
||||
pSorter->iMemory += ROUND8(nReq);
|
||||
pNew->u.iNext = (u8*)(pSorter->list.pList) - pSorter->list.aMemory;
|
||||
pNew->u.iNext = (int)((u8*)(pSorter->list.pList) - pSorter->list.aMemory);
|
||||
}else{
|
||||
pNew = (SorterRecord *)sqlite3Malloc(nReq);
|
||||
if( pNew==0 ){
|
||||
@ -1798,6 +1799,7 @@ static int vdbeIncrNew(
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_WORKER_THREADS>0
|
||||
/*
|
||||
** Set the "use-threads" flag on object pIncr.
|
||||
*/
|
||||
@ -1807,6 +1809,7 @@ static void vdbeIncrSetThreads(IncrMerger *pIncr, int bUseThread){
|
||||
pIncr->pTask->file2.iEof -= pIncr->mxSz;
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_MAX_WORKER_THREADS>0 */
|
||||
|
||||
#define INCRINIT_NORMAL 0
|
||||
#define INCRINIT_TASK 1
|
||||
@ -2159,13 +2162,15 @@ static int vdbeSorterSetupMerge(VdbeSorter *pSorter){
|
||||
int rc; /* Return code */
|
||||
SortSubtask *pTask0 = &pSorter->aTask[0];
|
||||
MergeEngine *pMain = 0;
|
||||
#if SQLITE_MAX_WORKER_THREADS
|
||||
sqlite3 *db = pTask0->pSorter->db;
|
||||
int iTask;
|
||||
#endif
|
||||
|
||||
rc = vdbeSorterMergeTreeBuild(pSorter, &pMain);
|
||||
if( rc==SQLITE_OK ){
|
||||
#if SQLITE_MAX_WORKER_THREADS
|
||||
if( pSorter->bUseThreads ){
|
||||
int iTask;
|
||||
PmaReader *pIter;
|
||||
SortSubtask *pLast = &pSorter->aTask[pSorter->nTask-1];
|
||||
rc = vdbeSortAllocUnpacked(pLast);
|
||||
@ -2219,7 +2224,7 @@ static int vdbeSorterSetupMerge(VdbeSorter *pSorter){
|
||||
** this function is called to prepare for iterating through the records
|
||||
** in sorted order.
|
||||
*/
|
||||
int sqlite3VdbeSorterRewind(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){
|
||||
int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *pbEof){
|
||||
VdbeSorter *pSorter = pCsr->pSorter;
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
|
||||
@ -2246,7 +2251,7 @@ int sqlite3VdbeSorterRewind(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){
|
||||
/* Join all threads */
|
||||
rc = vdbeSorterJoinAll(pSorter, rc);
|
||||
|
||||
vdbeSorterRewindDebug(db, "rewind");
|
||||
vdbeSorterRewindDebug("rewind");
|
||||
|
||||
/* Assuming no errors have occurred, set up a merger structure to
|
||||
** incrementally read and merge all remaining PMAs. */
|
||||
@ -2256,7 +2261,7 @@ int sqlite3VdbeSorterRewind(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){
|
||||
*pbEof = 0;
|
||||
}
|
||||
|
||||
vdbeSorterRewindDebug(db, "rewinddone");
|
||||
vdbeSorterRewindDebug("rewinddone");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user