Add const to x11 and input interfaces

This commit is contained in:
Scott Anderson 2018-03-06 19:59:10 +13:00
parent 902d6cc240
commit 3c9fc7c68e
6 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ static void input_device_destroy(struct wlr_input_device *wlr_dev) {
free(device); free(device);
} }
static struct wlr_input_device_impl input_device_impl = { static const struct wlr_input_device_impl input_device_impl = {
.destroy = input_device_destroy, .destroy = input_device_destroy,
}; };

View file

@ -31,7 +31,7 @@ static void wlr_libinput_device_destroy(struct wlr_input_device *_dev) {
free(dev); free(dev);
} }
static struct wlr_input_device_impl input_device_impl = { static const struct wlr_input_device_impl input_device_impl = {
.destroy = wlr_libinput_device_destroy .destroy = wlr_libinput_device_destroy
}; };

View file

@ -26,9 +26,9 @@
#define XCB_EVENT_RESPONSE_TYPE_MASK 0x7f #define XCB_EVENT_RESPONSE_TYPE_MASK 0x7f
static struct wlr_backend_impl backend_impl; static const struct wlr_backend_impl backend_impl;
static struct wlr_output_impl output_impl; static const struct wlr_output_impl output_impl;
static struct wlr_input_device_impl input_device_impl = { 0 }; static const struct wlr_input_device_impl input_device_impl = { 0 };
static uint32_t xcb_button_to_wl(uint32_t button) { static uint32_t xcb_button_to_wl(uint32_t button) {
switch (button) { switch (button) {
@ -337,7 +337,7 @@ static struct wlr_renderer *wlr_x11_backend_get_renderer(
return x11->renderer; return x11->renderer;
} }
static struct wlr_backend_impl backend_impl = { static const struct wlr_backend_impl backend_impl = {
.start = wlr_x11_backend_start, .start = wlr_x11_backend_start,
.destroy = wlr_x11_backend_destroy, .destroy = wlr_x11_backend_destroy,
.get_egl = wlr_x11_backend_get_egl, .get_egl = wlr_x11_backend_get_egl,
@ -465,7 +465,7 @@ static bool output_swap_buffers(struct wlr_output *wlr_output,
return wlr_egl_swap_buffers(&x11->egl, output->surf, damage); return wlr_egl_swap_buffers(&x11->egl, output->surf, damage);
} }
static struct wlr_output_impl output_impl = { static const struct wlr_output_impl output_impl = {
.set_custom_mode = output_set_custom_mode, .set_custom_mode = output_set_custom_mode,
.transform = output_transform, .transform = output_transform,
.destroy = output_destroy, .destroy = output_destroy,

View file

@ -10,7 +10,7 @@ struct wlr_input_device_impl {
void wlr_input_device_init( void wlr_input_device_init(
struct wlr_input_device *wlr_device, struct wlr_input_device *wlr_device,
enum wlr_input_device_type type, enum wlr_input_device_type type,
struct wlr_input_device_impl *impl, const struct wlr_input_device_impl *impl,
const char *name, int vendor, int product); const char *name, int vendor, int product);
void wlr_input_device_destroy(struct wlr_input_device *dev); void wlr_input_device_destroy(struct wlr_input_device *dev);

View file

@ -24,7 +24,7 @@ enum wlr_input_device_type {
struct wlr_input_device_impl; struct wlr_input_device_impl;
struct wlr_input_device { struct wlr_input_device {
struct wlr_input_device_impl *impl; const struct wlr_input_device_impl *impl;
enum wlr_input_device_type type; enum wlr_input_device_type type;
int vendor, product; int vendor, product;

View file

@ -14,7 +14,7 @@
void wlr_input_device_init(struct wlr_input_device *dev, void wlr_input_device_init(struct wlr_input_device *dev,
enum wlr_input_device_type type, enum wlr_input_device_type type,
struct wlr_input_device_impl *impl, const struct wlr_input_device_impl *impl,
const char *name, int vendor, int product) { const char *name, int vendor, int product) {
dev->type = type; dev->type = type;
dev->impl = impl; dev->impl = impl;