aboutsummaryrefslogtreecommitdiff
path: root/render/pass.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-07-07 14:34:56 +0200
committerSimon Ser <contact@emersion.fr>2023-07-07 17:31:11 +0200
commit7a9f8d8d6bf72fcea210552b7bec9b99f342f857 (patch)
treec84c622b9ea25646c081f81b534ec7c70b84ac84 /render/pass.c
parent4966857f211cb6f48852928076a59f16aadb742b (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.c5
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) {