mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04: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
|
|
@ -22,9 +22,10 @@
|
|||
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;
|
||||
*alloc = (struct wlr_allocator){
|
||||
.impl = impl,
|
||||
.buffer_caps = buffer_caps,
|
||||
};
|
||||
wl_signal_init(&alloc->events.destroy);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue