mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix harmless compiler warnings seen with MSVC for lsm1.
FossilOrigin-Name: cf6da4a52f7f9047e653ef2972e4c0910b29d7182d789a9e30225dc1849e8779
This commit is contained in:
@ -540,7 +540,7 @@ static int fsMmapPage(FileSystem *pFS, Pgno iReal){
|
||||
** Given that there are currently nHash slots in the hash table, return
|
||||
** the hash key for file iFile, page iPg.
|
||||
*/
|
||||
static int fsHashKey(int nHash, int iPg){
|
||||
static int fsHashKey(int nHash, Pgno iPg){
|
||||
return (iPg % nHash);
|
||||
}
|
||||
|
||||
@ -922,9 +922,9 @@ static Pgno fsLastPageOnBlock(FileSystem *pFS, int iBlock){
|
||||
*/
|
||||
static int fsPageToBlock(FileSystem *pFS, Pgno iPg){
|
||||
if( pFS->pCompress ){
|
||||
return (iPg / pFS->nBlocksize) + 1;
|
||||
return (int)((iPg / pFS->nBlocksize) + 1);
|
||||
}else{
|
||||
return 1 + ((iPg-1) / (pFS->nBlocksize / pFS->nPagesize));
|
||||
return (int)(1 + ((iPg-1) / (pFS->nBlocksize / pFS->nPagesize)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1286,7 +1286,7 @@ static int fsReadData(
|
||||
assert( pFS->pCompress );
|
||||
|
||||
iEob = fsLastPageOnPagesBlock(pFS, iOff) + 1;
|
||||
nRead = LSM_MIN(iEob - iOff, nData);
|
||||
nRead = (int)LSM_MIN(iEob - iOff, nData);
|
||||
|
||||
rc = lsmEnvRead(pFS->pEnv, pFS->fdDb, iOff, aData, nRead);
|
||||
if( rc==LSM_OK && nRead!=nData ){
|
||||
@ -1722,8 +1722,8 @@ static int fsFreeBlock(
|
||||
int iBlk /* Block number of block to free */
|
||||
){
|
||||
int rc = LSM_OK; /* Return code */
|
||||
int iFirst; /* First page on block iBlk */
|
||||
int iLast; /* Last page on block iBlk */
|
||||
Pgno iFirst; /* First page on block iBlk */
|
||||
Pgno iLast; /* Last page on block iBlk */
|
||||
Level *pLevel; /* Used to iterate through levels */
|
||||
|
||||
int iIn; /* Used to iterate through append points */
|
||||
@ -1856,7 +1856,7 @@ void lsmFsGobble(
|
||||
assert( nPgno>0 && 0==fsPageRedirects(pFS, pRun, aPgno[0]) );
|
||||
|
||||
iBlk = fsPageToBlock(pFS, pRun->iFirst);
|
||||
pRun->nSize += (pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk));
|
||||
pRun->nSize += (int)(pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk));
|
||||
|
||||
while( rc==LSM_OK ){
|
||||
int iNext = 0;
|
||||
@ -1867,13 +1867,13 @@ void lsmFsGobble(
|
||||
}
|
||||
rc = fsBlockNext(pFS, pRun, iBlk, &iNext);
|
||||
if( rc==LSM_OK ) rc = fsFreeBlock(pFS, pSnapshot, pRun, iBlk);
|
||||
pRun->nSize -= (
|
||||
pRun->nSize -= (int)(
|
||||
1 + fsLastPageOnBlock(pFS, iBlk) - fsFirstPageOnBlock(pFS, iBlk)
|
||||
);
|
||||
iBlk = iNext;
|
||||
}
|
||||
|
||||
pRun->nSize -= (pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk));
|
||||
pRun->nSize -= (int)(pRun->iFirst - fsFirstPageOnBlock(pFS, iBlk));
|
||||
assert( pRun->nSize>0 );
|
||||
}
|
||||
|
||||
@ -2087,10 +2087,10 @@ int lsmFsSortedAppend(
|
||||
){
|
||||
int rc = LSM_OK;
|
||||
Page *pPg = 0;
|
||||
int iApp = 0;
|
||||
int iNext = 0;
|
||||
Pgno iApp = 0;
|
||||
Pgno iNext = 0;
|
||||
Segment *p = &pLvl->lhs;
|
||||
int iPrev = p->iLastPg;
|
||||
Pgno iPrev = p->iLastPg;
|
||||
|
||||
*ppOut = 0;
|
||||
assert( p->pRedirect==0 );
|
||||
@ -2457,8 +2457,8 @@ static Pgno fsAppendData(
|
||||
int rc = *pRc;
|
||||
assert( pFS->pCompress );
|
||||
if( rc==LSM_OK ){
|
||||
int nRem;
|
||||
int nWrite;
|
||||
int nRem = 0;
|
||||
int nWrite = 0;
|
||||
Pgno iLastOnBlock;
|
||||
Pgno iApp = pSeg->iLastPg+1;
|
||||
|
||||
@ -2477,7 +2477,7 @@ static Pgno fsAppendData(
|
||||
/* Write as much data as is possible at iApp (usually all of it). */
|
||||
iLastOnBlock = fsLastPageOnPagesBlock(pFS, iApp);
|
||||
if( rc==LSM_OK ){
|
||||
int nSpace = iLastOnBlock - iApp + 1;
|
||||
int nSpace = (int)(iLastOnBlock - iApp + 1);
|
||||
nWrite = LSM_MIN(nData, nSpace);
|
||||
nRem = nData - nWrite;
|
||||
assert( nWrite>=0 );
|
||||
@ -2800,7 +2800,7 @@ int lsmFsSortedPadding(
|
||||
|
||||
iLast2 = (1 + iLast/pFS->szSector) * pFS->szSector - 1;
|
||||
assert( fsPageToBlock(pFS, iLast)==fsPageToBlock(pFS, iLast2) );
|
||||
nPad = iLast2 - iLast;
|
||||
nPad = (int)(iLast2 - iLast);
|
||||
|
||||
if( iLast2>fsLastPageOnPagesBlock(pFS, iLast) ){
|
||||
nPad -= 4;
|
||||
|
Reference in New Issue
Block a user