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

@ -39,8 +39,8 @@ struct wlr_drm_lease {
struct wlr_backend *wlr_drm_backend_create(struct wlr_session *session,
struct wlr_device *dev, struct wlr_backend *parent);
bool wlr_backend_is_drm(struct wlr_backend *backend);
bool wlr_output_is_drm(struct wlr_output *output);
bool wlr_backend_is_drm(const struct wlr_backend *backend);
bool wlr_output_is_drm(const struct wlr_output *output);
/**
* Get the parent DRM backend, if any.

View file

@ -25,7 +25,7 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_event_loop *loop);
struct wlr_output *wlr_headless_add_output(struct wlr_backend *backend,
unsigned int width, unsigned int height);
bool wlr_backend_is_headless(struct wlr_backend *backend);
bool wlr_output_is_headless(struct wlr_output *output);
bool wlr_backend_is_headless(const struct wlr_backend *backend);
bool wlr_output_is_headless(const struct wlr_output *output);
#endif

View file

@ -29,7 +29,7 @@ struct libinput_device *wlr_libinput_get_device_handle(
struct libinput_tablet_tool *wlr_libinput_get_tablet_tool_handle(
struct wlr_tablet_tool *wlr_tablet_tool);
bool wlr_backend_is_libinput(struct wlr_backend *backend);
bool wlr_backend_is_libinput(const struct wlr_backend *backend);
bool wlr_input_device_is_libinput(struct wlr_input_device *device);
#endif

View file

@ -26,7 +26,7 @@ bool wlr_multi_backend_add(struct wlr_backend *multi,
void wlr_multi_backend_remove(struct wlr_backend *multi,
struct wlr_backend *backend);
bool wlr_backend_is_multi(struct wlr_backend *backend);
bool wlr_backend_is_multi(const struct wlr_backend *backend);
bool wlr_multi_is_empty(struct wlr_backend *backend);
void wlr_multi_for_each_backend(struct wlr_backend *backend,

View file

@ -46,7 +46,7 @@ struct wlr_output *wlr_wl_output_create_from_surface(struct wlr_backend *backend
/**
* Check whether the provided backend is a Wayland backend.
*/
bool wlr_backend_is_wl(struct wlr_backend *backend);
bool wlr_backend_is_wl(const struct wlr_backend *backend);
/**
* Check whether the provided input device is a Wayland input device.
@ -56,7 +56,7 @@ bool wlr_input_device_is_wl(struct wlr_input_device *device);
/**
* Check whether the provided output device is a Wayland output device.
*/
bool wlr_output_is_wl(struct wlr_output *output);
bool wlr_output_is_wl(const struct wlr_output *output);
/**
* Sets the title of a struct wlr_output which is a Wayland toplevel.

View file

@ -31,7 +31,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend);
/**
* Check whether this backend is an X11 backend.
*/
bool wlr_backend_is_x11(struct wlr_backend *backend);
bool wlr_backend_is_x11(const struct wlr_backend *backend);
/**
* Check whether this input device is an X11 input device.
@ -41,7 +41,7 @@ bool wlr_input_device_is_x11(struct wlr_input_device *device);
/**
* Check whether this output device is an X11 output device.
*/
bool wlr_output_is_x11(struct wlr_output *output);
bool wlr_output_is_x11(const struct wlr_output *output);
/**
* Sets the title of a struct wlr_output which is an X11 window.

View file

@ -42,9 +42,9 @@ struct wlr_gles2_texture_attribs {
bool has_alpha;
};
bool wlr_renderer_is_gles2(struct wlr_renderer *wlr_renderer);
bool wlr_render_timer_is_gles2(struct wlr_render_timer *timer);
bool wlr_texture_is_gles2(struct wlr_texture *texture);
bool wlr_renderer_is_gles2(const struct wlr_renderer *wlr_renderer);
bool wlr_render_timer_is_gles2(const struct wlr_render_timer *timer);
bool wlr_texture_is_gles2(const struct wlr_texture *texture);
void wlr_gles2_texture_get_attribs(struct wlr_texture *texture,
struct wlr_gles2_texture_attribs *attribs);

View file

@ -14,8 +14,8 @@
struct wlr_renderer *wlr_pixman_renderer_create(void);
bool wlr_renderer_is_pixman(struct wlr_renderer *wlr_renderer);
bool wlr_texture_is_pixman(struct wlr_texture *texture);
bool wlr_renderer_is_pixman(const struct wlr_renderer *wlr_renderer);
bool wlr_texture_is_pixman(const struct wlr_texture *texture);
pixman_image_t *wlr_pixman_renderer_get_buffer_image(
struct wlr_renderer *wlr_renderer, struct wlr_buffer *wlr_buffer);

View file

@ -25,8 +25,8 @@ VkPhysicalDevice wlr_vk_renderer_get_physical_device(struct wlr_renderer *render
VkDevice wlr_vk_renderer_get_device(struct wlr_renderer *renderer);
uint32_t wlr_vk_renderer_get_queue_family(struct wlr_renderer *renderer);
bool wlr_renderer_is_vk(struct wlr_renderer *wlr_renderer);
bool wlr_texture_is_vk(struct wlr_texture *texture);
bool wlr_renderer_is_vk(const struct wlr_renderer *wlr_renderer);
bool wlr_texture_is_vk(const struct wlr_texture *texture);
void wlr_vk_texture_get_image_attribs(struct wlr_texture *texture,
struct wlr_vk_image_attribs *attribs);