provide BZERO macro for bitsets
This commit is contained in:
parent
b5330f2a44
commit
8ed8f1cd4c
5 changed files with 8 additions and 7 deletions
|
@ -68,6 +68,7 @@ struct Bits {
|
|||
};
|
||||
|
||||
#define BIT(n) (1ul << (n))
|
||||
#define BZERO(b) ((b) = (Bits){{0}})
|
||||
#define BGET(b, n) (1&((b).t[n/NBit]>>(n%NBit)))
|
||||
#define BSET(b, n) ((b).t[n/NBit] |= BIT(n%NBit))
|
||||
#define BCLR(b, n) ((b).t[n/NBit] &= ~BIT(n%NBit))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue