diff options
author | Simon Ser <contact@emersion.fr> | 2023-07-07 14:34:56 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-07-07 17:31:11 +0200 |
commit | 7a9f8d8d6bf72fcea210552b7bec9b99f342f857 (patch) | |
tree | c84c622b9ea25646c081f81b534ec7c70b84ac84 /render/pass.c | |
parent | 4966857f211cb6f48852928076a59f16aadb742b (diff) |
Use struct initializers instead of memset()
This is a bit more type-safe.
Diffstat (limited to 'render/pass.c')
-rw-r--r-- | render/pass.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/render/pass.c b/render/pass.c index c64772db..650353cb 100644 --- a/render/pass.c +++ b/render/pass.c @@ -15,8 +15,9 @@ struct wlr_render_pass_legacy { void wlr_render_pass_init(struct wlr_render_pass *render_pass, const struct wlr_render_pass_impl *impl) { assert(impl->submit && impl->add_texture && impl->add_rect); - memset(render_pass, 0, sizeof(*render_pass)); - render_pass->impl = impl; + *render_pass = (struct wlr_render_pass){ + .impl = impl, + }; } bool wlr_render_pass_submit(struct wlr_render_pass *render_pass) { |