summaryrefslogtreecommitdiff
path: root/src/session
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-09-24 15:18:36 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-09-29 16:07:45 +1000
commitd1dff562e256cf3726f8ec229feced879f212096 (patch)
tree08f2e2b6215f2a73601cabe275e91bd6ebf1677a /src/session
parent6f6281c978507312def82af8fa6dd020b9fcb1a6 (diff)
downloadmongo-d1dff562e256cf3726f8ec229feced879f212096.tar.gz
WT-2122 Convert more expressions to use bool
Merge pull request #2208 from wiredtiger/more-bool (cherry picked from commit f1837bf787832c818d226df4c662093d124b01f8)
Diffstat (limited to 'src/session')
-rw-r--r--src/session/session_compact.c4
-rw-r--r--src/session/session_dhandle.c15
2 files changed, 10 insertions, 9 deletions
diff --git a/src/session/session_compact.c b/src/session/session_compact.c
index 23fe0f0449d..8f3b63ed2eb 100644
--- a/src/session/session_compact.c
+++ b/src/session/session_compact.c
@@ -103,7 +103,7 @@
* Called via the schema_worker function.
*/
int
-__wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, int *skip)
+__wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, bool *skipp)
{
/*
* Add references to schema URI objects to the list of objects to be
@@ -112,7 +112,7 @@ __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, int *skip)
*/
if (WT_PREFIX_MATCH(uri, "lsm:")) {
session->compact->lsm_count++;
- *skip = 1;
+ *skipp = true;
} else if (WT_PREFIX_MATCH(uri, "file:"))
session->compact->file_count++;
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index 8b23c3769c3..76b2ac06ebc 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -102,7 +102,8 @@ retry: TAILQ_FOREACH(dhandle_cache, &session->dhhash[bucket], hashq) {
* the schema lock.
*/
int
-__wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp)
+__wt_session_lock_dhandle(
+ WT_SESSION_IMPL *session, uint32_t flags, bool *is_deadp)
{
enum { NOLOCK, READLOCK, WRITELOCK } locked;
WT_BTREE *btree;
@@ -112,15 +113,15 @@ __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp)
btree = S2BT(session);
dhandle = session->dhandle;
locked = NOLOCK;
- if (deadp != NULL)
- *deadp = 0;
+ if (is_deadp != NULL)
+ *is_deadp = false;
/*
* Special operation flags will cause the handle to be reopened.
* For example, a handle opened with WT_BTREE_BULK cannot use the same
* internal data structures as a handle opened for ordinary access.
*/
- special_flags = LF_ISSET(WT_BTREE_SPECIAL_FLAGS);
+ special_flags = LF_MASK(WT_BTREE_SPECIAL_FLAGS);
WT_ASSERT(session,
special_flags == 0 || LF_ISSET(WT_DHANDLE_EXCLUSIVE));
@@ -153,8 +154,8 @@ __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp)
* that no special flags are required.
*/
if (F_ISSET(dhandle, WT_DHANDLE_DEAD)) {
- WT_ASSERT(session, deadp != NULL);
- *deadp = 1;
+ WT_ASSERT(session, is_deadp != NULL);
+ *is_deadp = 1;
} else if (LF_ISSET(WT_DHANDLE_LOCK_ONLY) ||
(F_ISSET(dhandle, WT_DHANDLE_OPEN) && special_flags == 0))
return (0);
@@ -377,7 +378,7 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
WT_DATA_HANDLE *dhandle;
WT_DATA_HANDLE_CACHE *dhandle_cache;
WT_DECL_RET;
- int is_dead;
+ bool is_dead;
WT_ASSERT(session, !F_ISSET(session, WT_SESSION_NO_DATA_HANDLES));
WT_ASSERT(session, !LF_ISSET(WT_DHANDLE_HAVE_REF));