aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-03 22:54:32 -0700
committerMichael Forney <mforney@mforney.org>2019-04-03 22:54:32 -0700
commit385d7b257acf087e02114c619beee07f2b49cb41 (patch)
tree3b6d5e74f240e60a97f89046c4324ae4ff075803 /util.h
parent5b8a2d225ca3777c7b49421182bb5c1faf99ae64 (diff)
Parse bit-fields
Diffstat (limited to 'util.h')
-rw-r--r--util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.h b/util.h
index ae70938..f60dc73 100644
--- a/util.h
+++ b/util.h
@@ -10,7 +10,8 @@ struct array {
extern char *argv0;
#define LEN(a) (sizeof(a) / sizeof((a)[0]))
-#define ALIGNUP(x, n) (((x) + (n) - 1) & ~((n) - 1))
+#define ALIGNDOWN(x, n) ((x) & -(n))
+#define ALIGNUP(x, n) ALIGNDOWN((x) + (n) - 1, n)
void warn(const char *, ...);
_Noreturn void fatal(const char *fmt, ...);