From fc1a28951a4d0cd37150ca7a997aa9227b4d6061 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 5 Sep 2022 11:33:20 +1000 Subject: filter: constify the interfaces and make them static No functional change Signed-off-by: Peter Hutterer --- src/filter-flat.c | 2 +- src/filter-low-dpi.c | 2 +- src/filter-mouse.c | 2 +- src/filter-private.h | 2 +- src/filter-tablet.c | 2 +- src/filter-touchpad-flat.c | 2 +- src/filter-touchpad-x230.c | 2 +- src/filter-touchpad.c | 2 +- src/filter-trackpoint.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/filter-flat.c b/src/filter-flat.c index b07542ef..0ee6c922 100644 --- a/src/filter-flat.c +++ b/src/filter-flat.c @@ -100,7 +100,7 @@ accelerator_destroy_flat(struct motion_filter *filter) free(accel); } -struct motion_filter_interface accelerator_interface_flat = { +static const struct motion_filter_interface accelerator_interface_flat = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, .filter = accelerator_filter_flat, .filter_constant = accelerator_filter_noop_flat, diff --git a/src/filter-low-dpi.c b/src/filter-low-dpi.c index ea35656c..ffcf9114 100644 --- a/src/filter-low-dpi.c +++ b/src/filter-low-dpi.c @@ -205,7 +205,7 @@ accelerator_set_speed(struct motion_filter *filter, return true; } -struct motion_filter_interface accelerator_interface_low_dpi = { +static const struct motion_filter_interface accelerator_interface_low_dpi = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, .filter = accelerator_filter_low_dpi, .filter_constant = accelerator_filter_noop, diff --git a/src/filter-mouse.c b/src/filter-mouse.c index aa56a050..8f572752 100644 --- a/src/filter-mouse.c +++ b/src/filter-mouse.c @@ -269,7 +269,7 @@ pointer_accel_profile_linear(struct motion_filter *filter, return factor; } -struct motion_filter_interface accelerator_interface = { +static const struct motion_filter_interface accelerator_interface = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, .filter = accelerator_filter_linear, .filter_constant = accelerator_filter_noop, diff --git a/src/filter-private.h b/src/filter-private.h index b24a5c9a..470d1037 100644 --- a/src/filter-private.h +++ b/src/filter-private.h @@ -48,7 +48,7 @@ struct motion_filter_interface { struct motion_filter { double speed_adjustment; /* normalized [-1, 1] */ - struct motion_filter_interface *interface; + const struct motion_filter_interface *interface; }; struct pointer_tracker { diff --git a/src/filter-tablet.c b/src/filter-tablet.c index 24afb56c..4415b9ea 100644 --- a/src/filter-tablet.c +++ b/src/filter-tablet.c @@ -143,7 +143,7 @@ tablet_accelerator_destroy(struct motion_filter *filter) free(accel_filter); } -struct motion_filter_interface accelerator_interface_tablet = { +static const struct motion_filter_interface accelerator_interface_tablet = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, .filter = tablet_accelerator_filter_flat, .filter_constant = NULL, diff --git a/src/filter-touchpad-flat.c b/src/filter-touchpad-flat.c index bb6c31ad..34867af3 100644 --- a/src/filter-touchpad-flat.c +++ b/src/filter-touchpad-flat.c @@ -104,7 +104,7 @@ accelerator_destroy_touchpad_flat(struct motion_filter *filter) free(accel); } -struct motion_filter_interface accelerator_interface_touchpad_flat = { +static const struct motion_filter_interface accelerator_interface_touchpad_flat = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, .filter = accelerator_filter_touchpad_flat, .filter_constant = accelerator_filter_noop_touchpad_flat, diff --git a/src/filter-touchpad-x230.c b/src/filter-touchpad-x230.c index fa70a57d..90c42140 100644 --- a/src/filter-touchpad-x230.c +++ b/src/filter-touchpad-x230.c @@ -283,7 +283,7 @@ touchpad_lenovo_x230_accel_profile(struct motion_filter *filter, return factor * X230_MAGIC_SLOWDOWN / X230_TP_MAGIC_LOW_RES_FACTOR; } -struct motion_filter_interface accelerator_interface_x230 = { +static const struct motion_filter_interface accelerator_interface_x230 = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, .filter = accelerator_filter_x230, .filter_constant = accelerator_filter_constant_x230, diff --git a/src/filter-touchpad.c b/src/filter-touchpad.c index e8bc8c58..cd51a7ea 100644 --- a/src/filter-touchpad.c +++ b/src/filter-touchpad.c @@ -284,7 +284,7 @@ touchpad_accel_profile_linear(struct motion_filter *filter, return factor * TP_MAGIC_SLOWDOWN; } -struct motion_filter_interface accelerator_interface_touchpad = { +static const struct motion_filter_interface accelerator_interface_touchpad = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, .filter = accelerator_filter_touchpad, .filter_constant = touchpad_constant_filter, diff --git a/src/filter-trackpoint.c b/src/filter-trackpoint.c index c0686616..d1731e28 100644 --- a/src/filter-trackpoint.c +++ b/src/filter-trackpoint.c @@ -171,7 +171,7 @@ trackpoint_accelerator_destroy(struct motion_filter *filter) free(accel_filter); } -struct motion_filter_interface accelerator_interface_trackpoint = { +static const struct motion_filter_interface accelerator_interface_trackpoint = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, .filter = trackpoint_accelerator_filter, .filter_constant = trackpoint_accelerator_filter_noop, -- cgit v1.2.1