From 2a16c522b9c08b34e0586912cb6423e0493e6489 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 13 Dec 2016 09:54:30 +1000 Subject: [PATCH] touchpad: constify a few helper functions May help the compiler with further optimization Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 2 +- src/evdev-mt-touchpad.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 762f5396..7bac8ecd 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -476,7 +476,7 @@ tp_process_key(struct tp_dispatch *tp, } static void -tp_unpin_finger(struct tp_dispatch *tp, struct tp_touch *t) +tp_unpin_finger(const struct tp_dispatch *tp, struct tp_touch *t) { double xdist, ydist; diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index db0a51a4..b9ca5bff 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -388,7 +388,8 @@ tp_libinput_context(const struct tp_dispatch *tp) } static inline struct normalized_coords -tp_normalize_delta(struct tp_dispatch *tp, struct device_float_coords delta) +tp_normalize_delta(const struct tp_dispatch *tp, + struct device_float_coords delta) { struct normalized_coords normalized; @@ -403,7 +404,8 @@ tp_normalize_delta(struct tp_dispatch *tp, struct device_float_coords delta) * in the x-axis' coordinate space. */ static inline struct device_float_coords -tp_unnormalize_for_xaxis(struct tp_dispatch *tp, struct normalized_coords delta) +tp_unnormalize_for_xaxis(const struct tp_dispatch *tp, + struct normalized_coords delta) { struct device_float_coords raw;