mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix some compiler warnings in the MSVC build.
FossilOrigin-Name: 1f5662b7db5d623c8d99c45a8d97a0aa4427593f
This commit is contained in:
20
src/btree.c
20
src/btree.c
@@ -1382,7 +1382,7 @@ static int btreeInitPage(MemPage *pPage){
|
||||
u8 *data; /* Equal to pPage->aData */
|
||||
BtShared *pBt; /* The main btree structure */
|
||||
int usableSize; /* Amount of usable space on each page */
|
||||
int cellOffset; /* Offset from start of page to first cell pointer */
|
||||
u16 cellOffset; /* Offset from start of page to first cell pointer */
|
||||
int nFree; /* Number of unused bytes on the page */
|
||||
int top; /* First byte of the cell content area */
|
||||
int iCellFirst; /* First allowable cell or freeblock offset */
|
||||
@@ -1497,7 +1497,7 @@ static void zeroPage(MemPage *pPage, int flags){
|
||||
memset(&data[hdr+1], 0, 4);
|
||||
data[hdr+7] = 0;
|
||||
put2byte(&data[hdr+5], pBt->usableSize);
|
||||
pPage->nFree = pBt->usableSize - first;
|
||||
pPage->nFree = (u16)(pBt->usableSize - first);
|
||||
decodeFlags(pPage, flags);
|
||||
pPage->hdrOffset = hdr;
|
||||
pPage->cellOffset = first;
|
||||
@@ -2326,7 +2326,7 @@ static int lockBtree(BtShared *pBt){
|
||||
}
|
||||
assert( (pageSize & 7)==0 );
|
||||
usableSize = pageSize - page1[20];
|
||||
if( pageSize!=pBt->pageSize ){
|
||||
if( (u32)pageSize!=pBt->pageSize ){
|
||||
/* After reading the first page of the database assuming a page size
|
||||
** of BtShared.pageSize, we have discovered that the page-size is
|
||||
** actually pageSize. Unlock the database, leave pBt->pPage1 at
|
||||
@@ -2369,10 +2369,10 @@ static int lockBtree(BtShared *pBt){
|
||||
** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow
|
||||
** page pointer.
|
||||
*/
|
||||
pBt->maxLocal = (pBt->usableSize-12)*64/255 - 23;
|
||||
pBt->minLocal = (pBt->usableSize-12)*32/255 - 23;
|
||||
pBt->maxLeaf = pBt->usableSize - 35;
|
||||
pBt->minLeaf = (pBt->usableSize-12)*32/255 - 23;
|
||||
pBt->maxLocal = (u16)((pBt->usableSize-12)*64/255 - 23);
|
||||
pBt->minLocal = (u16)((pBt->usableSize-12)*32/255 - 23);
|
||||
pBt->maxLeaf = (u16)(pBt->usableSize - 35);
|
||||
pBt->minLeaf = (u16)((pBt->usableSize-12)*32/255 - 23);
|
||||
assert( pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt) );
|
||||
pBt->pPage1 = pPage1;
|
||||
pBt->nPage = nPage;
|
||||
@@ -2425,8 +2425,8 @@ static int newDatabase(BtShared *pBt){
|
||||
if( rc ) return rc;
|
||||
memcpy(data, zMagicHeader, sizeof(zMagicHeader));
|
||||
assert( sizeof(zMagicHeader)==16 );
|
||||
data[16] = (pBt->pageSize>>8)&0xff;
|
||||
data[17] = (pBt->pageSize>>16)&0xff;
|
||||
data[16] = (u8)((pBt->pageSize>>8)&0xff);
|
||||
data[17] = (u8)((pBt->pageSize>>16)&0xff);
|
||||
data[18] = 1;
|
||||
data[19] = 1;
|
||||
assert( pBt->usableSize<=pBt->pageSize && pBt->usableSize+255>=pBt->pageSize);
|
||||
@@ -5108,7 +5108,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){
|
||||
Pgno ovflPgno;
|
||||
int rc;
|
||||
int nOvfl;
|
||||
u16 ovflPageSize;
|
||||
u32 ovflPageSize;
|
||||
|
||||
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
|
||||
btreeParseCellPtr(pPage, pCell, &info);
|
||||
|
Reference in New Issue
Block a user