Moved helper macro to a discrete include file.

To help reduce code duplication and also 'kitchen-sink' includes
the ARRAY_LENGTH macro was moved to a stand-alone file and
referenced from the sources consuming it. Other macros will be
added in subsequent passes.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Jon Cruz
2015-06-15 15:37:08 -07:00
committed by Bryce Harrington
parent 4678bab13c
commit 35b2eaa989
37 changed files with 83 additions and 19 deletions
+1 -2
View File
@@ -35,10 +35,9 @@
#include <wayland-client.h>
#include "window.h"
#include "shared/helpers.h"
#include "shared/matrix.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
/* Our points for the calibration must be not be on a line */
static const struct {
float x_ratio, y_ratio;
+1
View File
@@ -41,6 +41,7 @@
#include "window.h"
#include "shared/cairo-util.h"
#include "shared/helpers.h"
struct dnd_drag;
+1
View File
@@ -36,6 +36,7 @@
#include <pango/pangocairo.h>
#include "shared/helpers.h"
#include "window.h"
#include "text-client-protocol.h"
+1
View File
@@ -38,6 +38,7 @@
#include <cairo.h>
#include "shared/helpers.h"
#include "window.h"
/** window title */
+1 -1
View File
@@ -35,6 +35,7 @@
#include <wayland-cursor.h>
#include "shared/cairo-util.h"
#include "shared/config-parser.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "ivi-application-client-protocol.h"
#include "ivi-hmi-controller-client-protocol.h"
@@ -175,7 +176,6 @@ mem_alloc(size_t size, char *file, int32_t line)
}
#define MEM_ALLOC(s) mem_alloc((s),__FILE__,__LINE__)
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
/*****************************************************************************
* Event Handler
+1
View File
@@ -46,6 +46,7 @@
#define WL_HIDE_DEPRECATED
#include <wayland-server.h>
#include "shared/helpers.h"
#include "window.h"
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+1 -2
View File
@@ -36,11 +36,10 @@
#include <time.h>
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "presentation_timing-client-protocol.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
enum run_mode {
RUN_MODE_FEEDBACK,
RUN_MODE_FEEDBACK_IDLE,
+1 -2
View File
@@ -33,10 +33,9 @@
#include <sys/mman.h>
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
struct seat {
struct touch *touch;
struct wl_seat *seat;
+1
View File
@@ -32,6 +32,7 @@
#include <linux/input.h>
#include <cairo.h>
#include "shared/helpers.h"
#include "window.h"
struct stacking {
+1
View File
@@ -41,6 +41,7 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include "shared/helpers.h"
#include "window.h"
#if 0
+1
View File
@@ -44,6 +44,7 @@
#include <wayland-client.h>
#include "shared/config-parser.h"
#include "shared/helpers.h"
#include "window.h"
static int option_fullscreen;
+1 -2
View File
@@ -32,11 +32,10 @@
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "presentation_timing-client-protocol.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
typedef void (*print_info_t)(void *info);
+1
View File
@@ -67,6 +67,7 @@ typedef void *EGLContext;
#include <linux/input.h>
#include <wayland-client.h>
#include "shared/cairo-util.h"
#include "shared/helpers.h"
#include "xdg-shell-client-protocol.h"
#include "text-cursor-position-client-protocol.h"
#include "workspaces-client-protocol.h"
-2
View File
@@ -33,8 +33,6 @@
#include "shared/zalloc.h"
#include "shared/platform.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
#define container_of(ptr, type, member) ({ \
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
+1
View File
@@ -37,6 +37,7 @@
#include "desktop-shell-client-protocol.h"
#include "window.h"
#include "shared/helpers.h"
extern struct wscreensaver_plugin glmatrix_screensaver;