diff options
author | Bernhard Übelacker <bernhardu@mailbox.org> | 2019-12-31 23:35:03 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2020-01-03 09:33:06 -0800 |
commit | 46f09cf3660481655c945125c950e5efff3a2f8f (patch) | |
tree | 8ae2b1efbadcd066dcf8a383c341713b33971571 /deps | |
parent | a3224ab9a0542d295e2e3eafb1ad5b9c7bb9ce75 (diff) |
cpubits macro fixes
Diffstat (limited to 'deps')
-rw-r--r-- | deps/sysobj_early/include/cpubits.h | 6 |
1 files changed, 3 insertions, 3 deletions
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) |