summaryrefslogtreecommitdiff
path: root/src/include/mutex.h
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-11-30 13:11:20 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-11-30 13:11:20 +1100
commit3c3ed81ae0affa2cf55c08f80ee4fbe829621428 (patch)
tree8532e1e2879967369e28287e02b359c46bed83bd /src/include/mutex.h
parent467f354bd61b188c6e8aaee19a710a98b659796b (diff)
downloadmongo-3c3ed81ae0affa2cf55c08f80ee4fbe829621428.tar.gz
Fix warnings from "gcc -Wsign-conversion". Mostly this involved changing loop counters to unsigned, but there were also some cases where arithmetic mixed signed and unsigned expressions.
Diffstat (limited to 'src/include/mutex.h')
-rw-r--r--src/include/mutex.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/mutex.h b/src/include/mutex.h
index d46090ab35d..9f05d14680a 100644
--- a/src/include/mutex.h
+++ b/src/include/mutex.h
@@ -133,20 +133,22 @@
* Atomic versions of F_ISSET, F_SET and F_CLR.
* Spin until the new value can be swapped into place.
*/
-#define F_ISSET_ATOMIC(p, mask) ((p)->flags_atomic & (mask))
+#define F_ISSET_ATOMIC(p, mask) ((p)->flags_atomic & (uint32_t)(mask))
#define F_SET_ATOMIC(p, mask) do { \
uint32_t __orig; \
do { \
__orig = (p)->flags_atomic; \
- } while (!WT_ATOMIC_CAS((p)->flags_atomic, __orig, __orig | (mask)));\
+ } while (!WT_ATOMIC_CAS((p)->flags_atomic, \
+ __orig, __orig | (uint32_t)(mask))); \
} while (0)
#define F_CLR_ATOMIC(p, mask) do { \
uint32_t __orig; \
do { \
__orig = (p)->flags_atomic; \
- } while (!WT_ATOMIC_CAS((p)->flags_atomic, __orig, __orig & ~(mask)));\
+ } while (!WT_ATOMIC_CAS((p)->flags_atomic, \
+ __orig, __orig & ~(uint32_t)(mask))); \
} while (0)
/*