aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-05-10 16:59:26 +0200
committerMattias Andrée <maandree@kth.se>2017-05-10 16:59:26 +0200
commit6b998b5ed066aeece1146fe245b35965319b3cbd (patch)
treec963b48fbefafcec89a4e4af238869a1cb51148e /src/util.h
parentblind-flip is optimal (diff)
downloadblind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.gz
blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.bz2
blind-6b998b5ed066aeece1146fe245b35965319b3cbd.tar.xz
Cleaner code
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 42b5df5..ce5f647 100644
--- a/src/util.h
+++ b/src/util.h
@@ -5,6 +5,8 @@
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define CLIP(A, B, C) ((B) < (A) ? (A) : (B) > (C) ? (C) : (B))
+#define STRLEN(STR) (sizeof(STR) - 1)
+#define INTSTRLEN(TYPE) ((sizeof(TYPE) == 1 ? 3 : (5 * sizeof(TYPE) / 2)) + (TYPE)-1 < 0)
#define USAGE(SYNOPSIS)\
static void usage(void)\