diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-14 09:03:23 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-08-15 13:33:30 +0200 |
commit | 166feaea3394e00af14418e074ae090e31922f33 (patch) | |
tree | 64a32fb03bd591d44e5d29816b451e72a6700a95 /libseat/backend/seatd.c | |
parent | 309650aa4d4be1310b20e7293a3bc0c47aeecf0e (diff) |
Make libseat_seat_listener const
libseat will never write to that struct. Let's allow callers to
make it read-only.
Diffstat (limited to 'libseat/backend/seatd.c')
-rw-r--r-- | libseat/backend/seatd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c index 97971aa..25d8e95 100644 --- a/libseat/backend/seatd.c +++ b/libseat/backend/seatd.c @@ -33,7 +33,7 @@ struct pending_event { struct backend_seatd { struct libseat base; struct connection connection; - struct libseat_seat_listener *seat_listener; + const struct libseat_seat_listener *seat_listener; void *seat_listener_data; struct linked_list pending_events; bool error; @@ -363,7 +363,7 @@ static int dispatch_and_execute(struct libseat *base, int timeout) { return predispatch + postdispatch; } -static struct libseat *_open_seat(struct libseat_seat_listener *listener, void *data, int fd) { +static struct libseat *_open_seat(const struct libseat_seat_listener *listener, void *data, int fd) { assert(listener != NULL); assert(listener->enable_seat != NULL && listener->disable_seat != NULL); struct backend_seatd *backend = calloc(1, sizeof(struct backend_seatd)); @@ -411,7 +411,7 @@ alloc_error: return NULL; } -static struct libseat *open_seat(struct libseat_seat_listener *listener, void *data) { +static struct libseat *open_seat(const struct libseat_seat_listener *listener, void *data) { int fd = seatd_connect(); if (fd == -1) { return NULL; |