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/gles2 | |
parent | 4966857f211cb6f48852928076a59f16aadb742b (diff) |
Use struct initializers instead of memset()
This is a bit more type-safe.
Diffstat (limited to 'render/gles2')
-rw-r--r-- | render/gles2/texture.c | 9 |
1 files changed, 5 insertions, 4 deletions
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, + }; } |