Fix harmless compiler warnings in lsmtest.
FossilOrigin-Name: bd8a1fb9b33418717c786a7275f636cd4d5facd66de9a416f948b61c6490c743
This commit is contained in:
parent
4a9e14077e
commit
b2950c48e1
@ -41,7 +41,7 @@ LSMTESTSRC = $(LSMDIR)\lsm-test\lsmtest1.c $(LSMDIR)\lsm-test\lsmtest2.c \
|
||||
|
||||
# all: lsm.dll
|
||||
|
||||
LSMOPTS = -DLSM_MUTEX_WIN32=1 -I$(LSMDIR)
|
||||
LSMOPTS = $(NO_WARN) -DLSM_MUTEX_WIN32=1 -I$(LSMDIR)
|
||||
|
||||
!IF $(DEBUG)>2
|
||||
LSMOPTS = $(LSMOPTS) -DLSM_DEBUG=1
|
||||
|
@ -200,7 +200,7 @@ static void testOomScan(
|
||||
int rc;
|
||||
int iScan = 0;
|
||||
lsm_cursor *pCsr;
|
||||
int (*xAdvance)(lsm_cursor *);
|
||||
int (*xAdvance)(lsm_cursor *) = 0;
|
||||
|
||||
|
||||
rc = lsm_csr_open(pDb, &pCsr);
|
||||
@ -353,7 +353,7 @@ static int lsmWriteStr(lsm_db *pDb, const char *zKey, const char *zVal){
|
||||
return lsm_insert(pDb, (void *)zKey, nKey, (void *)zVal, nVal);
|
||||
}
|
||||
|
||||
static void setup_delete_db(){
|
||||
static void setup_delete_db(void){
|
||||
testDeleteLsmdb(LSMTEST6_TESTDB);
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ static void setup_delete_db(){
|
||||
** "seven" -> "fourtynine"
|
||||
** "eight" -> "sixtyfour"
|
||||
*/
|
||||
static void setup_populate_db(){
|
||||
static void setup_populate_db(void){
|
||||
const char *azStr[] = {
|
||||
"one", "one",
|
||||
"two", "four",
|
||||
@ -411,7 +411,7 @@ static Datasource *getDatasource(void){
|
||||
** * Contains 5000 key-value pairs starting at 0 from the
|
||||
** datasource returned getDatasource().
|
||||
*/
|
||||
static void setup_populate_db2(){
|
||||
static void setup_populate_db2(void){
|
||||
Datasource *pData;
|
||||
int ii;
|
||||
int rc;
|
||||
|
@ -92,7 +92,8 @@ void testReadFile(const char *zFile, int iOff, void *pOut, int nByte, int *pRc){
|
||||
if( 0!=fseek(fd, iOff, SEEK_SET) ){
|
||||
*pRc = 1;
|
||||
}else{
|
||||
if( nByte!=fread(pOut, 1, nByte, fd) ){
|
||||
assert( nByte>=0 );
|
||||
if( (size_t)nByte!=fread(pOut, 1, nByte, fd) ){
|
||||
*pRc = 1;
|
||||
}
|
||||
}
|
||||
@ -117,7 +118,8 @@ void testWriteFile(
|
||||
if( 0!=fseek(fd, iOff, SEEK_SET) ){
|
||||
*pRc = 1;
|
||||
}else{
|
||||
if( nByte!=fwrite(pOut, 1, nByte, fd) ){
|
||||
assert( nByte>=0 );
|
||||
if( (size_t)nByte!=fwrite(pOut, 1, nByte, fd) ){
|
||||
*pRc = 1;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ static int doOneCmd(
|
||||
int nPg;
|
||||
int iPg;
|
||||
|
||||
nByte = getNextSize(z, &z, &rc);
|
||||
nByte = (int)getNextSize(z, &z, &rc);
|
||||
if( rc || *z!='@' ) goto bad_command;
|
||||
z++;
|
||||
iOff = getNextSize(z, &z, &rc);
|
||||
@ -155,7 +155,7 @@ static int doOneCmd(
|
||||
if( pzOut ) *pzOut = z;
|
||||
|
||||
nPg = (nByte+pgsz-1) / pgsz;
|
||||
lseek(pCtx->fd, iOff, SEEK_SET);
|
||||
lseek(pCtx->fd, (off_t)iOff, SEEK_SET);
|
||||
for(iPg=0; iPg<nPg; iPg++){
|
||||
write(pCtx->fd, aData, pgsz);
|
||||
}
|
||||
@ -211,7 +211,7 @@ int do_io(int nArg, char **azArg){
|
||||
zFile = azArg[0];
|
||||
zPgsz = azArg[1];
|
||||
|
||||
pgsz = getNextSize(zPgsz, 0, &rc);
|
||||
pgsz = (int)getNextSize(zPgsz, 0, &rc);
|
||||
if( pgsz<=0 ){
|
||||
testPrintError("Ridiculous page size: %d", pgsz);
|
||||
return -1;
|
||||
|
@ -902,7 +902,7 @@ int do_speed_tests(int nArg, char **azArg){
|
||||
testTimeInit();
|
||||
for(i=0; i<nRow; i+=nStep){
|
||||
int iStep;
|
||||
int nWrite1, nWrite2;
|
||||
int nWrite1 = 0, nWrite2 = 0;
|
||||
testCaseProgress(i, nRow, testCaseNDot(), &iDot);
|
||||
if( pLsm ) lsm_info(pLsm, LSM_INFO_NWRITE, &nWrite1);
|
||||
for(iStep=0; iStep<nStep; iStep++){
|
||||
|
@ -45,9 +45,9 @@ struct TmGlobal {
|
||||
void (*xDelMutex)(TmGlobal*); /* Call this to delete mutex */
|
||||
void *pMutex; /* Mutex handle */
|
||||
|
||||
void *xSaveMalloc;
|
||||
void *xSaveRealloc;
|
||||
void *xSaveFree;
|
||||
void *(*xSaveMalloc)(void *, size_t);
|
||||
void *(*xSaveRealloc)(void *, void *, size_t);
|
||||
void (*xSaveFree)(void *, void *);
|
||||
|
||||
/* OOM injection scheduling. If nCountdown is greater than zero when a
|
||||
** malloc attempt is made, it is decremented. If this means nCountdown
|
||||
@ -183,7 +183,7 @@ static void tmFree(TmGlobal *pTm, void *p){
|
||||
u8 *pUser = (u8 *)p;
|
||||
|
||||
tmEnterMutex(pTm);
|
||||
pHdr = (TmBlockHdr *)&pUser[BLOCK_HDR_SIZE * -1];
|
||||
pHdr = (TmBlockHdr *)(pUser - BLOCK_HDR_SIZE);
|
||||
assert( pHdr->iForeGuard==FOREGUARD );
|
||||
assert( 0==memcmp(&pUser[pHdr->nByte], &rearguard, 4) );
|
||||
|
||||
@ -218,7 +218,7 @@ static void *tmRealloc(TmGlobal *pTm, void *p, int nByte){
|
||||
if( pNew && p ){
|
||||
TmBlockHdr *pHdr;
|
||||
u8 *pUser = (u8 *)p;
|
||||
pHdr = (TmBlockHdr *)&pUser[BLOCK_HDR_SIZE * -1];
|
||||
pHdr = (TmBlockHdr *)(pUser - BLOCK_HDR_SIZE);
|
||||
memcpy(pNew, p, MIN(nByte, pHdr->nByte));
|
||||
tmFree(pTm, p);
|
||||
}
|
||||
@ -355,9 +355,9 @@ void testMallocInstall(lsm_env *pEnv){
|
||||
pGlobal->xDelMutex = tmLsmMutexDel;
|
||||
pGlobal->pMutex = (void *)pMutex;
|
||||
|
||||
pGlobal->xSaveMalloc = (void *)pEnv->xMalloc;
|
||||
pGlobal->xSaveRealloc = (void *)pEnv->xRealloc;
|
||||
pGlobal->xSaveFree = (void *)pEnv->xFree;
|
||||
pGlobal->xSaveMalloc = pEnv->xMalloc;
|
||||
pGlobal->xSaveRealloc = pEnv->xRealloc;
|
||||
pGlobal->xSaveFree = pEnv->xFree;
|
||||
|
||||
/* Set up pEnv to the use the new TmGlobal */
|
||||
pEnv->pMemCtx = (void *)pGlobal;
|
||||
|
@ -767,7 +767,8 @@ int tdb_open(const char *zLib, const char *zDb, int bClear, TestDb **ppDb){
|
||||
if( *zSpec=='\0' ) zSpec = 0;
|
||||
|
||||
for(i=0; i<ArraySize(aLib); i++){
|
||||
if( strlen(aLib[i].zName)==nLib && 0==memcmp(zLib, aLib[i].zName, nLib) ){
|
||||
if( (int)strlen(aLib[i].zName)==nLib
|
||||
&& 0==memcmp(zLib, aLib[i].zName, nLib) ){
|
||||
rc = aLib[i].xOpen(zSpec, (zDb ? zDb : aLib[i].zDefaultDb), bClear, ppDb);
|
||||
if( rc==0 ){
|
||||
(*ppDb)->zLibrary = aLib[i].zName;
|
||||
|
@ -199,33 +199,33 @@ static int testEnvWrite(lsm_file *pFile, lsm_i64 iOff, void *pData, int nData){
|
||||
if( pDb->bCrashed ) return LSM_IOERR;
|
||||
|
||||
if( pDb->bPrepareCrash ){
|
||||
FileData *pData = &pDb->aFile[p->bLog];
|
||||
FileData *pData2 = &pDb->aFile[p->bLog];
|
||||
int iFirst;
|
||||
int iLast;
|
||||
int iSector;
|
||||
|
||||
iFirst = (iOff / pDb->szSector);
|
||||
iLast = ((iOff + nData - 1) / pDb->szSector);
|
||||
iFirst = (int)(iOff / pDb->szSector);
|
||||
iLast = (int)((iOff + nData - 1) / pDb->szSector);
|
||||
|
||||
if( pData->nSector<(iLast+1) ){
|
||||
if( pData2->nSector<(iLast+1) ){
|
||||
int nNew = ( ((iLast + 1) + 63) / 64 ) * 64;
|
||||
assert( nNew>iLast );
|
||||
pData->aSector = (FileSector *)testRealloc(
|
||||
pData->aSector, nNew*sizeof(FileSector)
|
||||
pData2->aSector = (FileSector *)testRealloc(
|
||||
pData2->aSector, nNew*sizeof(FileSector)
|
||||
);
|
||||
memset(&pData->aSector[pData->nSector],
|
||||
0, (nNew - pData->nSector) * sizeof(FileSector)
|
||||
memset(&pData2->aSector[pData2->nSector],
|
||||
0, (nNew - pData2->nSector) * sizeof(FileSector)
|
||||
);
|
||||
pData->nSector = nNew;
|
||||
pData2->nSector = nNew;
|
||||
}
|
||||
|
||||
for(iSector=iFirst; iSector<=iLast; iSector++){
|
||||
if( pData->aSector[iSector].aOld==0 ){
|
||||
if( pData2->aSector[iSector].aOld==0 ){
|
||||
u8 *aOld = (u8 *)testMalloc(pDb->szSector);
|
||||
pRealEnv->xRead(
|
||||
p->pReal, (lsm_i64)iSector*pDb->szSector, aOld, pDb->szSector
|
||||
);
|
||||
pData->aSector[iSector].aOld = aOld;
|
||||
pData2->aSector[iSector].aOld = aOld;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -547,9 +547,9 @@ static int waitOnWorker(LsmDb *pDb){
|
||||
|
||||
rc = lsm_config(pDb->db, LSM_CONFIG_AUTOFLUSH, &nLimit);
|
||||
do {
|
||||
int nOld, nNew, rc;
|
||||
rc = lsm_info(pDb->db, LSM_INFO_TREE_SIZE, &nOld, &nNew);
|
||||
if( rc!=LSM_OK ) return rc;
|
||||
int nOld, nNew, rc2;
|
||||
rc2 = lsm_info(pDb->db, LSM_INFO_TREE_SIZE, &nOld, &nNew);
|
||||
if( rc2!=LSM_OK ) return rc2;
|
||||
if( nOld==0 || nNew<(nLimit/2) ) break;
|
||||
#ifdef LSM_MUTEX_PTHREADS
|
||||
mt_signal_worker(pDb, 0);
|
||||
@ -888,7 +888,9 @@ int test_lsm_config_str(
|
||||
int tdb_lsm_config_str(TestDb *pDb, const char *zStr){
|
||||
int rc = 0;
|
||||
if( tdb_lsm(pDb) ){
|
||||
#ifdef LSM_MUTEX_PTHREADS
|
||||
int i;
|
||||
#endif
|
||||
LsmDb *pLsm = (LsmDb *)pDb;
|
||||
|
||||
rc = test_lsm_config_str(pLsm, pLsm->db, 0, zStr, 0);
|
||||
|
28
manifest
28
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\serrors\sin\scomments\sin\sthe\sSTMT\svirtual\stable.\s\sNo\scode\schanges.
|
||||
D 2017-07-10T20:39:59.430
|
||||
C Fix\sharmless\scompiler\swarnings\sin\slsmtest.
|
||||
D 2017-07-10T21:32:11.229
|
||||
F Makefile.in 081e48dfe7f995d57ce1a88ddf4d2917b4349158648a6cd45b42beae30de3a12
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc 20850e3e8d4d4791e0531955852d768eb06f24138214870d543abb1a47346fba
|
||||
@ -210,7 +210,7 @@ F ext/icu/README.txt d9fbbad0c2f647c3fdf715fc9fd64af53aedfc43
|
||||
F ext/icu/icu.c 84900472a088a3a172c6c079f58a1d3a1952c332
|
||||
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
|
||||
F ext/lsm1/Makefile a2ea4975162be8932b5efa727080f4982715d34c32035d9eb7a015ae78404981
|
||||
F ext/lsm1/Makefile.msc 8b195e7b1567990cf2590802f59bda48005c601addb4deb3e1b8ee74c0ed3813
|
||||
F ext/lsm1/Makefile.msc b9227a1d308f1e408b25557b32ce722517bc22343bd7b728b3ab3979cf2c8a1d
|
||||
F ext/lsm1/lsm-test/README 87ea529d2abe615e856d4714bfe8bb185e6c2771b8612aa6298588b7b43e6f86
|
||||
F ext/lsm1/lsm-test/lsmtest.h 5847594d4b43ec3412e1fd97104f7eb5fd770be55e691e6cb2e80929f86bebe3
|
||||
F ext/lsm1/lsm-test/lsmtest1.c 33158978327f800e82b6a47c09b86ace809f56a9ff10b0162273ec1186cc3153
|
||||
@ -218,20 +218,20 @@ F ext/lsm1/lsm-test/lsmtest2.c 188b09aec776516aeedcfd13b9c6faf85ba16b3671a0897a2
|
||||
F ext/lsm1/lsm-test/lsmtest3.c 9ab87528a36dbf4a61d7c8ad954f5ee368c0878c127b84b942b2e2abe522de26
|
||||
F ext/lsm1/lsm-test/lsmtest4.c d258d6a245db5d8eaede096e2368d23f859c5e92c80ab9122463f708514fe10c
|
||||
F ext/lsm1/lsm-test/lsmtest5.c 8d5242a0f870d65eeada191c8945781fed9cb8ece3886573790ebd373b62dac5
|
||||
F ext/lsm1/lsm-test/lsmtest6.c 48dd139ccfd25cf640720aed834a5f3f8ee7fee3cd0b09ffe241dddbf3bc23c1
|
||||
F ext/lsm1/lsm-test/lsmtest6.c 869cb4a172cd07d1a75b3aeaecd61d0a477787b3b8668bad0d3ff0f43b642b7c
|
||||
F ext/lsm1/lsm-test/lsmtest7.c 7a917455a0f956a8ed3f44f5c9387ec0ea6627714874464cc3fa5c5a9cabb2f2
|
||||
F ext/lsm1/lsm-test/lsmtest8.c b87a1279b0cfbb39df1fff50074696fbf5d83822349f65706fab6d618a7a52fa
|
||||
F ext/lsm1/lsm-test/lsmtest8.c ab8c30c08540c7cd21e32b678e6c7090ae138c00faf84fdd0ba517361b710861
|
||||
F ext/lsm1/lsm-test/lsmtest9.c dd1a0ebf41134933a744d1e00e60429a2a21fc50d587ae7dd6bdb6e96d805bdc
|
||||
F ext/lsm1/lsm-test/lsmtest_bt.c d70d9a9be5eef9360af1251dd083948d74fd30137a08f61bef995f7ac04e037f
|
||||
F ext/lsm1/lsm-test/lsmtest_datasource.c 5d770be191d0ca51315926723009b2c25c0b4b8136840494ef710ac324aa916c
|
||||
F ext/lsm1/lsm-test/lsmtest_func.c 159aa401bc8032bfa3d8cf2977bd687abebab880255895a5eb45770d626fa38d
|
||||
F ext/lsm1/lsm-test/lsmtest_io.c dacba0cce9a2315c7ec3a8f972aa2fdbbfae2f10067b6d340ab4a08b9796f010
|
||||
F ext/lsm1/lsm-test/lsmtest_main.c 6b78f4c303151cfbe938ff5bb8f29f5793ea122d741a23bc3c09ba53b5ab9f53
|
||||
F ext/lsm1/lsm-test/lsmtest_mem.c c2980abdbc5024628d10910acb703354f2606b4a6f9624679da4e9a56bcee3e9
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb.c e46c3f44880d45fd444daf2b2a53bca7a64f9df3f6480cbb1b47a039cc95626a
|
||||
F ext/lsm1/lsm-test/lsmtest_io.c cf11b27b129c6bd5818fa1d440176502dc27229f0db892b4479118d61993ea20
|
||||
F ext/lsm1/lsm-test/lsmtest_main.c a9bc647738c0dcaebf205d6d194b3ce4a6ef3925801cd2d919f0a4ea33a15aeb
|
||||
F ext/lsm1/lsm-test/lsmtest_mem.c 4e63c764345ab1df59d4f13a77980c6f3643798210b10d6cdbd785b4b888fda5
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb.c 555fb101d2fe638abdd133e9294536c857fb38e0f227e049c00a67f51eaece06
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb.h 8733eee249b12956a9df8322994b43d19bd8c02ad2e8b0bb5164db4d6ccc1735
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb2.cc 99ea7f2dd9c7536c8fb9bdd329e4cfeb76899f3ddf6f48bdd3926e016922b715
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb3.c 91b7f16b7cf7d883552bcf5301c1ce59396d7c3ec73fb7e2c5f673341dfbd0d4
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb3.c e44bf94e8bd724cd6ac161fd2cd44ffe43193932ad3a6bee1b07d80bb74012bb
|
||||
F ext/lsm1/lsm-test/lsmtest_tdb4.c 47e8bb5eba266472d690fb8264f1855ebdba0ae5a0e541e35fcda61ebf1d277f
|
||||
F ext/lsm1/lsm-test/lsmtest_util.c 241622db5a332a09c8e6e7606b617d288a37b557f7d3bce0bb97809f67cc2806
|
||||
F ext/lsm1/lsm-test/lsmtest_win32.c 5605aac3bf3852dcc2509fb1d097f5f11556418c1cc9cf0fdd09f9af53c97fb4
|
||||
@ -1628,7 +1628,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P bf7eda67c8124c3cd5d9150f2f2694cd3f991b20e0a527398885976d0d787242
|
||||
R 9fceecba0169b6f2b7addd3b0ba00915
|
||||
U drh
|
||||
Z b447d5a5b4804979281a5e6bb9f00809
|
||||
P 9a8f045d62f5c6593a5a2842e817b49fa9d00c74e329a15a326f74e583c1f767
|
||||
R 4826077b144be43a7ed321a8e8c27dc4
|
||||
U mistachkin
|
||||
Z 5556057292ec12960fe9453577b50312
|
||||
|
@ -1 +1 @@
|
||||
9a8f045d62f5c6593a5a2842e817b49fa9d00c74e329a15a326f74e583c1f767
|
||||
bd8a1fb9b33418717c786a7275f636cd4d5facd66de9a416f948b61c6490c743
|
Loading…
Reference in New Issue
Block a user