From 7a9f8d8d6bf72fcea210552b7bec9b99f342f857 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 7 Jul 2023 14:34:56 +0200 Subject: Use struct initializers instead of memset() This is a bit more type-safe. --- render/gles2/texture.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'render/gles2') diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 5faa54a2..4f884d73 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -373,8 +373,9 @@ struct wlr_texture *gles2_texture_from_buffer(struct wlr_renderer *wlr_renderer, void wlr_gles2_texture_get_attribs(struct wlr_texture *wlr_texture, struct wlr_gles2_texture_attribs *attribs) { struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture); - memset(attribs, 0, sizeof(*attribs)); - attribs->target = texture->target; - attribs->tex = texture->tex; - attribs->has_alpha = texture->has_alpha; + *attribs = (struct wlr_gles2_texture_attribs){ + .target = texture->target, + .tex = texture->tex, + .has_alpha = texture->has_alpha, + }; } -- cgit v1.2.3