From 1ce266043cdc8a920bbfd20c9eea8df68caaaa74 Mon Sep 17 00:00:00 2001 From: Alex Gorrod Date: Mon, 27 Aug 2012 12:14:30 +1000 Subject: [PATCH] Update btree usage of 64 bitstring implementation, so it's cleaner. --- src/btree/bt_vrfy_dsk.c | 6 +++--- src/btree/rec_write.c | 4 ++-- src/include/bitstring.i | 11 ++--------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/btree/bt_vrfy_dsk.c b/src/btree/bt_vrfy_dsk.c index 023920bc12f..28439b002d4 100644 --- a/src/btree/bt_vrfy_dsk.c +++ b/src/btree/bt_vrfy_dsk.c @@ -12,7 +12,7 @@ static int __err_cell_type( WT_SESSION_IMPL *, uint32_t, const char *, uint8_t, uint8_t); static int __err_eof(WT_SESSION_IMPL *, uint32_t, const char *); static int __verify_dsk_chunk( - WT_SESSION_IMPL *, const char *, WT_PAGE_HEADER *, uint64_t); + WT_SESSION_IMPL *, const char *, WT_PAGE_HEADER *, uint32_t); static int __verify_dsk_col_fix( WT_SESSION_IMPL *, const char *, WT_PAGE_HEADER *); static int __verify_dsk_col_int( @@ -407,7 +407,7 @@ __verify_dsk_col_fix( WT_SESSION_IMPL *session, const char *addr, WT_PAGE_HEADER *dsk) { WT_BTREE *btree; - uint64_t datalen; + uint32_t datalen; btree = session->btree; @@ -506,7 +506,7 @@ match_err: WT_RET_VRFY(session, */ static int __verify_dsk_chunk(WT_SESSION_IMPL *session, - const char *addr, WT_PAGE_HEADER *dsk, uint64_t datalen) + const char *addr, WT_PAGE_HEADER *dsk, uint32_t datalen) { WT_BTREE *btree; uint8_t *p, *end; diff --git a/src/btree/rec_write.c b/src/btree/rec_write.c index 2f5a38e4ca0..c10b7857f2e 100644 --- a/src/btree/rec_write.c +++ b/src/btree/rec_write.c @@ -458,7 +458,7 @@ __wt_rec_destroy(WT_SESSION_IMPL *session) * Update the memory tracking structure for a set of new entries. */ static inline void -__rec_incr(WT_SESSION_IMPL *session, WT_RECONCILE *r, uint32_t v, uint64_t size) +__rec_incr(WT_SESSION_IMPL *session, WT_RECONCILE *r, uint32_t v, uint32_t size) { /* * The buffer code is fragile and prone to off-by-one errors -- check @@ -469,7 +469,7 @@ __rec_incr(WT_SESSION_IMPL *session, WT_RECONCILE *r, uint32_t v, uint64_t size) WT_BLOCK_FITS(r->first_free, size, r->dsk.mem, r->page_size)); r->entries += v; - r->space_avail -= (uint32_t)size; + r->space_avail -= size; r->first_free += size; } diff --git a/src/include/bitstring.i b/src/include/bitstring.i index 2c7e647a533..82522e80f3d 100644 --- a/src/include/bitstring.i +++ b/src/include/bitstring.i @@ -65,15 +65,8 @@ /* mask for the bit within its byte */ #define __bit_mask(bit) (1 << ((bit) & 0x7)) -/* - * __bitstr_size -- - * Return the bytes in a bitstring of nbits. - */ -static inline uint64_t -__bitstr_size(uint64_t nbits) -{ - return (((nbits) + 7) >> 3); -} + /* Bytes in a bitstring of nbits */ +#define __bitstr_size(nbits) (((nbits) + 7) >> 3) /* * __bit_alloc --