summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-09-05 11:33:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2022-09-08 09:03:15 +1000
commitfc1a28951a4d0cd37150ca7a997aa9227b4d6061 (patch)
treeced9adb5930fe11abe02931363e0a71401d1fea2
parent0bb82faab1786a194ad37456dc35d5a9953d3d1e (diff)
downloadlibinput-fc1a28951a4d0cd37150ca7a997aa9227b4d6061.tar.gz
filter: constify the interfaces and make them static
No functional change Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/filter-flat.c2
-rw-r--r--src/filter-low-dpi.c2
-rw-r--r--src/filter-mouse.c2
-rw-r--r--src/filter-private.h2
-rw-r--r--src/filter-tablet.c2
-rw-r--r--src/filter-touchpad-flat.c2
-rw-r--r--src/filter-touchpad-x230.c2
-rw-r--r--src/filter-touchpad.c2
-rw-r--r--src/filter-trackpoint.c2
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,