diff options
Diffstat (limited to 'src/os_win')
-rw-r--r-- | src/os_win/os_dir.c | 6 | ||||
-rw-r--r-- | src/os_win/os_dlopen.c | 2 | ||||
-rw-r--r-- | src/os_win/os_flock.c | 2 | ||||
-rw-r--r-- | src/os_win/os_mtx_cond.c | 14 | ||||
-rw-r--r-- | src/os_win/os_open.c | 15 | ||||
-rw-r--r-- | src/os_win/os_priv.c | 2 |
6 files changed, 21 insertions, 20 deletions
diff --git a/src/os_win/os_dir.c b/src/os_win/os_dir.c index 33489bc2497..aff916c25f5 100644 --- a/src/os_win/os_dir.c +++ b/src/os_win/os_dir.c @@ -23,7 +23,7 @@ __wt_dirlist(WT_SESSION_IMPL *session, const char *dir, const char *prefix, WT_DECL_RET; size_t dirallocsz, pathlen; u_int count, dirsz; - int match; + bool match; char **entries, *path; *dirlist = NULL; @@ -66,13 +66,13 @@ __wt_dirlist(WT_SESSION_IMPL *session, const char *dir, const char *prefix, if (strcmp(finddata.cFileName, ".") == 0 || strcmp(finddata.cFileName, "..") == 0) continue; - match = 0; + match = false; if (prefix != NULL && ((LF_ISSET(WT_DIRLIST_INCLUDE) && WT_PREFIX_MATCH(finddata.cFileName, prefix)) || (LF_ISSET(WT_DIRLIST_EXCLUDE) && !WT_PREFIX_MATCH(finddata.cFileName, prefix)))) - match = 1; + match = true; if (prefix == NULL || match) { /* * We have a file name we want to return. diff --git a/src/os_win/os_dlopen.c b/src/os_win/os_dlopen.c index 0337c7cc368..3b200811aca 100644 --- a/src/os_win/os_dlopen.c +++ b/src/os_win/os_dlopen.c @@ -49,7 +49,7 @@ err: __wt_free(session, dlh->name); */ int __wt_dlsym(WT_SESSION_IMPL *session, - WT_DLH *dlh, const char *name, int fail, void *sym_ret) + WT_DLH *dlh, const char *name, bool fail, void *sym_ret) { void *sym; diff --git a/src/os_win/os_flock.c b/src/os_win/os_flock.c index d551480ba4d..947d7bdcde7 100644 --- a/src/os_win/os_flock.c +++ b/src/os_win/os_flock.c @@ -13,7 +13,7 @@ * Lock/unlock a byte in a file. */ int -__wt_bytelock(WT_FH *fhp, wt_off_t byte, int lock) +__wt_bytelock(WT_FH *fhp, wt_off_t byte, bool lock) { WT_DECL_RET; diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c index 565928cb863..90aba6b6fad 100644 --- a/src/os_win/os_mtx_cond.c +++ b/src/os_win/os_mtx_cond.c @@ -14,7 +14,7 @@ */ int __wt_cond_alloc(WT_SESSION_IMPL *session, - const char *name, int is_signalled, WT_CONDVAR **condp) + const char *name, bool is_signalled, WT_CONDVAR **condp) { WT_CONDVAR *cond; @@ -46,9 +46,9 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) DWORD milliseconds; WT_DECL_RET; uint64_t milliseconds64; - int locked; + bool locked; - locked = 0; + locked = false; /* Fast path if already signalled. */ if (__wt_atomic_addi32(&cond->waiters, 1) == 0) @@ -65,7 +65,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) } EnterCriticalSection(&cond->mtx); - locked = 1; + locked = true; if (usecs > 0) { milliseconds64 = usecs / 1000; @@ -114,9 +114,9 @@ int __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) { WT_DECL_RET; - int locked; + bool locked; - locked = 0; + locked = false; /* * !!! @@ -132,7 +132,7 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) if (cond->waiters > 0 || !__wt_atomic_casi32(&cond->waiters, 0, -1)) { EnterCriticalSection(&cond->mtx); - locked = 1; + locked = true; WakeAllConditionVariable(&cond->cond); } diff --git a/src/os_win/os_open.c b/src/os_win/os_open.c index 9bdae92774b..c7b30408e63 100644 --- a/src/os_win/os_open.c +++ b/src/os_win/os_open.c @@ -22,7 +22,8 @@ __wt_open(WT_SESSION_IMPL *session, WT_DECL_RET; WT_FH *fh, *tfh; uint64_t bucket, hash; - int direct_io, f, matched, share_mode; + int f, share_mode; + bool direct_io, matched; char *path; conn = S2C(session); @@ -30,20 +31,20 @@ __wt_open(WT_SESSION_IMPL *session, path = NULL; filehandle = INVALID_HANDLE_VALUE; filehandle_secondary = INVALID_HANDLE_VALUE; - direct_io = 0; + direct_io = false; hash = __wt_hash_city64(name, strlen(name)); bucket = hash % WT_HASH_ARRAY_SIZE; WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: open", name)); /* Increment the reference count if we already have the file open. */ - matched = 0; + matched = false; __wt_spin_lock(session, &conn->fh_lock); TAILQ_FOREACH(tfh, &conn->fhhash[bucket], hashq) if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; - matched = 1; + matched = true; break; } __wt_spin_unlock(session, &conn->fh_lock); @@ -79,7 +80,7 @@ __wt_open(WT_SESSION_IMPL *session, if (dio_type && FLD_ISSET(conn->direct_io, dio_type)) { f |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH; - direct_io = 1; + direct_io = true; } if (dio_type == WT_FILE_TYPE_LOG && @@ -158,13 +159,13 @@ setupfh: * Repeat the check for a match, but then link onto the database's list * of files. */ - matched = 0; + matched = false; __wt_spin_lock(session, &conn->fh_lock); TAILQ_FOREACH(tfh, &conn->fhhash[bucket], hashq) if (strcmp(name, tfh->name) == 0) { ++tfh->ref; *fhp = tfh; - matched = 1; + matched = true; break; } if (!matched) { diff --git a/src/os_win/os_priv.c b/src/os_win/os_priv.c index b5dc1eb55fe..5c32d6b5999 100644 --- a/src/os_win/os_priv.c +++ b/src/os_win/os_priv.c @@ -13,7 +13,7 @@ * Return if the process has special privileges, defined as having * different effective and read UIDs or GIDs. */ -int +bool __wt_has_priv(void) { return (0); |