From 46f09cf3660481655c945125c950e5efff3a2f8f Mon Sep 17 00:00:00 2001 From: Bernhard Übelacker Date: Tue, 31 Dec 2019 23:35:03 -0600 Subject: cpubits macro fixes --- deps/sysobj_early/include/cpubits.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'deps/sysobj_early') diff --git a/deps/sysobj_early/include/cpubits.h b/deps/sysobj_early/include/cpubits.h index a7effbf1..15686510 100644 --- a/deps/sysobj_early/include/cpubits.h +++ b/deps/sysobj_early/include/cpubits.h @@ -29,6 +29,6 @@ cpubits *cpubits_from_str(char *str); char *cpubits_to_str(cpubits *bits, char *str, int max_len); #define CPUBITS_SIZE 4096 /* bytes, multiple of sizeof(uint32_t) */ -#define CPUBIT_SET(BITS, BIT) (BITS[BIT/32] |= (1 << BIT%32)) -#define CPUBIT_GET(BITS, BIT) ((BITS[BIT/32] & (1 << BIT%32)) >> BIT%32) -#define CPUBITS_CLEAR(BITS) memset(BITS, 0, CPUBITS_SIZE) +#define CPUBIT_SET(BITS, BIT) ((BITS)[(BIT)/32] |= (1 << (BIT)%32)) +#define CPUBIT_GET(BITS, BIT) (((BITS)[(BIT)/32] & (1 << (BIT)%32)) >> (BIT)%32) +#define CPUBITS_CLEAR(BITS) memset((BITS), 0, CPUBITS_SIZE) -- cgit v1.2.3