C-libs 0.1.0
Some C utils libraries
 
Loading...
Searching...
No Matches
Manipulation Macros

Macros

#define BIT(x)
 
#define SETBIT(x, p)
 
#define CLEARBIT(x, p)
 
#define GETBIT(x, p)
 
#define TOGGLEBIT(x, p)
 

Detailed Description

Simple macros for setting, clearing, and querying bits.

Macro Definition Documentation

◆ BIT

#define BIT ( x)
Value:
(1 << (x))

◆ CLEARBIT

#define CLEARBIT ( x,
p )
Value:
((x) & (~(1 << (p))))

◆ GETBIT

#define GETBIT ( x,
p )
Value:
(((x) >> (p)) & 1)

◆ SETBIT

#define SETBIT ( x,
p )
Value:
((x) | (1 << (p)))

◆ TOGGLEBIT

#define TOGGLEBIT ( x,
p )
Value:
((x) ^ (1 << (p)))