summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-07-25 13:21:09 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-07-31 10:05:49 +1000
commit6f7c5c558006bb69fdf0af73103097c012ccfed5 (patch)
tree28f65a8c130d095784d21c8759c81621c63e4e68 /src/common.h
parentb5d8e8e26c0116e4b6e556a0f6da8777bc55c590 (diff)
Replace hardcoded 11 with a define
The 11 comes from the legacy API that we need to be binary compatible with. Make this clear with a define and a comment. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common.h b/src/common.h
index 2ec8eb8..80a3d6e 100644
--- a/src/common.h
+++ b/src/common.h
@@ -87,6 +87,14 @@ static inline int bitcount(unsigned v)
87/* robust system ioctl calls */ 87/* robust system ioctl calls */
88#define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) 88#define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
89 89
90/* To be compatible to the original, non-opaque mtdev API, we can only use 11
91 * axes in the basic struct. Everything else is hidden in the state, see the
92 * use of dev->abs[idx] vs dev->state->ext_abs[idx]
93 *
94 * See MT_ABS_SIZE in include/mtdev.h
95 */
96#define LEGACY_API_NUM_MT_AXES 11
97
90/** 98/**
91 * struct mtdev - represents an input MT device 99 * struct mtdev - represents an input MT device
92 * @has_mtdata: true if the device has MT capabilities 100 * @has_mtdata: true if the device has MT capabilities
@@ -105,9 +113,9 @@ static inline int bitcount(unsigned v)
105struct mtdev { 113struct mtdev {
106 int has_mtdata; 114 int has_mtdata;
107 int has_slot; 115 int has_slot;
108 int has_abs[11]; 116 int has_abs[LEGACY_API_NUM_MT_AXES];
109 struct input_absinfo slot; 117 struct input_absinfo slot;
110 struct input_absinfo abs[11]; 118 struct input_absinfo abs[LEGACY_API_NUM_MT_AXES];
111 struct mtdev_state *state; 119 struct mtdev_state *state;
112}; 120};
113 121