mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-15 22:05:31 -05:00
Use struct initializers instead of memset()
This is a bit more type-safe.
This commit is contained in:
parent
4966857f21
commit
7a9f8d8d6b
34 changed files with 134 additions and 113 deletions
|
|
@ -10,11 +10,12 @@ void wlr_texture_init(struct wlr_texture *texture, struct wlr_renderer *renderer
|
|||
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
|
||||
assert(renderer);
|
||||
|
||||
memset(texture, 0, sizeof(*texture));
|
||||
texture->renderer = renderer;
|
||||
texture->impl = impl;
|
||||
texture->width = width;
|
||||
texture->height = height;
|
||||
*texture = (struct wlr_texture){
|
||||
.renderer = renderer,
|
||||
.impl = impl,
|
||||
.width = width,
|
||||
.height = height,
|
||||
};
|
||||
}
|
||||
|
||||
void wlr_texture_destroy(struct wlr_texture *texture) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue