projects
/
platform
/
upstream
/
kmscon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
79ef4f9
)
shl: misc: add SHL_HAS_BITS() helper
author
David Herrmann
<dh.herrmann@googlemail.com>
Mon, 1 Oct 2012 10:21:10 +0000
(12:21 +0200)
committer
David Herrmann
<dh.herrmann@googlemail.com>
Mon, 1 Oct 2012 10:21:10 +0000
(12:21 +0200)
This helper checks whether a bitmask has all the given bits set.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/shl_misc.h
patch
|
blob
|
history
diff --git
a/src/shl_misc.h
b/src/shl_misc.h
index
724a7c0
..
47bee10
100644
(file)
--- a/
src/shl_misc.h
+++ b/
src/shl_misc.h
@@
-38,6
+38,8
@@
#include <stdlib.h>
#include <xkbcommon/xkbcommon.h>
+#define SHL_HAS_BITS(_bitmask, _bits) (((_bitmask) & (_bits)) == (_bits))
+
static inline int shl_strtou(const char *input, unsigned int *output)
{
unsigned long val;