mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05: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
|
|
@ -52,7 +52,8 @@ struct wlr_scene *scene_node_get_root(struct wlr_scene_node *node) {
|
|||
while (tree->node.parent != NULL) {
|
||||
tree = tree->node.parent;
|
||||
}
|
||||
return (struct wlr_scene *)tree;
|
||||
struct wlr_scene *scene = wl_container_of(tree, scene, tree);
|
||||
return scene;
|
||||
}
|
||||
|
||||
static void scene_node_init(struct wlr_scene_node *node,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue