treewide: make type-check helpers take const pointers

This commit is contained in:
YaoBing Xiao 2026-03-06 15:59:18 +08:00
parent 3336d28813
commit 14b3c96c1e
26 changed files with 38 additions and 38 deletions

View file

@ -95,7 +95,7 @@ static const struct wlr_backend_impl backend_impl = {
.commit = backend_commit,
};
bool wlr_backend_is_drm(struct wlr_backend *b) {
bool wlr_backend_is_drm(const struct wlr_backend *b) {
return b->impl == &backend_impl;
}

View file

@ -1299,7 +1299,7 @@ static const struct wlr_output_impl output_impl = {
.get_primary_formats = drm_connector_get_primary_formats,
};
bool wlr_output_is_drm(struct wlr_output *output) {
bool wlr_output_is_drm(const struct wlr_output *output) {
return output->impl == &output_impl;
}

View file

@ -81,6 +81,6 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_event_loop *loop) {
return &backend->backend;
}
bool wlr_backend_is_headless(struct wlr_backend *backend) {
bool wlr_backend_is_headless(const struct wlr_backend *backend) {
return backend->impl == &backend_impl;
}

View file

@ -106,7 +106,7 @@ static const struct wlr_output_impl output_impl = {
.move_cursor = output_move_cursor,
};
bool wlr_output_is_headless(struct wlr_output *wlr_output) {
bool wlr_output_is_headless(const struct wlr_output *wlr_output) {
return wlr_output->impl == &output_impl;
}

View file

@ -155,7 +155,7 @@ static const struct wlr_backend_impl backend_impl = {
.destroy = backend_destroy,
};
bool wlr_backend_is_libinput(struct wlr_backend *b) {
bool wlr_backend_is_libinput(const struct wlr_backend *b) {
return b->impl == &backend_impl;
}

View file

@ -173,7 +173,7 @@ struct wlr_backend *wlr_multi_backend_create(struct wl_event_loop *loop) {
return &backend->backend;
}
bool wlr_backend_is_multi(struct wlr_backend *b) {
bool wlr_backend_is_multi(const struct wlr_backend *b) {
return b->impl == &backend_impl;
}

View file

@ -577,7 +577,7 @@ static const struct wlr_backend_impl backend_impl = {
.get_drm_fd = backend_get_drm_fd,
};
bool wlr_backend_is_wl(struct wlr_backend *b) {
bool wlr_backend_is_wl(const struct wlr_backend *b) {
return b->impl == &backend_impl;
}

View file

@ -1027,7 +1027,7 @@ static const struct wlr_output_impl output_impl = {
.get_primary_formats = output_get_formats,
};
bool wlr_output_is_wl(struct wlr_output *wlr_output) {
bool wlr_output_is_wl(const struct wlr_output *wlr_output) {
return wlr_output->impl == &output_impl;
}

View file

@ -218,7 +218,7 @@ static const struct wlr_backend_impl backend_impl = {
.get_drm_fd = backend_get_drm_fd,
};
bool wlr_backend_is_x11(struct wlr_backend *backend) {
bool wlr_backend_is_x11(const struct wlr_backend *backend) {
return backend->impl == &backend_impl;
}

View file

@ -711,7 +711,7 @@ void handle_x11_configure_notify(struct wlr_x11_output *output,
wlr_output_state_finish(&state);
}
bool wlr_output_is_x11(struct wlr_output *wlr_output) {
bool wlr_output_is_x11(const struct wlr_output *wlr_output) {
return wlr_output->impl == &output_impl;
}