]> git.itanic.dy.fi Git - log-plotter/commitdiff
Move random utility macros into utils.h
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 29 Oct 2013 20:15:15 +0000 (22:15 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Thu, 31 Oct 2013 19:17:43 +0000 (21:17 +0200)
Avoid defining useful utility macros in C files.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
data.c
utils.h [new file with mode: 0644]

diff --git a/data.c b/data.c
index 890e6bdebcf1a7a245cac4d22b3d93eca1a3c70c..fa370729b0c8a242b4efa053cc569a9dcfa4f632 100644 (file)
--- a/data.c
+++ b/data.c
@@ -11,8 +11,8 @@
 
 #include "data.h"
 #include "trace.h"
+#include "utils.h"
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 static int separate_entries(char *buf, char *entries[], int max_entries)
 {
diff --git a/utils.h b/utils.h
new file mode 100644 (file)
index 0000000..8b5152e
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,6 @@
+#ifndef _UTILS_H
+#define _UTILS_H
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#endif