aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
diff options
context:
space:
mode:
authorshaneh <shaneh@noemail.net>2010-08-18 02:28:48 +0000
committershaneh <shaneh@noemail.net>2010-08-18 02:28:48 +0000
commit1df2db7fd1a3bd465e14efa819faa28259a3162e (patch)
tree627f982c5f61b43da872d3d04f5c96ff84873577 /src/btree.c
parent89bd82ae9d80abddb27df1ede84fe5ed2245ac59 (diff)
downloadsqlite-1df2db7fd1a3bd465e14efa819faa28259a3162e.tar.gz
sqlite-1df2db7fd1a3bd465e14efa819faa28259a3162e.zip
Fix some compiler warnings in the MSVC build.
FossilOrigin-Name: 1f5662b7db5d623c8d99c45a8d97a0aa4427593f
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/btree.c b/src/btree.c
index b9987a27b..e64aaa149 100644
--- a/src/btree.c
+++ b/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);