aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-06-09 14:02:04 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-06-09 14:02:04 +0200
commit7ef723e1c217652d6b329faa6aa3120fbd91d24c (patch)
tree887f896ad9adf289bdde208f991f07da65134309 /common.h
parente437f7148ad5836a13d797eb322139f6a4b4668e (diff)
downloadhourglass-7ef723e1c217652d6b329faa6aa3120fbd91d24c.tar.gz
hourglass-7ef723e1c217652d6b329faa6aa3120fbd91d24c.tar.bz2
hourglass-7ef723e1c217652d6b329faa6aa3120fbd91d24c.zip
Replace array size calculation with macro
Diffstat (limited to 'common.h')
-rw-r--r--common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common.h b/common.h
index 7b699ca..58a253e 100644
--- a/common.h
+++ b/common.h
@@ -67,6 +67,8 @@ extern volatile uint8_t wakeup;
void shutdownError ();
#define sign(x) ((x < 0) ? -1 : 1)
+/* get an array’s size/length */
+#define length(x) (sizeof(x)/sizeof(*x))
#endif /* COMMON_H */