summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>2018-06-20 14:09:58 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2018-06-21 23:26:41 +0000
commit061e504261152f34d7bafc3142f8fe930270bfca (patch)
tree15b8464b3021d2bc6b694f29382434a7cc9ef803 /src
parent58b47f122dd9ff71b492b36bff95804e63e980bf (diff)
libinput-private: constify inline helpers
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Diffstat (limited to 'src')
-rw-r--r--src/libinput-private.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libinput-private.h b/src/libinput-private.h
index 6faf9e56..a012c114 100644
--- a/src/libinput-private.h
+++ b/src/libinput-private.h
@@ -656,7 +656,7 @@ libinput_now(struct libinput *libinput)
}
static inline struct device_float_coords
-device_delta(struct device_coords a, struct device_coords b)
+device_delta(const struct device_coords a, const struct device_coords b)
{
struct device_float_coords delta;
@@ -667,7 +667,7 @@ device_delta(struct device_coords a, struct device_coords b)
}
static inline struct device_float_coords
-device_average(struct device_coords a, struct device_coords b)
+device_average(const struct device_coords a, const struct device_coords b)
{
struct device_float_coords average;
@@ -678,7 +678,7 @@ device_average(struct device_coords a, struct device_coords b)
}
static inline struct device_float_coords
-device_float_delta(struct device_float_coords a, struct device_float_coords b)
+device_float_delta(const struct device_float_coords a, const struct device_float_coords b)
{
struct device_float_coords delta;
@@ -689,7 +689,7 @@ device_float_delta(struct device_float_coords a, struct device_float_coords b)
}
static inline struct device_float_coords
-device_float_average(struct device_float_coords a, struct device_float_coords b)
+device_float_average(const struct device_float_coords a, const struct device_float_coords b)
{
struct device_float_coords average;
@@ -700,25 +700,25 @@ device_float_average(struct device_float_coords a, struct device_float_coords b)
}
static inline bool
-device_float_is_zero(struct device_float_coords coords)
+device_float_is_zero(const struct device_float_coords coords)
{
return coords.x == 0.0 && coords.y == 0.0;
}
static inline double
-normalized_length(struct normalized_coords norm)
+normalized_length(const struct normalized_coords norm)
{
return hypot(norm.x, norm.y);
}
static inline bool
-normalized_is_zero(struct normalized_coords norm)
+normalized_is_zero(const struct normalized_coords norm)
{
return norm.x == 0.0 && norm.y == 0.0;
}
static inline double
-length_in_mm(struct phys_coords mm)
+length_in_mm(const struct phys_coords mm)
{
return hypot(mm.x, mm.y);
}
@@ -781,7 +781,7 @@ xy_get_direction(double x, double y)
}
static inline uint32_t
-phys_get_direction(struct phys_coords mm)
+phys_get_direction(const struct phys_coords mm)
{
return xy_get_direction(mm.x, mm.y);
}
@@ -791,7 +791,7 @@ phys_get_direction(struct phys_coords mm)
* assumption: coordinates are normalized to one axis resolution.
*/
static inline uint32_t
-device_float_get_direction(struct device_float_coords coords)
+device_float_get_direction(const struct device_float_coords coords)
{
return xy_get_direction(coords.x, coords.y);
}