mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after calling an init function.
This commit is contained in:
parent
54653b5d95
commit
6c350799b2
20 changed files with 29 additions and 1 deletions
|
|
@ -1,12 +1,14 @@
|
|||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wlr/render/interface.h>
|
||||
#include <wlr/render/wlr_texture.h>
|
||||
#include "types/wlr_buffer.h"
|
||||
|
||||
void wlr_texture_init(struct wlr_texture *texture,
|
||||
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
|
||||
memset(texture, 0, sizeof(*texture));
|
||||
texture->impl = impl;
|
||||
texture->width = width;
|
||||
texture->height = height;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue