mirror of
https://github.com/troglobit/libite.git
synced 2026-11-10 16:31:15 +00:00
Add some very useful helper macros: NELEMS() and bitops.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
a4cbc7a10e
commit
117ec58a90
2 files changed
+50
No files matched your search
@@ -57,6 +57,31 @@ Helper Macros
|
||||
|
||||
Mysteriously missing from GLIBC
|
||||
|
||||
- `ISCLR(word,bit)`
|
||||
|
||||
Is bit in (integer) word cleared?
|
||||
|
||||
- `ISSET(word,bit)`
|
||||
|
||||
Is bit in (integer) word set?
|
||||
|
||||
- `ISOTHER(word,bit)`
|
||||
|
||||
Is any other bits, except bit, in (integer) word set?
|
||||
|
||||
- `SETBIT(word,bit)`
|
||||
|
||||
Set bit in (integer) word.
|
||||
|
||||
- `CLRBIT(word,bit)`
|
||||
|
||||
Clear bit in (integer) word.
|
||||
|
||||
- `NELEMS(array)`
|
||||
|
||||
Returns the number of elements in an array. From the great book, The
|
||||
Practice of Programming, by Kernighan and Pike.
|
||||
|
||||
- `UNUSED(var)`
|
||||
|
||||
Shorter and more readable version of `var __attribute__ ((unused))`
|
||||
|
||||
Reference in new issue
Block a user