From 6f7c5c558006bb69fdf0af73103097c012ccfed5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 25 Jul 2013 13:21:09 +1000 Subject: 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 --- src/caps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/caps.c') diff --git a/src/caps.c b/src/caps.c index 45c185c..2e6b0d4 100644 --- a/src/caps.c +++ b/src/caps.c @@ -61,10 +61,10 @@ static struct input_absinfo *get_info(struct mtdev *dev, int code) return NULL; ix = mtdev_abs2mt(code); - if (ix < 11) + if (ix < LEGACY_API_NUM_MT_AXES) return &dev->abs[ix]; else - return &dev->state->ext_abs[ix - 11]; + return &dev->state->ext_abs[ix - LEGACY_API_NUM_MT_AXES]; } static void set_info(struct mtdev *dev, int code, @@ -156,10 +156,10 @@ int mtdev_has_mt_event(const struct mtdev *dev, int code) return 0; ix = mtdev_abs2mt(code); - if (ix < 11) + if (ix < LEGACY_API_NUM_MT_AXES) return dev->has_abs[ix]; else - return dev->state->has_ext_abs[ix - 11]; + return dev->state->has_ext_abs[ix - LEGACY_API_NUM_MT_AXES]; } int mtdev_get_abs_minimum(const struct mtdev *dev, int code) @@ -203,10 +203,10 @@ void mtdev_set_mt_event(struct mtdev *dev, int code, int value) return; ix = mtdev_abs2mt(code); - if (ix < 11) + if (ix < LEGACY_API_NUM_MT_AXES) dev->has_abs[ix] = value; else - dev->state->has_ext_abs[ix - 11] = value; + dev->state->has_ext_abs[ix - LEGACY_API_NUM_MT_AXES] = value; } void mtdev_set_abs_maximum(struct mtdev *dev, int code, int value) -- cgit v1.2.3