summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/block.h8
-rw-r--r--src/include/btree.i3
-rw-r--r--src/include/cell.i11
-rw-r--r--src/include/extern.h28
-rw-r--r--src/include/misc.h26
5 files changed, 41 insertions, 35 deletions
diff --git a/src/include/block.h b/src/include/block.h
index 6e0de069b3f..0914e5323fc 100644
--- a/src/include/block.h
+++ b/src/include/block.h
@@ -168,8 +168,8 @@ struct __wt_bm {
int (*close)(WT_BM *, WT_SESSION_IMPL *);
int (*compact_end)(WT_BM *, WT_SESSION_IMPL *);
int (*compact_page_skip)
- (WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t, int *);
- int (*compact_skip)(WT_BM *, WT_SESSION_IMPL *, int *);
+ (WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t, bool *);
+ int (*compact_skip)(WT_BM *, WT_SESSION_IMPL *, bool *);
int (*compact_start)(WT_BM *, WT_SESSION_IMPL *);
int (*free)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
int (*preload)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
@@ -246,8 +246,8 @@ struct __wt_block {
wt_off_t slvg_off; /* Salvage file offset */
/* Verification support */
- int verify; /* If performing verification */
- int verify_strict; /* Fail hard on any error */
+ bool verify; /* If performing verification */
+ bool verify_strict; /* Fail hard on any error */
wt_off_t verify_size; /* Checkpoint's file size */
WT_EXTLIST verify_alloc; /* Verification allocation list */
uint64_t frags; /* Maximum frags in the file */
diff --git a/src/include/btree.i b/src/include/btree.i
index 07f11b0c06c..1cf0c9a8aff 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -1079,7 +1079,8 @@ __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref)
WT_BTREE *btree;
WT_DECL_RET;
WT_PAGE *page;
- int locked, too_big;
+ int locked;
+ bool too_big;
btree = S2BT(session);
page = ref->page;
diff --git a/src/include/cell.i b/src/include/cell.i
index 880e4e2402f..763a8229d85 100644
--- a/src/include/cell.i
+++ b/src/include/cell.i
@@ -230,11 +230,12 @@ __wt_cell_pack_data(WT_CELL *cell, uint64_t rle, size_t size)
*/
static inline int
__wt_cell_pack_data_match(
- WT_CELL *page_cell, WT_CELL *val_cell, const uint8_t *val_data, int *matchp)
+ WT_CELL *page_cell, WT_CELL *val_cell, const uint8_t *val_data,
+ bool *matchp)
{
const uint8_t *a, *b;
uint64_t av, bv;
- int rle;
+ bool rle;
*matchp = 0; /* Default to no-match */
@@ -252,7 +253,7 @@ __wt_cell_pack_data_match(
av = a[0] >> WT_CELL_SHORT_SHIFT;
++a;
} else if (WT_CELL_TYPE(a[0]) == WT_CELL_VALUE) {
- rle = a[0] & WT_CELL_64V ? 1 : 0; /* Skip any RLE */
+ rle = (a[0] & WT_CELL_64V) != 0; /* Skip any RLE */
++a;
if (rle)
WT_RET(__wt_vunpack_uint(&a, 0, &av));
@@ -264,7 +265,7 @@ __wt_cell_pack_data_match(
bv = b[0] >> WT_CELL_SHORT_SHIFT;
++b;
} else if (WT_CELL_TYPE(b[0]) == WT_CELL_VALUE) {
- rle = b[0] & WT_CELL_64V ? 1 : 0; /* Skip any RLE */
+ rle = (b[0] & WT_CELL_64V) != 0; /* Skip any RLE */
++b;
if (rle)
WT_RET(__wt_vunpack_uint(&b, 0, &bv));
@@ -273,7 +274,7 @@ __wt_cell_pack_data_match(
return (0);
if (av == bv)
- *matchp = memcmp(a, val_data, av) == 0 ? 1 : 0;
+ *matchp = memcmp(a, val_data, av) == 0;
return (0);
}
diff --git a/src/include/extern.h b/src/include/extern.h
index 80028817a5c..adaeed31bba 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -23,8 +23,8 @@ extern int __wt_block_checkpoint(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_I
extern int __wt_block_checkpoint_resolve(WT_SESSION_IMPL *session, WT_BLOCK *block);
extern int __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block);
extern int __wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block);
-extern int __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, int *skipp);
-extern int __wt_block_compact_page_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, int *skipp);
+extern int __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp);
+extern int __wt_block_compact_page_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool *skipp);
extern int __wt_block_misplaced(WT_SESSION_IMPL *session, WT_BLOCK *block, const char *tag, wt_off_t offset, uint32_t size, bool live);
extern int __wt_block_off_remove_overlap(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el, wt_off_t off, wt_off_t size);
extern int __wt_block_alloc( WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t *offp, wt_off_t size);
@@ -86,7 +86,7 @@ extern int __wt_bloom_get(WT_BLOOM *bloom, WT_ITEM *key);
extern int __wt_bloom_close(WT_BLOOM *bloom);
extern int __wt_bloom_drop(WT_BLOOM *bloom, const char *config);
extern int __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]);
-extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, int *skipp);
+extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp);
extern void __wt_btcur_iterate_setup(WT_CURSOR_BTREE *cbt);
extern int __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating);
extern int __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating);
@@ -112,7 +112,7 @@ extern int __wt_debug_tree_shape( WT_SESSION_IMPL *session, WT_PAGE *page, const
extern int __wt_debug_tree_all(WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile);
extern int __wt_debug_tree(WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile);
extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile);
-extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, int *skipp);
+extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp);
extern void __wt_delete_page_rollback(WT_SESSION_IMPL *session, WT_REF *ref);
extern bool __wt_delete_page_skip(WT_SESSION_IMPL *session, WT_REF *ref);
extern int __wt_delete_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref);
@@ -154,7 +154,7 @@ extern void __wt_split_stash_discard_all( WT_SESSION_IMPL *session_safe, WT_SESS
extern int __wt_multi_to_ref(WT_SESSION_IMPL *session, WT_PAGE *page, WT_MULTI *multi, WT_REF **refp, size_t *incrp);
extern int __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref, int *splitp);
extern int __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref);
-extern int __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive);
+extern int __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, bool closing);
extern int __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst);
extern int __wt_cache_op(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, int op);
extern int __wt_upgrade(WT_SESSION_IMPL *session, const char *cfg[]);
@@ -253,8 +253,8 @@ extern int __wt_sweep_create(WT_SESSION_IMPL *session);
extern int __wt_sweep_destroy(WT_SESSION_IMPL *session);
extern int __wt_curbackup_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_backup_file_remove(WT_SESSION_IMPL *session);
-extern int __wt_backup_list_uri_append( WT_SESSION_IMPL *session, const char *name, int *skip);
-extern int __wt_curbulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, int bitmap, int skip_sort_check);
+extern int __wt_backup_list_uri_append( WT_SESSION_IMPL *session, const char *name, bool *skip);
+extern int __wt_curbulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, int bitmap, bool skip_sort_check);
extern int __wt_curconfig_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_curds_open( WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_DATA_SOURCE *dsrc, WT_CURSOR **cursorp);
extern int __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp);
@@ -318,7 +318,7 @@ extern int __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing);
extern void __wt_evict_page_clean_update(WT_SESSION_IMPL *session, WT_REF *ref);
extern int __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn);
extern int __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn);
-extern int __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, int *rec);
+extern int __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, bool *recp);
extern void __wt_log_written_reset(WT_SESSION_IMPL *session);
extern int __wt_log_get_all_files(WT_SESSION_IMPL *session, char ***filesp, u_int *countp, uint32_t *maxid, int active_only);
extern void __wt_log_files_free(WT_SESSION_IMPL *session, char **files, u_int count);
@@ -402,8 +402,8 @@ extern int __wt_lsm_tree_readlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tre
extern int __wt_lsm_tree_readunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree);
extern int __wt_lsm_tree_writelock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree);
extern int __wt_lsm_tree_writeunlock(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree);
-extern int __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, int *skip);
-extern int __wt_lsm_tree_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, int *), const char *cfg[], uint32_t open_flags);
+extern int __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp);
+extern int __wt_lsm_tree_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags);
extern int __wt_lsm_get_chunk_to_flush(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, int force, WT_LSM_CHUNK **chunkp);
extern int __wt_lsm_work_switch( WT_SESSION_IMPL *session, WT_LSM_WORK_UNIT **entryp, int *ran);
extern int __wt_lsm_work_bloom(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree);
@@ -562,7 +562,7 @@ extern int __wt_struct_reformat(WT_SESSION_IMPL *session, WT_TABLE *table, const
extern int __wt_struct_truncate(WT_SESSION_IMPL *session, const char *input_fmt, u_int ncols, WT_ITEM *format);
extern int __wt_schema_project_in(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap);
extern int __wt_schema_project_out(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, va_list ap);
-extern int __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, int key_only, const char *vformat, WT_ITEM *value);
+extern int __wt_schema_project_slice(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, bool key_only, const char *vformat, WT_ITEM *value);
extern int __wt_schema_project_merge(WT_SESSION_IMPL *session, WT_CURSOR **cp, const char *proj_arg, const char *vformat, WT_ITEM *value);
extern int __wt_schema_rename(WT_SESSION_IMPL *session, const char *uri, const char *newuri, const char *cfg[]);
extern int __wt_curstat_colgroup_init(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], WT_CURSOR_STAT *cst);
@@ -574,16 +574,16 @@ extern int __wt_schema_range_truncate( WT_SESSION_IMPL *session, WT_CURSOR *star
extern WT_DATA_SOURCE *__wt_schema_get_source(WT_SESSION_IMPL *session, const char *name);
extern int __wt_str_name_check(WT_SESSION_IMPL *session, const char *str);
extern int __wt_name_check(WT_SESSION_IMPL *session, const char *str, size_t len);
-extern int __wt_schema_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, int *), const char *cfg[], uint32_t open_flags);
+extern int __wt_schema_worker(WT_SESSION_IMPL *session, const char *uri, int (*file_func)(WT_SESSION_IMPL *, const char *[]), int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[], uint32_t open_flags);
extern int __wt_session_reset_cursors(WT_SESSION_IMPL *session);
extern int __wt_session_copy_values(WT_SESSION_IMPL *session);
extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_session_create_strip(WT_SESSION *wt_session, const char *v1, const char *v2, char **value_ret);
extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, int uses_dhandles, int open_metadata, WT_SESSION_IMPL **sessionp);
extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, WT_SESSION_IMPL **sessionp);
-extern int __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, int *skip);
+extern int __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, bool *skipp);
extern int __wt_session_compact( WT_SESSION *wt_session, const char *uri, const char *config);
-extern int __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp);
+extern int __wt_session_lock_dhandle( WT_SESSION_IMPL *session, uint32_t flags, bool *is_deadp);
extern int __wt_session_release_btree(WT_SESSION_IMPL *session);
extern int __wt_session_get_btree_ckpt(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], uint32_t flags);
extern void __wt_session_close_cache(WT_SESSION_IMPL *session);
diff --git a/src/include/misc.h b/src/include/misc.h
index ba12f00f672..e2b46d0dbdc 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -114,17 +114,21 @@
* hex constant might be a negative integer), and to ensure the hex constant is
* the correct size before applying the bitwise not operator.
*/
-#define F_CLR(p, mask) ((p)->flags &= ~((uint32_t)(mask)))
-#define F_ISSET(p, mask) ((p)->flags & ((uint32_t)(mask)))
-#define F_SET(p, mask) ((p)->flags |= ((uint32_t)(mask)))
-
-#define LF_CLR(mask) ((flags) &= ~((uint32_t)(mask)))
-#define LF_ISSET(mask) ((flags) & ((uint32_t)(mask)))
-#define LF_SET(mask) ((flags) |= ((uint32_t)(mask)))
-
-#define FLD_CLR(field, mask) ((field) &= ~((uint32_t)(mask)))
-#define FLD_ISSET(field, mask) ((field) & ((uint32_t)(mask)))
-#define FLD_SET(field, mask) ((field) |= ((uint32_t)(mask)))
+#define FLD_CLR(field, mask) ((field) &= ~((uint32_t)(mask)))
+#define FLD_MASK(field, mask) ((field) & (uint32_t)(mask))
+#define FLD_ISSET(field, mask) (FLD_MASK(field, mask) != 0)
+#define FLD64_ISSET(field, mask) (((field) & (uint64_t)(mask)) != 0)
+#define FLD_SET(field, mask) ((field) |= ((uint32_t)(mask)))
+
+#define F_CLR(p, mask) FLD_CLR((p)->flags, mask)
+#define F_ISSET(p, mask) FLD_ISSET((p)->flags, mask)
+#define F_MASK(p, mask) FLD_MASK((p)->flags, mask)
+#define F_SET(p, mask) FLD_SET((p)->flags, mask)
+
+#define LF_CLR(mask) FLD_CLR(flags, mask)
+#define LF_ISSET(mask) FLD_ISSET(flags, mask)
+#define LF_MASK(mask) FLD_MASK(flags, mask)
+#define LF_SET(mask) FLD_SET(flags, mask)
/* Verbose messages. */
#ifdef HAVE_VERBOSE