From 3a61976af798290023cc7e9bf2e120383c2dbef1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 9 Sep 2022 11:08:36 -0500 Subject: [PATCH] matrix: Make matrix const in weston_matrix_transform This function doesn't need to change the matrix, so we might as well enforce that. Signed-off-by: Derek Foreman --- include/libweston/matrix.h | 3 ++- shared/matrix.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/libweston/matrix.h b/include/libweston/matrix.h index 95a262bb6..2d3418a7f 100644 --- a/include/libweston/matrix.h +++ b/include/libweston/matrix.h @@ -59,7 +59,8 @@ weston_matrix_translate(struct weston_matrix *matrix, void weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin); void -weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v); +weston_matrix_transform(const struct weston_matrix *matrix, + struct weston_vector *v); int weston_matrix_invert(struct weston_matrix *inverse, diff --git a/shared/matrix.c b/shared/matrix.c index 0df228408..4c35ca3ff 100644 --- a/shared/matrix.c +++ b/shared/matrix.c @@ -110,7 +110,8 @@ weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin) /* v <- m * v */ WL_EXPORT void -weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v) +weston_matrix_transform(const struct weston_matrix *matrix, + struct weston_vector *v) { int i, j; struct weston_vector t;