mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -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
|
|
@ -22,7 +22,8 @@ bool wlr_texture_is_vk(struct wlr_texture *wlr_texture) {
|
|||
|
||||
struct wlr_vk_texture *vulkan_get_texture(struct wlr_texture *wlr_texture) {
|
||||
assert(wlr_texture_is_vk(wlr_texture));
|
||||
return (struct wlr_vk_texture *)wlr_texture;
|
||||
struct wlr_vk_texture *texture = wl_container_of(wlr_texture, texture, wlr_texture);
|
||||
return texture;
|
||||
}
|
||||
|
||||
static VkImageAspectFlagBits mem_plane_aspect(unsigned i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue