qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 3/3] bitops: use bool


From: blauwirbel
Subject: [Qemu-devel] [PATCH v2 3/3] bitops: use bool
Date: Sun, 8 Jul 2012 19:22:33 +0000

From: Blue Swirl <address@hidden>

Use 'bool' type for return value of bit test functions.

Signed-off-by: Blue Swirl <address@hidden>
---
 bitops.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bitops.h b/bitops.h
index bc99727..1cecf00 100644
--- a/bitops.h
+++ b/bitops.h
@@ -153,7 +153,7 @@ static inline void change_bit(unsigned int nr, unsigned 
long *addr)
  * @nr: Bit to set
  * @addr: Address to count from
  */
-static inline int test_and_set_bit(unsigned int nr, unsigned long *addr)
+static inline bool test_and_set_bit(unsigned int nr, unsigned long *addr)
 {
        unsigned long mask = BIT_MASK(nr);
        unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -168,7 +168,7 @@ static inline int test_and_set_bit(unsigned int nr, 
unsigned long *addr)
  * @nr: Bit to clear
  * @addr: Address to count from
  */
-static inline int test_and_clear_bit(unsigned int nr, unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned int nr, unsigned long *addr)
 {
        unsigned long mask = BIT_MASK(nr);
        unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -183,7 +183,7 @@ static inline int test_and_clear_bit(unsigned int nr, 
unsigned long *addr)
  * @nr: Bit to change
  * @addr: Address to count from
  */
-static inline int test_and_change_bit(unsigned int nr, unsigned long *addr)
+static inline bool test_and_change_bit(unsigned int nr, unsigned long *addr)
 {
        unsigned long mask = BIT_MASK(nr);
        unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -198,7 +198,7 @@ static inline int test_and_change_bit(unsigned int nr, 
unsigned long *addr)
  * @nr: bit number to test
  * @addr: Address to start counting from
  */
-static inline int test_bit(unsigned int nr, const unsigned long *addr)
+static inline bool test_bit(unsigned int nr, const unsigned long *addr)
 {
        return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
 }
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]