summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2019-01-06 09:47:02 -0500
committerRob Clark <robdclark@gmail.com>2019-01-10 10:52:51 -0500
commitd8da3dcfdfe33ee525cf562e928a5266ac69843c (patch)
tree1dc1e9de501eb85824e74c6c41943cf9a472cb0b
parent485b385e966a63cecc143765d112d267b299ffe5 (diff)
downloadkmscube-d8da3dcfdfe33ee525cf562e928a5266ac69843c.tar.gz
De-duplicate ARRAY_SIZE macro
-rw-r--r--common.h2
-rw-r--r--cube-tex.c2
-rw-r--r--kmscube.c2
3 files changed, 2 insertions, 4 deletions
diff --git a/common.h b/common.h
index cff2c33..17c4073 100644
--- a/common.h
+++ b/common.h
@@ -33,6 +33,8 @@
#include <drm_fourcc.h>
#include <stdbool.h>
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
#ifndef DRM_FORMAT_MOD_LINEAR
#define DRM_FORMAT_MOD_LINEAR 0
#endif
diff --git a/cube-tex.c b/cube-tex.c
index 7cdc7ec..57fe02d 100644
--- a/cube-tex.c
+++ b/cube-tex.c
@@ -30,8 +30,6 @@
#include "common.h"
#include "esUtil.h"
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
struct {
struct egl egl;
diff --git a/kmscube.c b/kmscube.c
index 6275109..5a19556 100644
--- a/kmscube.c
+++ b/kmscube.c
@@ -37,8 +37,6 @@
GST_DEBUG_CATEGORY(kmscube_debug);
#endif
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
static const struct egl *egl;
static const struct gbm *gbm;
static const struct drm *drm;