mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -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
|
|
@ -18,6 +18,7 @@
|
|||
void wlr_allocator_init(struct wlr_allocator *alloc,
|
||||
const struct wlr_allocator_interface *impl, uint32_t buffer_caps) {
|
||||
assert(impl && impl->destroy && impl->create_buffer);
|
||||
memset(alloc, 0, sizeof(*alloc));
|
||||
alloc->impl = impl;
|
||||
alloc->buffer_caps = buffer_caps;
|
||||
wl_signal_init(&alloc->events.destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue