bitset: rename confusing macro NAND to ANDNOT

s/BIT_NAND/BIT_ANDNOT/, and for CPU and DOMAINSET too.  The actual
implementation is "and not" (or "but not"), i.e. A but not B.
Fortunately this does appear to be what all existing callers want.

Don't supply a NAND (not (A and B)) operation at this time.

Discussed with:	jeff
Reviewed by:	cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D22791
This commit is contained in:
Ryan Libby 2019-12-13 09:32:16 +00:00 committed by Sebastian Huber
parent 96c645a0b1
commit de1380c36b
2 changed files with 6 additions and 6 deletions

View File

@ -152,13 +152,13 @@
(d)->__bits[__i] = (s1)->__bits[__i] & (s2)->__bits[__i];\
} while (0)
#define BIT_NAND(_s, d, s) do { \
#define BIT_ANDNOT(_s, d, s) do { \
__size_t __i; \
for (__i = 0; __i < __bitset_words((_s)); __i++) \
(d)->__bits[__i] &= ~(s)->__bits[__i]; \
} while (0)
#define BIT_NAND2(_s, d, s1, s2) do { \
#define BIT_ANDNOT2(_s, d, s1, s2) do { \
__size_t __i; \
for (__i = 0; __i < __bitset_words((_s)); __i++) \
(d)->__bits[__i] = (s1)->__bits[__i] & ~(s2)->__bits[__i];\

View File

@ -177,16 +177,16 @@ static __inline void CPU_XOR(cpu_set_t *destset, const cpu_set_t *srcset1,
CPU_XOR_S(sizeof(*destset), destset, srcset1, srcset2);
}
static __inline void CPU_NAND_S(size_t setsize, cpu_set_t *destset,
static __inline void CPU_ANDNOT_S(size_t setsize, cpu_set_t *destset,
const cpu_set_t *srcset1, const cpu_set_t *srcset2)
{
BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
BIT_ANDNOT2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
}
static __inline void CPU_NAND(cpu_set_t *destset, const cpu_set_t *srcset1,
static __inline void CPU_ANDNOT(cpu_set_t *destset, const cpu_set_t *srcset1,
const cpu_set_t *srcset2)
{
CPU_NAND_S(sizeof(*destset), destset, srcset1, srcset2);
CPU_ANDNOT_S(sizeof(*destset), destset, srcset1, srcset2);
}
static __inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set)