projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ba2a4c
)
New macro IS_POW2().
author
Ben Pfaff
<blp@nicira.com>
Wed, 24 Dec 2008 01:02:54 +0000
(17:02 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Wed, 24 Dec 2008 01:03:34 +0000
(17:03 -0800)
lib/util.h
patch
|
blob
|
history
diff --git
a/lib/util.h
b/lib/util.h
index 8172b69e46c96e0a20d832f4a983d5aaa2bdd1b4..2086a2ba930c124b793d848cbe994fb6d49c2a90 100644
(file)
--- a/
lib/util.h
+++ b/
lib/util.h
@@
-69,6
+69,7
@@
extern const char *program_name;
#define ARRAY_SIZE(ARRAY) (sizeof ARRAY / sizeof *ARRAY)
#define ROUND_UP(X, Y) (((X) + ((Y) - 1)) / (Y) * (Y))
#define ROUND_DOWN(X, Y) ((X) / (Y) * (Y))
+#define IS_POW2(X) ((X) && !((X) & ((X) - 1)))
#ifndef MIN
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))