mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Use wl_container_of() instead of casts
This slightly improves type safety.
The culprits were found with:
git grep -E '\([a-z0-9_ ]+ \*\)\W?[a-z]'
This commit is contained in:
parent
c2c536de03
commit
fe06e5f49a
29 changed files with 85 additions and 55 deletions
|
|
@ -7,7 +7,8 @@
|
|||
struct wlr_headless_backend *headless_backend_from_backend(
|
||||
struct wlr_backend *wlr_backend) {
|
||||
assert(wlr_backend_is_headless(wlr_backend));
|
||||
return (struct wlr_headless_backend *)wlr_backend;
|
||||
struct wlr_headless_backend *backend = wl_container_of(wlr_backend, backend, backend);
|
||||
return backend;
|
||||
}
|
||||
|
||||
static bool backend_start(struct wlr_backend *wlr_backend) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ static size_t last_output_num = 0;
|
|||
static struct wlr_headless_output *headless_output_from_output(
|
||||
struct wlr_output *wlr_output) {
|
||||
assert(wlr_output_is_headless(wlr_output));
|
||||
return (struct wlr_headless_output *)wlr_output;
|
||||
struct wlr_headless_output *output = wl_container_of(wlr_output, output, wlr_output);
|
||||
return output;
|
||||
}
|
||||
|
||||
static bool output_set_custom_mode(struct wlr_headless_output *output,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue