mirror of
https://github.com/Hizenberg469/C1-Linux_SYS_Prog-AS-.git
synced 2026-04-20 02:42:23 +03:00
unevalutated Assignment 5
This commit is contained in:
@@ -3,11 +3,16 @@
|
||||
#ifndef __BITS__
|
||||
#define __BITS__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define IS_BIT_SET(n, pos) ((n & (1 << (pos))) != 0)
|
||||
#define TOGGLE_BIT(n, pos) (n = n ^ (1 << (pos)))
|
||||
#define COMPLEMENT(num) (num = num ^ 0xFFFFFFFF)
|
||||
#define UNSET_BIT(n, pos) (n = n & ((1 << pos) ^ 0xFFFFFFFF))
|
||||
#define SET_BIT(n, pos) (n = n | 1 << pos)
|
||||
|
||||
uint8_t
|
||||
count_bit_set(uint32_t n);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user