summaryrefslogtreecommitdiffhomepage
path: root/ir/adt
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-13 20:12:35 +0100
committerMatthias Braun <matze@braunis.de>2016-02-13 20:47:39 +0100
commit206f8441e918c355160fd80c783d37f8a7e88be0 (patch)
tree55ceb89203cd5148f7f4da7ee7960c64477ff078 /ir/adt
parent8c9e32f417e25eadf7ae846e494a550506f8aee9 (diff)
Rename is_po2() to is_po2_or_zero()
The function also returns true for zero even though that is not a power of two.
Diffstat (limited to 'ir/adt')
-rw-r--r--ir/adt/bitfiddle.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ir/adt/bitfiddle.h b/ir/adt/bitfiddle.h
index e11e97a..1dd72aa 100644
--- a/ir/adt/bitfiddle.h
+++ b/ir/adt/bitfiddle.h
@@ -158,9 +158,9 @@ static inline uint32_t ceil_po2(uint32_t x)
}
/**
- * Tests whether @p x is a power of 2
+ * Returns true if \p x is a power of two or zero.
*/
-static inline bool is_po2(unsigned x)
+static inline bool is_po2_or_zero(unsigned x)
{
return (x & (x-1)) == 0;
}