return IS_POW2(x);
}
-/* Returns the rightmost 1-bit in 'x' (e.g. 01011000 => 00001000), or 0 if 'x'
- * is 0. */
-static inline uintmax_t
-rightmost_1bit(uintmax_t x)
-{
- return x & -x;
-}
-
-/* Returns 'x' with its rightmost 1-bit changed to a zero (e.g. 01011000 =>
- * 01010000), or 0 if 'x' is 0. */
-static inline uintmax_t
-zero_rightmost_1bit(uintmax_t x)
-{
- return x & (x - 1);
-}
-
#ifndef MIN
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
#endif
char *follow_symlinks(const char *filename);
void ignore(bool x OVS_UNUSED);
+\f
+/* Bitwise tests. */
/* Returns the number of trailing 0-bits in 'n'. Undefined if 'n' == 0.
*
int log_2_ceil(uint32_t);
int popcount(uint32_t);
+/* Returns the rightmost 1-bit in 'x' (e.g. 01011000 => 00001000), or 0 if 'x'
+ * is 0. */
+static inline uintmax_t
+rightmost_1bit(uintmax_t x)
+{
+ return x & -x;
+}
+
+/* Returns 'x' with its rightmost 1-bit changed to a zero (e.g. 01011000 =>
+ * 01010000), or 0 if 'x' is 0. */
+static inline uintmax_t
+zero_rightmost_1bit(uintmax_t x)
+{
+ return x & (x - 1);
+}
+\f
bool is_all_zeros(const uint8_t *, size_t);
bool is_all_ones(const uint8_t *, size_t);
void bitwise_copy(const void *src, unsigned int src_len, unsigned int src_ofs,